1 #ifndef GAUDIUTILS_IIODATAMANAGER_H
2 #define GAUDIUTILS_IIODATAMANAGER_H
5 #include "GaudiKernel/IInterface.h"
38 enum IoType {
READ=1<<1,UPDATE=1<<2,
CREATE=1<<3,RECREATE=(1<<4)+(1<<3) };
40 enum IoStatus { BAD_DATA_CONNECTION=4 };
43 IDataConnection(
const IInterface* own, std::string nam)
44 : m_name(
std::move(nam)), m_owner(own) {}
46 virtual ~IDataConnection() =
default;
48 const std::string&
name()
const {
return m_name; }
50 void setFID(std::string fid) { m_fid = std::move(fid); }
52 const std::string& fid()
const {
return m_fid; }
54 const std::string& pfn()
const {
return m_pfn; }
56 void setPFN(std::string fn) { m_pfn = std::move(fn); }
58 int ageFile() {
return ++m_age; }
60 void resetAge() { m_age = 0; }
62 int age()
const {
return m_age; }
64 const IInterface* owner()
const {
return m_owner; }
72 virtual bool isConnected()
const = 0;
74 virtual StatusCode read(
void*
const data,
size_t len) = 0;
76 virtual StatusCode write(
const void* data,
int len) = 0;
78 virtual long long int seek(
long long int where,
int origin) = 0;
93 typedef IDataConnection Connection;
94 typedef std::vector<Connection*> Connections;
95 typedef Connection::IoType IoType;
96 enum FileType {
UNKNOWN=1, PFN, LFN, FID };
99 virtual StatusCode connectRead(
bool keep_open, IDataConnection* con) = 0;
103 virtual StatusCode disconnect(IDataConnection* con) = 0;
105 virtual Connection* connection(
const std::string& dsn)
const = 0;
107 virtual Connections connections(
const IInterface* owner)
const = 0;
109 virtual StatusCode read(IDataConnection* con,
void*
const data,
size_t len) = 0;
111 virtual StatusCode write(IDataConnection* con,
const void* data,
int len) = 0;
113 virtual long long int seek(IDataConnection* con,
long long int where,
int origin) = 0;
116 #endif // GAUDIUTILS_IIODATAMANAGER_H
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
Helper functions to set/get the application return code.