ATLAS Offline Software
Loading...
Searching...
No Matches
pool::PersistencySvc::ISession Class Referenceabstract

ISession is the interface class for user (macroscopic) sessions Every transaction and connection to a database and object reading and writing must be performed within a session. More...

#include <PersistencySvc/ISession.h>

Inheritance diagram for pool::PersistencySvc::ISession:
Collaboration diagram for pool::PersistencySvc::ISession:

Public Types

enum  Type { INACTIVE , READ , UPDATE }
 Transaction type enumeration. More...

Public Member Functions

virtual void setDefaultConnectionPolicy (const DatabaseConnectionPolicy &policy)=0
 Sets the default policy when databases are opened/connected.
virtual const DatabaseConnectionPolicydefaultConnectionPolicy () const =0
 Retrieves the default connection policy.
virtual bool disconnectAll ()=0
 Explicitly disconnects all the databases.
virtual ITransactiontransaction ()=0
 Returns the transaction interface.
virtual const ITransactiontransaction () const =0
virtual std::unique_ptr< IDatabasedatabaseHandle (const std::string &dbName, DatabaseSpecification::NameType dbNameType)=0
 Returns a pointer to a database object. The user acquires ownership of that object.
virtual void * readObject (const Token &token, void *object=0)=0
 Retrieves an object from persistent store and return with type information The handle to the reflection class is necessary to later delete the object.
virtual TokenregisterForWrite (const Placement &place, const void *object, const RootType &type)=0
 registerForWrite registers an object for writing to the persistent medium higher level interactions with the framework are necessary.
virtual IFileCatalogfileCatalog ()=0
 Returns the file catalog in use.
virtual const ITechnologySpecificAttributestechnologySpecificAttributes (long technology) const =0
 Returns the object holding the technology specific attributes for a given technology domain.
virtual ITechnologySpecificAttributestechnologySpecificAttributes (long technology)=0
virtual ~ISession ()=default
 virtual destructor for the interface
virtual bool start (Type type=READ)=0
 Starts a new transaction. Returns the success of the operation.
virtual bool commit ()=0
 Commits the transaction.
virtual bool commitAndHold ()=0
 Commits the holds transaction.
virtual bool isActive () const =0
 Checks if the transaction is active.
virtual Type type () const =0
 Returns the transaction type.

Detailed Description

ISession is the interface class for user (macroscopic) sessions Every transaction and connection to a database and object reading and writing must be performed within a session.

It also provides access to the file catalog and to the technology specific attributes.

Definition at line 40 of file ISession.h.

Member Enumeration Documentation

◆ Type

enum pool::ITransaction::Type
inherited

Transaction type enumeration.

Enumerator
INACTIVE 
READ 
UPDATE 

Definition at line 22 of file ITransaction.h.

Constructor & Destructor Documentation

◆ ~ISession()

virtual pool::PersistencySvc::ISession::~ISession ( )
virtualdefault

virtual destructor for the interface

Member Function Documentation

◆ commit()

virtual bool pool::ITransaction::commit ( )
pure virtualinherited

Commits the transaction.

Implemented in pool::PersistencySvc::UserSession.

◆ commitAndHold()

virtual bool pool::ITransaction::commitAndHold ( )
pure virtualinherited

Commits the holds transaction.

Implemented in pool::PersistencySvc::UserSession.

◆ databaseHandle()

virtual std::unique_ptr< IDatabase > pool::PersistencySvc::ISession::databaseHandle ( const std::string & dbName,
DatabaseSpecification::NameType dbNameType )
pure virtual

Returns a pointer to a database object. The user acquires ownership of that object.

Implemented in pool::PersistencySvc::UserSession.

◆ defaultConnectionPolicy()

virtual const DatabaseConnectionPolicy & pool::PersistencySvc::ISession::defaultConnectionPolicy ( ) const
pure virtual

Retrieves the default connection policy.

Implemented in pool::PersistencySvc::UserSession.

◆ disconnectAll()

virtual bool pool::PersistencySvc::ISession::disconnectAll ( )
pure virtual

Explicitly disconnects all the databases.

If a transaction is active, then all the changes since the last commit are aborted.

Implemented in pool::PersistencySvc::UserSession.

◆ fileCatalog()

virtual IFileCatalog & pool::PersistencySvc::ISession::fileCatalog ( )
pure virtual

Returns the file catalog in use.

Implemented in pool::PersistencySvc::UserSession.

◆ isActive()

virtual bool pool::ITransaction::isActive ( ) const
pure virtualinherited

Checks if the transaction is active.

Implemented in pool::PersistencySvc::UserSession.

◆ readObject()

virtual void * pool::PersistencySvc::ISession::readObject ( const Token & token,
void * object = 0 )
pure virtual

Retrieves an object from persistent store and return with type information The handle to the reflection class is necessary to later delete the object.

The Guid of the transient class is assumed to be the classID of the token

Parameters
token[IN] reference to the token for the object
object[IN] pointer to memory for the object (created if 0)
Returns
void* The data

In case of failure zero is returned.

Implemented in pool::PersistencySvc::UserSession.

◆ registerForWrite()

virtual Token * pool::PersistencySvc::ISession::registerForWrite ( const Placement & place,
const void * object,
const RootType & type )
pure virtual

registerForWrite registers an object for writing to the persistent medium higher level interactions with the framework are necessary.

Parameters
place[IN] the placement hint
object[IN] pointer to transient object which will be written
type[IN] reflection class description with the layout of transient object
Returns
Token* the token address of the persistent object. I case of failure 0 is returned.

Implemented in pool::PersistencySvc::UserSession.

◆ setDefaultConnectionPolicy()

virtual void pool::PersistencySvc::ISession::setDefaultConnectionPolicy ( const DatabaseConnectionPolicy & policy)
pure virtual

Sets the default policy when databases are opened/connected.

Implemented in pool::PersistencySvc::UserSession.

◆ start()

virtual bool pool::ITransaction::start ( Type type = READ)
pure virtualinherited

Starts a new transaction. Returns the success of the operation.

Implemented in pool::PersistencySvc::UserSession.

◆ technologySpecificAttributes() [1/2]

virtual const ITechnologySpecificAttributes & pool::PersistencySvc::ISession::technologySpecificAttributes ( long technology) const
pure virtual

Returns the object holding the technology specific attributes for a given technology domain.

Implemented in pool::PersistencySvc::UserSession.

◆ technologySpecificAttributes() [2/2]

virtual ITechnologySpecificAttributes & pool::PersistencySvc::ISession::technologySpecificAttributes ( long technology)
pure virtual

◆ transaction() [1/2]

virtual const ITransaction & pool::PersistencySvc::ISession::transaction ( ) const
pure virtual

◆ transaction() [2/2]

virtual ITransaction & pool::PersistencySvc::ISession::transaction ( )
pure virtual

Returns the transaction interface.

Implemented in pool::PersistencySvc::UserSession.

◆ type()

virtual Type pool::ITransaction::type ( ) const
pure virtualinherited

Returns the transaction type.

Implemented in pool::PersistencySvc::UserSession.


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