The Gaudi Framework  master (37c0b60a)
Gaudi::IDataConnection Class Referenceabstract

#include </builds/gaudi/Gaudi/GaudiUtils/include/GaudiUtils/IIODataManager.h>

Inheritance diagram for Gaudi::IDataConnection:
Collaboration diagram for Gaudi::IDataConnection:

Public Types

enum  IoType { READ = 1 << 1, UPDATE = 1 << 2, CREATE = 1 << 3, RECREATE = ( 1 << 4 ) + ( 1 << 3 ) }
 I/O Connection types. More...
 
enum  IoStatus { BAD_DATA_CONNECTION = 4 }
 Status Code on bad file connection. More...
 

Public Member Functions

 IDataConnection (const IInterface *own, std::string nam)
 Standard constructor. More...
 
virtual ~IDataConnection ()=default
 Standard destructor. More...
 
const std::stringname () const
 Connection name. More...
 
void setFID (std::string fid)
 Set file ID. More...
 
const std::stringfid () const
 Access file id. More...
 
const std::stringpfn () const
 Access physical file name. More...
 
void setPFN (std::string fn)
 Set physical file name. More...
 
int ageFile ()
 Increase age of I/O source. More...
 
void resetAge ()
 Reset age. More...
 
int age () const
 Access age counter. More...
 
const IInterfaceowner () const
 Owner instance. More...
 
virtual StatusCode connectRead ()=0
 Open data stream in read mode. More...
 
virtual StatusCode connectWrite (IoType type)=0
 Open data stream in write mode. More...
 
virtual StatusCode disconnect ()=0
 Release data stream. More...
 
virtual bool isConnected () const =0
 Check if connected to data source. More...
 
virtual StatusCode read (void *const data, size_t len)=0
 Read raw byte buffer from input stream. More...
 
virtual StatusCode write (const void *data, int len)=0
 Write raw byte buffer to output stream. More...
 
virtual long long int seek (long long int where, int origin)=0
 Seek on the file described by ioDesc. Arguments as in ::seek() More...
 

Protected Attributes

std::string m_name
 Connection name/identifier. More...
 
std::string m_fid
 File ID of the connection. More...
 
std::string m_pfn
 Physical file name of the connection. More...
 
int m_age = 0
 Age counter. More...
 
const IInterfacem_owner = nullptr
 Owner pointer. More...
 

Detailed Description

ABC describing basic data connection

Author
M.Frank
Version
1.0
Date
20/10/2007

Definition at line 34 of file IIODataManager.h.

Member Enumeration Documentation

◆ IoStatus

Status Code on bad file connection.

Enumerator
BAD_DATA_CONNECTION 

Definition at line 51 of file IIODataManager.h.

51 { BAD_DATA_CONNECTION = 4 };

◆ IoType

I/O Connection types.

Enumerator
READ 
UPDATE 
CREATE 
RECREATE 

Definition at line 49 of file IIODataManager.h.

49 { READ = 1 << 1, UPDATE = 1 << 2, CREATE = 1 << 3, RECREATE = ( 1 << 4 ) + ( 1 << 3 ) };

Constructor & Destructor Documentation

◆ IDataConnection()

Gaudi::IDataConnection::IDataConnection ( const IInterface own,
std::string  nam 
)
inline

Standard constructor.

Definition at line 55 of file IIODataManager.h.

55 : m_name( std::move( nam ) ), m_owner( own ) {}

◆ ~IDataConnection()

virtual Gaudi::IDataConnection::~IDataConnection ( )
virtualdefault

Standard destructor.

Member Function Documentation

◆ age()

int Gaudi::IDataConnection::age ( ) const
inline

Access age counter.

Definition at line 73 of file IIODataManager.h.

73 { return m_age; }

◆ ageFile()

int Gaudi::IDataConnection::ageFile ( )
inline

Increase age of I/O source.

Definition at line 69 of file IIODataManager.h.

69 { return ++m_age; }

◆ connectRead()

virtual StatusCode Gaudi::IDataConnection::connectRead ( )
pure virtual

Open data stream in read mode.

Implemented in Gaudi::RootDataConnection.

◆ connectWrite()

virtual StatusCode Gaudi::IDataConnection::connectWrite ( IoType  type)
pure virtual

Open data stream in write mode.

Implemented in Gaudi::RootDataConnection.

◆ disconnect()

virtual StatusCode Gaudi::IDataConnection::disconnect ( )
pure virtual

