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

CdbOrigin Class Reference

The transient interface to an origin object. More...

#include <CdbOrigin.hh>

List of all members.

Public Member Functions

const CdbDatabasePtrparent () const
 Return a smart pointer to the parent database object.

const char * name () const
 The name of an object.

virtual BdbTime created ()=0
 Obtain the creation time of the origin.

virtual std::string description ()=0
 Obtain the origin description.

unsigned short id () const
 The identifier of an object.

virtual bool isLocal () const=0
 Check if this origin is the local one.

virtual bool isInstantiated () const=0
 Check if data corresponding to this origin are available in the local database.

virtual bool isMaster () const=0
 Check if this origin is the "master" one.

virtual bool isSlave () const=0
 Check if this origin is a "slave" one.

virtual bool isTest () const=0
 Check if this origin is a "test" one.

virtual CdbStatus propertyIterator (CdbItr< CdbProperty > &theItr)=0
 Set up an iterator of properties.


Static Public Member Functions

CdbStatus instance (CdbOriginPtr &theOriginPtr, const char *theOriginName, const char *theDatabaseName=0, const char *theImplementationName=0, const char *theTechnologyName=0)
 The static locator for an origin object (by name).

CdbStatus instance (CdbOriginPtr &theOriginPtr, unsigned short theOriginId, const char *theDatabaseName=0, const char *theImplementationName=0, const char *theTechnologyName=0)
 The static locator for an origin object (by id).


Protected Member Functions

 CdbOrigin (const CdbDatabasePtr &theDatabasePtr, const char *theName, unsigned short theId)
 The normal constructor.

virtual ~CdbOrigin ()
 The destructor.


Friends

class CdbCPtrBase< CdbOrigin >


Detailed Description

The transient interface to an origin object.

More details to come...

Definition at line 23 of file CdbOrigin.hh.


Constructor & Destructor Documentation

CdbOrigin::CdbOrigin const CdbDatabasePtr   theDatabasePtr,
const char *    theName,
unsigned short    theId
[protected]
 

The normal constructor.

Initialize context with specified parameters.

See also:
CdbDatabase

CdbDatabasePtr

Parameters:
theDatabasePtr  the smart pointer providing a back back link to the parent database object
theName  the name of the origin
theId  the identifier of the origin

Definition at line 86 of file CdbOrigin.cc.

CdbOrigin::~CdbOrigin   [protected, virtual]
 

The destructor.

More details...

Definition at line 94 of file CdbOrigin.cc.


Member Function Documentation

virtual BdbTime CdbOrigin::created   [pure virtual]
 

Obtain the creation time of the origin.

This method is supposed to be implemented by the corresponding subclass.

Returns:
a string with the object's description

virtual std::string CdbOrigin::description   [pure virtual]
 

Obtain the origin description.

This method is supposed to be implemented by the corresponding subclass.

Returns:
a string with the object's description

unsigned short CdbOrigin::id   const
 

The identifier of an object.

Returns:
a value of the identifier.

Definition at line 110 of file CdbOrigin.cc.

CdbStatus CdbOrigin::instance CdbOriginPtr   theOriginPtr,
unsigned short    theOriginId,
const char *    theDatabaseName = 0,
const char *    theImplementationName = 0,
const char *    theTechnologyName = 0
[static]
 

The static locator for an origin object (by id).

This locator is similar to teh one defined above. It just uses an identifier instead of a name.

Parameters:
theDatabaseName  the database name
theImplementationName  the implementation name
theTechnologyName  the technology name

Definition at line 52 of file CdbOrigin.cc.

References CdbStatus::Error, CdbDatabase::instance(), and CdbStatus::Success.

CdbStatus CdbOrigin::instance CdbOriginPtr   theOriginPtr,
const char *    theOriginName,
const char *    theDatabaseName = 0,
const char *    theImplementationName = 0,
const char *    theTechnologyName = 0
[static]
 

The static locator for an origin object (by name).

This locator uses the name of the origin to resolve the right instance of the origin object in the scope of a database.

The database itself as well as the top-level API object are two optional parameters of this method. If either (or both) of them are not specified then the corresponding default values will be used.

See also:
CdbOrigin

CdbOriginPtr

Returns:
the completion status of the operation
Parameters:
theDatabaseName  the database name
theImplementationName  the implementation name
theTechnologyName  the technology name

Definition at line 17 of file CdbOrigin.cc.

References CdbStatus::Error, CdbDatabase::instance(), and CdbStatus::Success.

virtual bool CdbOrigin::isInstantiated   const [pure virtual]
 

Check if data corresponding to this origin are available in the local database.

The positive answer means that the data from remote database have already been brought into local database.

This method is supposed to be implementyed by subclasses.

Returns:
TRUE if this is the "local" origin

virtual bool CdbOrigin::isLocal   const [pure virtual]
 

Check if this origin is the local one.

The "local" origin is the one corresponding to the part of a distributed database setup currently being used by a client application. This database also can be called the "local" one. Depending on the origin's type "local" databases (=origins) may have persistent resources modifiable by clients' applications. The actual set on those resources depends on the origin's type.

This method is supposed to be implementyed by subclasses.

Returns:
TRUE if this is the "local" origin

virtual bool CdbOrigin::isMaster   const [pure virtual]
 

Check if this origin is the "master" one.

The "master" origin is meant to describe the central database of a distributed database setup. Certain database operations can only be performed in this central "master" database.

This method is supposed to be implemented by subclasses.

Returns:
TRUE if this is the "master" origin

virtual bool CdbOrigin::isSlave   const [pure virtual]
 

Check if this origin is a "slave" one.

The "slave" origin is meant to describe a database being a part of a distributed database setup. The database of the "slave" origin is allowed to contribute data into the distrubuted database so that these data can be seen and used by clients of other databases of the setup. The "slave" origin is known to its central "master" database. The "master" may delegate certain operations to its "slave"-s.

This method is supposed to be implemented by subclasses.

Returns:
TRUE if this is the "slave" origin

virtual bool CdbOrigin::isTest   const [pure virtual]
 

Check if this origin is a "test" one.

The "test" origin is meant to describe a database NOT being a part of a distributed database setup. The database of the "test" origin is NOT allowed to contribute data into the distrubuted database in a way it's done by "slave" databases. However the "test" type databases are allowed to produce their own local data to be consumed locally. It's allso allowed to import data from the corresponding distributed database.

This method is supposed to be implemented by subclasses.

Returns:
TRUE if this is the "test" origin

const char * CdbOrigin::name   const
 

The name of an object.

Returns:
a non-0 pointer onto a string owned by the object.

Definition at line 104 of file CdbOrigin.cc.

const CdbDatabasePtr & CdbOrigin::parent   const
 

Return a smart pointer to the parent database object.

See also:
CdbDatabase

CdbDatabasePtr

Definition at line 98 of file CdbOrigin.cc.

virtual CdbStatus CdbOrigin::propertyIterator CdbItr< CdbProperty > &    theItr [pure virtual]
 

Set up an iterator of properties.

Specific implementations of this origin class my supply technology- and implementation- specific properties.

This method is supposed to be implemented by subclasses.

See also:
CdbProperty
Returns:
CdbStatus::Success if the iterator is set up
Parameters:
theItr  the iterator to set up


Friends And Related Function Documentation

friend class CdbCPtrBase< CdbOrigin > [friend]
 

Definition at line 25 of file CdbOrigin.hh.


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