| The Gaudi Framework v29r1 (5cd95fa2)

- 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
18 // Forward declarations
19 class IFileCatalog;
20 class RawDataConnectionEntry;
21
30 class IODataManager : public extends<Service, IIODataManager>
31 {
32 protected:
33 typedef const std::string& CSTR;
34 struct Entry final {
35 std::string type;
36 IoType ioType;
37 IDataConnection* connection;
38 bool keepOpen;
39 Entry( CSTR tech, bool k, IoType iot, IDataConnection* con )
40 : type( tech ), ioType( iot ), connection( con ), keepOpen( k )
41 {
42 }
43 };
44 typedef std::map<std::string, Entry*> ConnectionMap;
45 typedef std::map<std::string, std::string> FidMap;
46
47 Gaudi::Property<std::string> m_catalogSvcName{this, "CatalogType", "Gaudi::MultiFileCatalog/FileCatalog",
48 "name of the file catalog service"};
49 Gaudi::Property<bool> m_useGFAL{this, "UseGFAL", true, "flag for auto gfal data access"};
50 Gaudi::Property<bool> m_quarantine{this, "QuarantineFiles", true,
51 "if unaccessible files should be quarantines in job"};
52 Gaudi::Property<int> m_ageLimit{this, "AgeLimit", 2, "age limit"};
53 Gaudi::Property<bool> m_disablePFNWarning{
54 this, "DisablePFNWarning", false,
55 "if set to True, we will not report when a file is opened by its physical name"};
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:
72 using extends::extends;
73
75 ~IODataManager() override = default;
76
78 StatusCode initialize() override;
79
81 StatusCode finalize() override;
82
84 StatusCode connectRead( bool keep_open, Connection* ioDesc ) override;
86 StatusCode connectWrite( Connection* con, IoType mode = Connection::CREATE, CSTR doctype = "UNKNOWN" ) override;
88 StatusCode disconnect( Connection* ioDesc ) override;
90 Connection* connection( const std::string& dsn ) const override;
92 Connections connections( const IInterface* owner ) const override;
94 StatusCode read( Connection* ioDesc, void* const data, size_t len ) override;
96 StatusCode write( Connection* con, const void* data, int len ) override;
98 long long int seek( Connection* ioDesc, long long int where, int origin ) override;
99 };
100 } // End namespace Gaudi
101 #endif // GAUDIUTILS_IODATAMANAGER_H
Gaudi::IODataManager::finalize
StatusCode finalize() override
IService implementation: finalize the service.
Definition: IODataManager.cpp:71
Gaudi::IODataManager::m_ageLimit
Gaudi::Property< int > m_ageLimit
Definition: IODataManager.h:52
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:15
CommonMessagingBase::msg
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:121
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
Gaudi::IODataManager::connections
Connections connections(const IInterface *owner) const override
Get connection by owner instance (0=ALL)
Definition: IODataManager.cpp:87
Gaudi::IODataManager::disconnect
StatusCode disconnect(Connection *ioDesc) override
Release data stream.
Definition: IODataManager.cpp:134
Gaudi::IODataManager::m_catalogSvcName
Gaudi::Property< std::string > m_catalogSvcName
Definition: IODataManager.h:47
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:39
Gaudi::IODataManager::establishConnection
StatusCode establishConnection(Connection *con)
Definition: IODataManager.cpp:218
Gaudi::IODataManager::~IODataManager
~IODataManager() override=default
Standard destructor.
std::map< std::string, Entry * >
Gaudi::IODataManager::read
StatusCode read(Connection *ioDesc, void *const data, size_t len) override
Read raw byte buffer from input stream.
Definition: IODataManager.cpp:117
IIODataManager.h
std::string
STL class.
Gaudi::IODataManager::FidMap
std::map< std::string, std::string > FidMap
Definition: IODataManager.h:45
Service.h
Gaudi::IODataManager::m_quarantine
Gaudi::Property< bool > m_quarantine
Definition: IODataManager.h:50
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
Gaudi::IODataManager::initialize
StatusCode initialize() override
IService implementation: initialize the service.
Definition: IODataManager.cpp:47
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
Gaudi::IODataManager::m_catalog
SmartIF< IFileCatalog > m_catalog
Reference to file catalog.
Definition: IODataManager.h:60
Gaudi::IODataManager
Definition: IODataManager.h:30
IInterface
Definition of the basic interface.
Definition: IInterface.h:277
Gaudi::IODataManager::write
StatusCode write(Connection *con, const void *data, int len) override
Write raw byte buffer to output stream.
Definition: IODataManager.cpp:123
Gaudi::IODataManager::Entry
Definition: IODataManager.h:34
Gaudi::IODataManager::m_useGFAL
Gaudi::Property< bool > m_useGFAL
Definition: IODataManager.h:49
Gaudi::IODataManager::connectWrite
StatusCode connectWrite(Connection *con, IoType mode=Connection::CREATE, CSTR doctype="UNKNOWN") override
Open data stream in write mode.
Definition: IODataManager.cpp:107
Gaudi::IODataManager::Entry::type
std::string type
Definition: IODataManager.h:35
Gaudi::IODataManager::ConnectionMap
std::map< std::string, Entry * > ConnectionMap
Definition: IODataManager.h:44
Gaudi::IDataConnection
ABC describing basic data connection.
Definition: IIODataManager.h:25
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Io::CREATE
Definition: IFileMgr.h:31
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:37
Gaudi::IODataManager::CSTR
const std::string & CSTR
Definition: IODataManager.h:33
Gaudi::IODataManager::m_disablePFNWarning
Gaudi::Property< bool > m_disablePFNWarning
Definition: IODataManager.h:53
Gaudi::IODataManager::connectDataIO
StatusCode connectDataIO(int typ, IoType rw, CSTR fn, CSTR technology, bool keep, Connection *con)
Definition: IODataManager.cpp:238
Gaudi::IODataManager::connectRead
StatusCode connectRead(bool keep_open, Connection *ioDesc) override
Open data stream in read mode.
Definition: IODataManager.cpp:97
Gaudi::IODataManager::Entry::keepOpen
bool keepOpen
Definition: IODataManager.h:38
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:129
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1
Gaudi::IODataManager::reconnect
StatusCode reconnect(Entry *e)
Definition: IODataManager.cpp:172
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23
Gaudi::IODataManager::Entry::ioType
IoType ioType
Definition: IODataManager.h:36
Gaudi::IODataManager::m_fidMap
FidMap m_fidMap
Map of FID to PFN.
Definition: IODataManager.h:62