Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CdbBdbSOriginP Class Reference

Persistent "origin" class. More...

Inheritance diagram for CdbBdbSOriginP:

CdbBdbSCollectionElementP BdbPersObj List of all members.

Public Types

enum  OriginType {
  FIRST = 0, MASTER = FIRST, SLAVE, REPLICA,
  TEST, LAST = TEST
}
 The supported origin types. More...

enum  {
  FIRST_ID = 0, MASTER_ID = FIRST_ID, REPLICA_ID, TEST_ID,
  LAST_ID = 255
}
 Predefined (reserved) origin identifiers (total of 256). More...


Public Member Functions

 CdbBdbSOriginP (const char *theName, d_UShort theId, OriginType theType, const BdbTime &theCreationTime, const char *theDescription, const char *theDbIdRange)
 Normal constructor.

virtual ~CdbBdbSOriginP ()
 Destructor.

OriginType type () const
BdbTime created () const
 ooString (32) description() const
 ooString (32) dbidrange() const
void dump (std::ostream &o) const
 Dump the contents of the origin.


Static Public Member Functions

CdbStatus name2type (const char *theName, OriginType &theType)
 Convert specified name to the type identifier.

const char * type2name (OriginType theType)
 Convert specified type identifier into the name.

bool isReservedId (d_UShort theId)
 Check if specified identifier is a reserved one.


Static Public Attributes

const char * OriginName []
 The names of the above defined origin types.


Detailed Description

Persistent "origin" class.

Origins represent integral databases of the distributed Condition/DB.

NOTE: Origins themselves are not databases, they are just descriptors of these databases.

Definition at line 22 of file CdbBdbSOriginP.ddl.


Member Enumeration Documentation

anonymous enum
 

Predefined (reserved) origin identifiers (total of 256).

Enumeration values:
FIRST_ID 
MASTER_ID 
REPLICA_ID 
TEST_ID 
LAST_ID 

Definition at line 44 of file CdbBdbSOriginP.ddl.

enum CdbBdbSOriginP::OriginType
 

The supported origin types.

Enumeration values:
FIRST 
MASTER 
SLAVE 
REPLICA 
TEST 
LAST 

Definition at line 28 of file CdbBdbSOriginP.ddl.


Constructor & Destructor Documentation

CdbBdbSOriginP::CdbBdbSOriginP const char *    theName,
d_UShort    theId,
OriginType    theType,
const BdbTime   theCreationTime,
const char *    theDescription,
const char *    theDbIdRange
 

Normal constructor.

WARNING: Inappropriate values of the parameters will cause the crash of the constructor to avoid creating disformed persistent data structures.

Parameters:
theName  the name of the origin
theId  the identifier of the origin
theType  the type from the above defined enumerated type
theCreationTime  the time when the origin is supposed to be created
theDescription  the description of the origin
theDbIdRange  the name of the range

Definition at line 24 of file CdbBdbSOriginP.cc.

CdbBdbSOriginP::~CdbBdbSOriginP   [virtual]
 

Destructor.

Definition at line 46 of file CdbBdbSOriginP.cc.


Member Function Documentation

BdbTime CdbBdbSOriginP::created   const
 

Definition at line 56 of file CdbBdbSOriginP.cc.

void CdbBdbSOriginP::dump std::ostream &    o const
 

Dump the contents of the origin.

Definition at line 102 of file CdbBdbSOriginP.cc.

References CdbBdbSCollectionElementP::id(), and type2name().

bool CdbBdbSOriginP::isReservedId d_UShort    theId [static]
 

Check if specified identifier is a reserved one.

Parameters:
theId  the identifier of the origin

Definition at line 96 of file CdbBdbSOriginP.cc.

References LAST_ID.

CdbStatus CdbBdbSOriginP::name2type const char *    theName,
OriginType   theType
[static]
 

Convert specified name to the type identifier.

The passed name must look in the same way as the corressponding value of the enumerated type. For example MASTER corresponds to string "MASTER". This is the case sensitive translation.

Return CdbStatus::Success if specified name is valid.

Parameters:
theName  the name of the type
theType  the value to be set up

Definition at line 74 of file CdbBdbSOriginP.cc.

References CdbStatus::NotFound, and CdbStatus::Success.

CdbBdbSOriginP::ooString 32    const
 

Reimplemented from CdbBdbSCollectionElementP.

CdbBdbSOriginP::ooString 32    const
 

Reimplemented from CdbBdbSCollectionElementP.

CdbBdbSOriginP::OriginType CdbBdbSOriginP::type   const
 

Definition at line 50 of file CdbBdbSOriginP.cc.

const char * CdbBdbSOriginP::type2name OriginType    theType [static]
 

Convert specified type identifier into the name.

Will return 0 if specified type does not exist. Will return a pointer onto a static string in case of success.

Parameters:
theType  the type identifier

Definition at line 88 of file CdbBdbSOriginP.cc.

References FIRST, LAST, and OriginName.

Referenced by dump().


Member Data Documentation

const char * CdbBdbSOriginP::OriginName [static]
 

Initial value:

 { "MASTER",
                                 "SLAVE",
                                 "REPLICA",
                                 "TEST" }
The names of the above defined origin types.

Definition at line 19 of file CdbBdbSOriginP.cc.

Referenced by type2name().


The documentation for this class was generated from the following files:
Generated on Mon Dec 5 18:22:19 2005 for CDB by doxygen1.3-rc3