ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
pool::PersistencySvc::DatabaseHandler Class Reference

#include <DatabaseHandler.h>

Collaboration diagram for pool::PersistencySvc::DatabaseHandler:

Public Member Functions

 DatabaseHandler (IStorageSvc &storageSvc, IStorageExplorer &storageExplorer, Session *session, long technology, const std::string &fid, const std::string &pfn, long accessmode)
 Constructor. Connects to the database. More...
 
 ~DatabaseHandler ()
 Destructor. Disconnects from the database. More...
 
bool commitTransaction ()
 Commits the transaction. More...
 
bool commitAndHoldTransaction ()
 Commits and holds the transaction. More...
 
void rollBackTransaction ()
 Rolls back the transaction. More...
 
bool disconnectTransaction ()
 Disconnects the transaction. More...
 
std::vector< std::string > containers ()
 Gives the list of containers. More...
 
IContainercontainer (const std::string &containerName)
 Returns a container handle. More...
 
const std::string & pfn () const
 Returns the physical file name. More...
 
const std::string & fid () const
 Returns the file identifier. More...
 
long technology () const
 Returns the technology identifier. More...
 
long accessMode () const
 Returns the access mode. More...
 
void reconnect (long accessMode)
 Reconnects with a new access mode. More...
 
TokenwriteObject (const std::string &containerName, long minorTechnology, const void *object, const RootType &type)
 Writes an object and returns a token. More...
 
void * readObject (const Token &token, void *object=0)
 Reads an object given a token. More...
 
bool attribute (const std::string &attributeName, void *data, const std::type_info &typeInfo, const std::string &option)
 Returns an attribute. More...
 
bool setAttribute (const std::string &attributeName, const void *data, const std::type_info &typeInfo, const std::string &option)
 Sets an attrtibute. More...
 

Private Attributes

IStorageSvcm_storageSvc
 IStorageSvc reference. More...
 
IStorageExplorerm_storageExplorer
 IStorageExplorer reference. More...
 
Session * m_session
 Pointer to the session for this database. More...
 
FileDescriptor m_fileDescriptor
 File descriptor for this database. More...
 
long m_technology
 Technology identifier. More...
 
long m_accessMode
 Current access mode. More...
 

Detailed Description

DatabaseHandler is a class taking care of the micro-connections and the micro transactions for a given database. It also gives access to the underlying containers.

Definition at line 34 of file DatabaseHandler.h.

Constructor & Destructor Documentation

◆ DatabaseHandler()

pool::PersistencySvc::DatabaseHandler::DatabaseHandler ( IStorageSvc storageSvc,
IStorageExplorer storageExplorer,
Session *  session,
long  technology,
const std::string &  fid,
const std::string &  pfn,
long  accessmode 
)

Constructor. Connects to the database.

◆ ~DatabaseHandler()

pool::PersistencySvc::DatabaseHandler::~DatabaseHandler ( )

Destructor. Disconnects from the database.

Member Function Documentation

◆ accessMode()

long pool::PersistencySvc::DatabaseHandler::accessMode ( ) const

Returns the access mode.

◆ attribute()

bool pool::PersistencySvc::DatabaseHandler::attribute ( const std::string &  attributeName,
void *  data,
const std::type_info &  typeInfo,
const std::string &  option 
)

Returns an attribute.

◆ commitAndHoldTransaction()

bool pool::PersistencySvc::DatabaseHandler::commitAndHoldTransaction ( )

Commits and holds the transaction.

◆ commitTransaction()

bool pool::PersistencySvc::DatabaseHandler::commitTransaction ( )

Commits the transaction.

◆ container()

IContainer* pool::PersistencySvc::DatabaseHandler::container ( const std::string &  containerName)

Returns a container handle.

◆ containers()

std::vector< std::string > pool::PersistencySvc::DatabaseHandler::containers ( )

Gives the list of containers.

◆ disconnectTransaction()

bool pool::PersistencySvc::DatabaseHandler::disconnectTransaction ( )

Disconnects the transaction.

◆ fid()

const std::string& pool::PersistencySvc::DatabaseHandler::fid ( ) const

Returns the file identifier.

◆ pfn()

const std::string& pool::PersistencySvc::DatabaseHandler::pfn ( ) const

Returns the physical file name.

◆ readObject()

void* pool::PersistencySvc::DatabaseHandler::readObject ( const Token token,
void *  object = 0 
)

Reads an object given a token.

◆ reconnect()

void pool::PersistencySvc::DatabaseHandler::reconnect ( long  accessMode)

Reconnects with a new access mode.

◆ rollBackTransaction()

void pool::PersistencySvc::DatabaseHandler::rollBackTransaction ( )

Rolls back the transaction.

◆ setAttribute()

bool pool::PersistencySvc::DatabaseHandler::setAttribute ( const std::string &  attributeName,
const void *  data,
const std::type_info &  typeInfo,
const std::string &  option 
)

Sets an attrtibute.

◆ technology()

long pool::PersistencySvc::DatabaseHandler::technology ( ) const

Returns the technology identifier.

◆ writeObject()

Token* pool::PersistencySvc::DatabaseHandler::writeObject ( const std::string &  containerName,
long  minorTechnology,
const void *  object,
const RootType type 
)

Writes an object and returns a token.

Member Data Documentation

◆ m_accessMode

long pool::PersistencySvc::DatabaseHandler::m_accessMode
private

Current access mode.

Definition at line 114 of file DatabaseHandler.h.

◆ m_fileDescriptor

FileDescriptor pool::PersistencySvc::DatabaseHandler::m_fileDescriptor
private

File descriptor for this database.

Definition at line 110 of file DatabaseHandler.h.

◆ m_session

Session* pool::PersistencySvc::DatabaseHandler::m_session
private

Pointer to the session for this database.

Definition at line 108 of file DatabaseHandler.h.

◆ m_storageExplorer

IStorageExplorer& pool::PersistencySvc::DatabaseHandler::m_storageExplorer
private

IStorageExplorer reference.

Definition at line 106 of file DatabaseHandler.h.

◆ m_storageSvc

IStorageSvc& pool::PersistencySvc::DatabaseHandler::m_storageSvc
private

IStorageSvc reference.

Definition at line 104 of file DatabaseHandler.h.

◆ m_technology

long pool::PersistencySvc::DatabaseHandler::m_technology
private

Technology identifier.

Definition at line 112 of file DatabaseHandler.h.


The documentation for this class was generated from the following file: