class HVDatabaseSet

Class that holds references to the 3 working databases (Configuration, Time Tag, and Readback) and keeps track of the Federated Database and ooInit

Public Fields

pstring cfName
Name of the Configuration Database
pstring cName
Name of the database set
pstring rbName
Name of the Readback Database
pstring tagName
Name of the Time Tag Database

Public Methods

static ooHandle ( ooDBObj )( const char *cfdbName, ooHandle( ooFDObj )& fdbH, ooTrans *pTr)
Create the basic Structure of a Configuration Database
static ooHandle ( ooDBObj )( const char *rbdbName, ooHandle( ooFDObj )& fdbH, ooTrans *pTr)
Create the basic Structure of a Readback Database
inline const ooHandle ( ooDBObj )()
Returns the ooHandle to the Tag database
inline const ooHandle ( ooDBObj )()
Returns the ooHandle to the CF database
static ooHandle ( ooDBObj )( const char *tagdbName, ooHandle( ooFDObj )& fdbH, ooTrans *pTr)
Create the basic Structure of a Time Tag Database
inline const ooHandle ( ooDBObj )()
Returns the ooHandle to the RB database
int abort_Tr()
Aborts a transaction - Changes made are not recorded (see above).
int addToDBSet( const char *dbtype, const char *dbname )
Create a Database type to add to an existing DB Set which doesn't have that Type already
int closeDBType( const char *dbtype )
Close one of the Databases in the set
int commit_Tr()
Commits a transaction - never called by the user (see above).
int commitAndHold_Tr()
Commits and holds a transaction
static HVDatabaseSet* establishHVDBSet( const char* name, const char* cfname, const char* tagname, const char* rbname, bool create = false, char openMode = 'r', const uint32 maxPages = 500 )
Creates a DB set & establishes connections to existing databases, defined by names passed as arguments
HVDatabaseSet( const char* name, const ooHandle( ooFDObj )& fdbH, const ooHandle( ooDBObj )& cfdbH, const ooHandle( ooDBObj )& tagdbH, const ooHandle( ooDBObj )& rbdbH, ooTrans *ooTr )
Constructor which has as arguments the valid ooHandles of the FDB and the 3 DBs in the set
static int openHVFDB( ooHandle( ooFDObj )& fdbH )
Opens the federated database
int start_Tr()
Starts a transaction - never called by the user (see above).
~HVDatabaseSet()
Destructor. Commits the transaction and closes the databases.

Private Fields

ooTrans* myTr
Pointer to the current transaction
static int ooInitCalled
To avoid calling ooInit more than once. True if ooInit was called.

Private Methods

ooHandle(ooDBObj)
ooHandle of the Time Tag Database
ooHandle(ooDBObj)
ooHandle of the current Readback Database
ooHandle(ooDBObj)
ooHandle of the CF database
ooHandle(ooFDObj)
ooHandle of the FDB

Documentation

Class that holds references to the 3 working databases (Configuration, Time Tag, and Readback) and keeps track of the Federated Database and ooInit.

MODIFICATIONS:

HVDatabaseSet( const char* name, const ooHandle( ooFDObj )& fdbH, const ooHandle( ooDBObj )& cfdbH, const ooHandle( ooDBObj )& tagdbH, const ooHandle( ooDBObj )& rbdbH, ooTrans *ooTr )
Constructor which has as arguments the valid ooHandles of the FDB and the 3 DBs in the set. Checks whether the 3 databases already exist -- If not it creates working versions of them

Parameters:
name - : name of the database set (a string)
fdbH - : handle of the federated database
cfdbH - : handle of the Configuration database
tagdbH - : handle of the Time Tag database
rbdbH - : handle of the Readback database

~HVDatabaseSet()
Destructor. Commits the transaction and closes the databases.

static HVDatabaseSet* establishHVDBSet( const char* name, const char* cfname, const char* tagname, const char* rbname, bool create = false, char openMode = 'r', const uint32 maxPages = 500 )
Creates a DB set & establishes connections to existing databases, defined by names passed as arguments. If the named databases do not exist, they are created if create is specified. If passed NULLs instead of names, then the set will not contain a database of that type

Parameters:
name - : name of database set
cfname - : name of CF Database
tagname - : name of Tag Database
rbname - : name of RB Database
create - : if false, a non-existant named database will not be created.
maxPages - : maximum number of logical pages the program may allocate (default 500)
openMode - : if 'w', databases are opened in Update Mode, if anything else, they are opened in Read Only mode

static int openHVFDB( ooHandle( ooFDObj )& fdbH )
Opens the federated database
Returns:
hvcSuccess or hvcError
Parameters:
fdb - : reference to the handle of the fdb (in case of success)

static ooHandle ( ooDBObj )( const char *cfdbName, ooHandle( ooFDObj )& fdbH, ooTrans *pTr)
Create the basic Structure of a Configuration Database
Parameters:
cfdbName - : Name of the new database
fdbH - : Handle to the Federated Database
pTr - : Pointer the the current Transaction

static ooHandle ( ooDBObj )( const char *tagdbName, ooHandle( ooFDObj )& fdbH, ooTrans *pTr)
Create the basic Structure of a Time Tag Database
Parameters:
tagdbName - : name of the new database
fdbH - : Handle to the Federated Database
pTr - : Pointer the the current Transaction

static ooHandle ( ooDBObj )( const char *rbdbName, ooHandle( ooFDObj )& fdbH, ooTrans *pTr)
Create the basic Structure of a Readback Database
Parameters:
rbdbName - : name of the new database
fdbH - : Handle to the Federated Database
pTr - : Pointer the the current Transaction

int addToDBSet( const char *dbtype, const char *dbname )
Create a Database type to add to an existing DB Set which doesn't have that Type already
Parameters:
dbtype - : Type of database to be made (CF, RB, Tag)
dbname - : Name of the new database

int closeDBType( const char *dbtype )
Close one of the Databases in the set
Parameters:
dbtype - : Type of database to close (CF, RB, Tag)

int start_Tr()
Starts a transaction - never called by the user (see above).

int abort_Tr()
Aborts a transaction - Changes made are not recorded (see above).

int commit_Tr()
Commits a transaction - never called by the user (see above).

int commitAndHold_Tr()
Commits and holds a transaction
Returns:
hvcSuccess or hvcError

inline const ooHandle ( ooDBObj )()
Returns the ooHandle to the CF database. Is of use if one wants to access the database directly.

inline const ooHandle ( ooDBObj )()
Returns the ooHandle to the Tag database. Is of use if one wants to access the database directly.

inline const ooHandle ( ooDBObj )()
Returns the ooHandle to the RB database. Is of use if one wants to access the database directly.

pstring cName
Name of the database set

pstring cfName
Name of the Configuration Database

pstring tagName
Name of the Time Tag Database

pstring rbName
Name of the Readback Database

static int ooInitCalled
To avoid calling ooInit more than once. True if ooInit was called.

ooHandle(ooFDObj)
ooHandle of the FDB

ooHandle(ooDBObj)
ooHandle of the CF database

ooHandle(ooDBObj)
ooHandle of the Time Tag Database

ooHandle(ooDBObj)
ooHandle of the current Readback Database

ooTrans* myTr
Pointer to the current transaction


This class has no child classes.
Author:
R. Roth (adapted from work by C. Witzig & M. Purschke)
Date: July 7, 99
Version:
Last update July 7, 99

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de