ATLAS Offline Software
Loading...
Searching...
No Matches
pool::PersistencySvc::DatabaseHandler Class Reference

DatabaseHandler is a class taking care of the micro-connections and the micro transactions for a given database. More...

#include <DatabaseHandler.h>

Collaboration diagram for pool::PersistencySvc::DatabaseHandler:

Public Member Functions

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

Private Attributes

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

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 33 of file DatabaseHandler.h.

Constructor & Destructor Documentation

◆ DatabaseHandler()

pool::PersistencySvc::DatabaseHandler::DatabaseHandler ( IStorageSvc & storageSvc,
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.

◆ 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 104 of file DatabaseHandler.h.

◆ m_fileDescriptor

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

File descriptor for this database.

Definition at line 100 of file DatabaseHandler.h.

◆ m_session

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

Pointer to the session for this database.

Definition at line 98 of file DatabaseHandler.h.

◆ m_storageSvc

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

IStorageSvc reference.

Definition at line 96 of file DatabaseHandler.h.

◆ m_technology

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

Technology identifier.

Definition at line 102 of file DatabaseHandler.h.


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