| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

IODataManager.h
Go to the documentation of this file.
1 #ifndef GAUDIUTILS_IODATAMANAGER_H
2 #define GAUDIUTILS_IODATAMANAGER_H
3
4 // C++ include files
5 #include <map>
6 // Framework include files
7 #include "GaudiKernel/Service.h"
8 #include "GaudiUtils/IIODataManager.h"
9
10 class IIncidentSvc;
11
12 /*
13 * LHCb namespace declaration
14 */
15 namespace Gaudi {
16
17 // Forward declarations
18 class IFileCatalog;
19 class RawDataConnectionEntry;
20
29 class IODataManager : public extends<Service,
30 IIODataManager> {
31 protected:
32 typedef const std::string& CSTR;
33 struct Entry final {
34 std::string type;
35 IoType ioType;
36 IDataConnection* connection;
37 bool keepOpen;
38 Entry(CSTR tech,bool k, IoType iot,IDataConnection* con)
39 : type(tech), ioType(iot), connection(con), keepOpen(k) {
40 }
41 };
42 typedef std::map<std::string,Entry*> ConnectionMap;
43 typedef std::map<std::string, std::string> FidMap;
44
46 std::string m_catalogSvcName;
48 int m_ageLimit;
50 bool m_useGFAL;
52 bool m_quarantine;
55 bool m_disablePFNWarning;
56
58 ConnectionMap m_connectionMap;
60 SmartIF<IFileCatalog> m_catalog;
62 FidMap m_fidMap;
63 StatusCode connectDataIO(int typ, IoType rw, CSTR fn, CSTR technology, bool keep,Connection* con);
64 StatusCode reconnect(Entry* e);
65 StatusCode error(CSTR msg, bool rethrow);
66 StatusCode establishConnection(Connection* con);
67
68 SmartIF<IIncidentSvc> m_incSvc;
69
70 public:
71
77 IODataManager(CSTR nam, ISvcLocator* loc);
78
80 ~IODataManager() override = default;
81
83 StatusCode initialize() override;
84
86 StatusCode finalize() override;
87
89 StatusCode connectRead(bool keep_open, Connection* ioDesc) override;
91 StatusCode connectWrite(Connection* con,IoType mode=Connection::CREATE,CSTR doctype="UNKNOWN") override;
93 StatusCode disconnect(Connection* ioDesc) override;
95 Connection* connection(const std::string& dsn) const override;
97 Connections connections(const IInterface* owner) const override;
99 StatusCode read(Connection* ioDesc, void* const data, size_t len) override;
101 StatusCode write(Connection* con, const void* data, int len) override;
103 long long int seek(Connection* ioDesc, long long int where, int origin) override;
104 };
105 } // End namespace Gaudi
106 #endif // GAUDIUTILS_IODATAMANAGER_H
Gaudi::IODataManager::finalize
StatusCode finalize() override
IService implementation: finalize the service.
Definition: IODataManager.cpp:82
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:14
CommonMessagingBase::msg
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:133
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
Gaudi::IODataManager::m_ageLimit
int m_ageLimit
Property: Age limit.
Definition: IODataManager.h:48
Gaudi::IODataManager::m_useGFAL
bool m_useGFAL
Property: Flag for auto gfal data access.
Definition: IODataManager.h:50
Gaudi::IODataManager::ConnectionMap
std::map< std::string, Entry * > ConnectionMap
Definition: IODataManager.h:42
Gaudi::IODataManager::disconnect
StatusCode disconnect(Connection *ioDesc) override
Release data stream.
Definition: IODataManager.cpp:138
Gaudi::IODataManager::m_incSvc
SmartIF< IIncidentSvc > m_incSvc
Definition: IODataManager.h:68
Gaudi::IODataManager::Entry::Entry
Entry(CSTR tech, bool k, IoType iot, IDataConnection *con)
Definition: IODataManager.h:38
Gaudi::IODataManager::establishConnection
StatusCode establishConnection(Connection *con)
Definition: IODataManager.cpp:228
Gaudi::IODataManager::~IODataManager
~IODataManager() override=default
Standard destructor.
Gaudi::IODataManager::m_catalogSvcName
std::string m_catalogSvcName
Property: Name of the file catalog service.
Definition: IODataManager.h:46
std::map< std::string, Entry * >
Gaudi::IODataManager::m_disablePFNWarning
bool m_disablePFNWarning
Property DisablePFNWarning: if set to True will not report when a file is opened by it's physical nam...
Definition: IODataManager.h:55
Gaudi::IODataManager::read
StatusCode read(Connection *ioDesc, void *const data, size_t len) override
Read raw byte buffer from input stream.
Definition: IODataManager.cpp:124
IIODataManager.h
std::string
STL class.
Gaudi::IODataManager::FidMap
std::map< std::string, std::string > FidMap
Definition: IODataManager.h:43
Gaudi::IODataManager::connection
Connection * connection(const std::string &dsn) const override
Retrieve known connection.
Definition: IODataManager.cpp:221
Service.h
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
Gaudi::IODataManager::initialize
StatusCode initialize() override
IService implementation: initialize the service.
Definition: IODataManager.cpp:57
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::IODataManager::m_catalog
SmartIF< IFileCatalog > m_catalog
Reference to file catalog.
Definition: IODataManager.h:60
Gaudi::IODataManager
Definition: IODataManager.h:29
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
Gaudi::IODataManager::write
StatusCode write(Connection *con, const void *data, int len) override
Write raw byte buffer to output stream.
Definition: IODataManager.cpp:129
Gaudi::IODataManager::Entry
Definition: IODataManager.h:33
Gaudi::IODataManager::connectWrite
StatusCode connectWrite(Connection *con, IoType mode=Connection::CREATE, CSTR doctype="UNKNOWN") override
Open data stream in write mode.
Definition: IODataManager.cpp:115
Gaudi::IODataManager::m_quarantine
bool m_quarantine
Property: Flag if unaccessible files should be quarantines in job.
Definition: IODataManager.h:52
Gaudi::IODataManager::Entry::type
std::string type
Definition: IODataManager.h:34
Gaudi::IDataConnection
ABC describing basic data connection.
Definition: IIODataManager.h:24
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Io::CREATE
Definition: IFileMgr.h:30
Gaudi::IODataManager::m_connectionMap
ConnectionMap m_connectionMap
Map with I/O descriptors.
Definition: IODataManager.h:58
Gaudi::IODataManager::Entry::connection
IDataConnection * connection
Definition: IODataManager.h:36
Gaudi::IODataManager::CSTR
const std::string & CSTR
Definition: IODataManager.h:32
Gaudi::IODataManager::connectDataIO
StatusCode connectDataIO(int typ, IoType rw, CSTR fn, CSTR technology, bool keep, Connection *con)
Definition: IODataManager.cpp:248
Gaudi::IODataManager::connectRead
StatusCode connectRead(bool keep_open, Connection *ioDesc) override
Open data stream in read mode.
Definition: IODataManager.cpp:106
Gaudi::IODataManager::Entry::keepOpen
bool keepOpen
Definition: IODataManager.h:37
Gaudi::IODataManager::connections
Connections connections(const IInterface *owner) const override
Get connection by owner instance (0=ALL)
Definition: IODataManager.cpp:96
Gaudi::IODataManager::seek
long long int seek(Connection *ioDesc, long long int where, int origin) override
Seek on the file described by ioDesc. Arguments as in ::seek()
Definition: IODataManager.cpp:134
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1
Gaudi::IODataManager::reconnect
StatusCode reconnect(Entry *e)
Definition: IODataManager.cpp:179
Gaudi::IODataManager::IODataManager
IODataManager(CSTR nam, ISvcLocator *loc)
the incident service
Definition: IODataManager.cpp:44
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:21
Gaudi::IODataManager::Entry::ioType
IoType ioType
Definition: IODataManager.h:35
Gaudi::IODataManager::m_fidMap
FidMap m_fidMap
Map of FID to PFN.
Definition: IODataManager.h:62