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

#include <PersistencySvc/DatabaseConnectionPolicy.h>

Collaboration diagram for pool::DatabaseConnectionPolicy:

Public Types

enum  Mode {
  RAISE_ERROR, CREATE, OVERWRITE, UPDATE,
  READ
}
 Opening modes for a database. More...
 

Public Member Functions

 DatabaseConnectionPolicy ()
 Default constructor. Initializes the data members with their default values. More...
 
 ~DatabaseConnectionPolicy ()
 Destructor. More...
 
 DatabaseConnectionPolicy (const DatabaseConnectionPolicy &rhs)
 Copy constructor. More...
 
DatabaseConnectionPolicyoperator= (const DatabaseConnectionPolicy &rhs)
 Assignment operator. More...
 
Mode writeModeForExisting () const
 Retrieves the opening mode when an existing database is opened for writing. More...
 
bool setWriteModeForExisting (Mode mode)
 Sets the opening mode when an existing database is opened for writing. More...
 
Mode writeModeForNonExisting () const
 Retrieves the opening mode when a non existing database is opened for writing. More...
 
bool setWriteModeForNonExisting (Mode mode)
 Sets the opening mode when a non existing database is opened for writing Acceptable values are RAISE_ERROR (default), CREATE and UPDATE. More...
 
Mode readMode () const
 Retrieves the opening mode of a database in an update transaction, when opened for reading. More...
 
bool setReadMode (Mode mode)
 Sets the opening mode of a database in an update transaction, when opened for reading. More...
 

Private Attributes

Mode m_writeModeForExisting
 The opening mode when an existing database is opened for writing. Default is UPDATE. More...
 
Mode m_writeModeForNonExisting
 The opening mode when a non existing database is opened for writing. Default is RAISE_ERROR. More...
 
Mode m_readMode
 The opening mode of a database in an update transaction, when opened for reading. Default is READ. More...
 

Detailed Description

DatabaseConnectionPolicy is a class holding information on the policy to be followed whenever a database is opened under different situations in terms of transaction context and database existence.

Definition at line 19 of file DatabaseConnectionPolicy.h.

Member Enumeration Documentation

◆ Mode

Opening modes for a database.

Enumerator
RAISE_ERROR 
CREATE 
OVERWRITE 
UPDATE 
READ 

Definition at line 22 of file DatabaseConnectionPolicy.h.

22  { RAISE_ERROR,
23  CREATE,
24  OVERWRITE,
25  UPDATE,
26  READ } Mode;

Constructor & Destructor Documentation

◆ DatabaseConnectionPolicy() [1/2]

pool::DatabaseConnectionPolicy::DatabaseConnectionPolicy ( )

Default constructor. Initializes the data members with their default values.

◆ ~DatabaseConnectionPolicy()

pool::DatabaseConnectionPolicy::~DatabaseConnectionPolicy ( )
inline

Destructor.

Definition at line 32 of file DatabaseConnectionPolicy.h.

32 {};

◆ DatabaseConnectionPolicy() [2/2]

pool::DatabaseConnectionPolicy::DatabaseConnectionPolicy ( const DatabaseConnectionPolicy rhs)

Copy constructor.

Member Function Documentation

◆ operator=()

DatabaseConnectionPolicy& pool::DatabaseConnectionPolicy::operator= ( const DatabaseConnectionPolicy rhs)

Assignment operator.

◆ readMode()

Mode pool::DatabaseConnectionPolicy::readMode ( ) const

Retrieves the opening mode of a database in an update transaction, when opened for reading.

◆ setReadMode()

bool pool::DatabaseConnectionPolicy::setReadMode ( Mode  mode)

Sets the opening mode of a database in an update transaction, when opened for reading.

Acceptable values are READ (default) and UPDATE. Returns false if any other value is passed, true otherwise.

◆ setWriteModeForExisting()

bool pool::DatabaseConnectionPolicy::setWriteModeForExisting ( Mode  mode)

Sets the opening mode when an existing database is opened for writing.

Acceptable values are UPDATE (default), OVERWRITE and RAISE_ERROR. Returns false if any other value is passed, true otherwise.

◆ setWriteModeForNonExisting()

bool pool::DatabaseConnectionPolicy::setWriteModeForNonExisting ( Mode  mode)

Sets the opening mode when a non existing database is opened for writing Acceptable values are RAISE_ERROR (default), CREATE and UPDATE.

Returns false if any other value is passed, true otherwise.

◆ writeModeForExisting()

Mode pool::DatabaseConnectionPolicy::writeModeForExisting ( ) const

Retrieves the opening mode when an existing database is opened for writing.

◆ writeModeForNonExisting()

Mode pool::DatabaseConnectionPolicy::writeModeForNonExisting ( ) const

Retrieves the opening mode when a non existing database is opened for writing.

Member Data Documentation

◆ m_readMode

Mode pool::DatabaseConnectionPolicy::m_readMode
private

The opening mode of a database in an update transaction, when opened for reading. Default is READ.

Definition at line 75 of file DatabaseConnectionPolicy.h.

◆ m_writeModeForExisting

Mode pool::DatabaseConnectionPolicy::m_writeModeForExisting
private

The opening mode when an existing database is opened for writing. Default is UPDATE.

Definition at line 69 of file DatabaseConnectionPolicy.h.

◆ m_writeModeForNonExisting

Mode pool::DatabaseConnectionPolicy::m_writeModeForNonExisting
private

The opening mode when a non existing database is opened for writing. Default is RAISE_ERROR.

Definition at line 72 of file DatabaseConnectionPolicy.h.


The documentation for this class was generated from the following file:
pool::DatabaseConnectionPolicy::READ
@ READ
Definition: DatabaseConnectionPolicy.h:26
pool::DatabaseConnectionPolicy::RAISE_ERROR
@ RAISE_ERROR
Definition: DatabaseConnectionPolicy.h:22
pool::DatabaseConnectionPolicy::UPDATE
@ UPDATE
Definition: DatabaseConnectionPolicy.h:25
pool::DatabaseConnectionPolicy::OVERWRITE
@ OVERWRITE
Definition: DatabaseConnectionPolicy.h:24
pool::DatabaseConnectionPolicy::CREATE
@ CREATE
Definition: DatabaseConnectionPolicy.h:23
pool::DatabaseConnectionPolicy::Mode
Mode
Opening modes for a database.
Definition: DatabaseConnectionPolicy.h:22