Release data stream.

Implemented in Gaudi::RootDataConnection.

◆ fid()

const std::string& Gaudi::IDataConnection::fid ( ) const
inline

Access file id.

Definition at line 63 of file IIODataManager.h.

63 { return m_fid; }

◆ isConnected()

virtual bool Gaudi::IDataConnection::isConnected ( ) const
pure virtual

Check if connected to data source.

Implemented in Gaudi::RootDataConnection.

◆ name()

const std::string& Gaudi::IDataConnection::name ( ) const
inline

Connection name.

Definition at line 59 of file IIODataManager.h.

59 { return m_name; }

◆ owner()

const IInterface* Gaudi::IDataConnection::owner ( ) const
inline

Owner instance.

Definition at line 75 of file IIODataManager.h.

75 { return m_owner; }

◆ pfn()

const std::string& Gaudi::IDataConnection::pfn ( ) const
inline

Access physical file name.

Definition at line 65 of file IIODataManager.h.

65 { return m_pfn; }

◆ read()

virtual StatusCode Gaudi::IDataConnection::read ( void *const  data,
size_t  len 
)
pure virtual

Read raw byte buffer from input stream.

Implemented in Gaudi::RootDataConnection.

◆ resetAge()

void Gaudi::IDataConnection::resetAge ( )
inline

Reset age.

Definition at line 71 of file IIODataManager.h.

71 { m_age = 0; }

◆ seek()

virtual long long int Gaudi::IDataConnection::seek ( long long int  where,
int  origin 
)
pure virtual

Seek on the file described by ioDesc. Arguments as in ::seek()

Implemented in Gaudi::RootDataConnection.

◆ setFID()

void Gaudi::IDataConnection::setFID ( std::string  fid)
inline

Set file ID.

Definition at line 61 of file IIODataManager.h.

61 { m_fid = std::move( fid ); }

◆ setPFN()

void Gaudi::IDataConnection::setPFN ( std::string  fn)
inline

Set physical file name.

Definition at line 67 of file IIODataManager.h.

67 { m_pfn = std::move( fn ); }

◆ write()

virtual StatusCode Gaudi::IDataConnection::write ( const void *  data,
int  len 
)
pure virtual

Write raw byte buffer to output stream.

Implemented in Gaudi::RootDataConnection.

Member Data Documentation

◆ m_age

int Gaudi::IDataConnection::m_age = 0
protected

Age counter.

Definition at line 43 of file IIODataManager.h.

◆ m_fid

std::string Gaudi::IDataConnection::m_fid
protected

File ID of the connection.

Definition at line 39 of file IIODataManager.h.

◆ m_name

std::string Gaudi::IDataConnection::m_name
protected

Connection name/identifier.

Definition at line 37 of file IIODataManager.h.

◆ m_owner

const IInterface* Gaudi::IDataConnection::m_owner = nullptr
protected

Owner pointer.

Definition at line 45 of file IIODataManager.h.

◆ m_pfn

std::string Gaudi::IDataConnection::m_pfn
protected

Physical file name of the connection.

Definition at line 41 of file IIODataManager.h.


The documentation for this class was generated from the following file:
std::move
T move(T... args)
Gaudi::IDataConnection::RECREATE
@ RECREATE
Definition: IIODataManager.h:49
Gaudi::IDataConnection::CREATE
@ CREATE
Definition: IIODataManager.h:49
Gaudi::IDataConnection::UPDATE
@ UPDATE
Definition: IIODataManager.h:49
Gaudi::IDataConnection::READ
@ READ
Definition: IIODataManager.h:49
Gaudi::IDataConnection::m_name
std::string m_name
Connection name/identifier.
Definition: IIODataManager.h:37
Gaudi::IDataConnection::m_fid
std::string m_fid
File ID of the connection.
Definition: IIODataManager.h:39
Gaudi::IDataConnection::m_age
int m_age
Age counter.
Definition: IIODataManager.h:43
Gaudi::IDataConnection::m_owner
const IInterface * m_owner
Owner pointer.
Definition: IIODataManager.h:45
Gaudi::IDataConnection::fid
const std::string & fid() const
Access file id.
Definition: IIODataManager.h:63
Gaudi::IDataConnection::m_pfn
std::string m_pfn
Physical file name of the connection.
Definition: IIODataManager.h:41
Gaudi::IDataConnection::BAD_DATA_CONNECTION
@ BAD_DATA_CONNECTION
Definition: IIODataManager.h:51