1 #ifndef GAUDIUTILS_IIODATAMANAGER_H
2 #define GAUDIUTILS_IIODATAMANAGER_H
6 #include "GaudiKernel/IInterface.h"
39 enum IoType {
READ=1<<1,UPDATE=1<<2,
CREATE=1<<3,RECREATE=(1<<4)+(1<<3) };
41 enum IoStatus { BAD_DATA_CONNECTION=4 };
44 IDataConnection(
const IInterface* own,
const std::string& nam)
45 : m_name(nam), m_age(0), m_owner(own) {}
47 virtual ~IDataConnection() {}
49 const std::string& name()
const {
return m_name; }
51 void setFID(
const std::string& fid) { m_fid = fid; }
53 const std::string& fid()
const {
return m_fid; }
55 const std::string& pfn()
const {
return m_pfn; }
57 void setPFN(
const std::string& fn) { m_pfn = fn; }
59 void ageFile() { ++m_age; }
61 void resetAge() { m_age = 0; }
63 int age()
const {
return m_age; }
65 const IInterface* owner()
const {
return m_owner; }
73 virtual bool isConnected()
const = 0;
75 virtual StatusCode read(
void*
const data,
size_t len) = 0;
77 virtual StatusCode write(
const void* data,
int len) = 0;
79 virtual long long int seek(
long long int where,
int origin) = 0;
94 typedef IDataConnection Connection;
95 typedef std::vector<Connection*> Connections;
96 typedef Connection::IoType IoType;
97 enum FileType {
UNKNOWN=1, PFN, LFN, FID };
100 virtual StatusCode connectRead(
bool keep_open, IDataConnection* con) = 0;
104 virtual StatusCode disconnect(IDataConnection* con) = 0;
106 virtual Connection* connection(
const std::string& dsn)
const = 0;
108 virtual Connections connections(
const IInterface* owner)
const = 0;
110 virtual StatusCode read(IDataConnection* con,
void*
const data,
size_t len) = 0;
112 virtual StatusCode write(IDataConnection* con,
const void* data,
int len) = 0;
114 virtual long long int seek(IDataConnection* con,
long long int where,
int origin) = 0;
117 #endif // GAUDIUTILS_IIODATAMANAGER_H
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
#define DeclareInterfaceID(name, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Helper functions to set/get the application return code.