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

CdbView Class Reference

The transient representation for the persistent view. More...

#include <CdbView.hh>

Inheritance diagram for CdbView:

CdbStateControl CdbHistoryProvider CdbFolderLocator CdbCloneable< CdbView > CdbBdbSView CdbBdbWView CdbRooRoView CdbSQLApiView List of all members.

Public Member Functions

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

const char * name () const
 Obtain the current name of the view.

const CdbIdid () const
 Obtain the current identifier of the view.

virtual BdbTime minValidity () const=0
 Obtain the begin time allowed by the view.

virtual BdbTime maxValidity () const=0
 Obtain the end time allowed by the view.

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

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

virtual bool hasDefaultConfig () const=0
 Check if the view has "default" configuration.

virtual bool isLocal () const=0
 Get the current status of the view.

virtual bool isFrozen () const=0
 Get the current status of the view.

virtual CdbStatus getDefault (const BdbTime &theValidityTime, CdbConfigElement &theConfigElement) const=0
 Get a "config element" at specified point of validity time from the "default" configuration.

virtual CdbStatus defaultConfigIterator (CdbItr< CdbConfigElement > &theItr) const=0
 Set up an iterator of "default config elements".

virtual CdbStatus get (const char *theName, const BdbTime &theValidityTime, CdbConfigElement &theConfigElement) const=0
 Get a "config element" for a condition at specified point of validity time.

virtual CdbStatus configIterator (const char *theName, CdbItr< CdbConfigElement > &theItr) const=0
 Set up an iterator of "config elements" for a condition.

virtual CdbStateId currentStateId (const BdbTime &theValidityTime) const=0
 Get current value of the state identifier.


Static Public Member Functions

CdbStatus instance (CdbViewPtr &theViewPtr, const char *theViewName=0, const char *theDatabaseName=0, const char *theImplementationName=0, const char *theTechnologyName=0)
 Static locator for a view object.

CdbStatus instance (CdbViewPtr &theViewPtr, const CdbId &theViewId, const char *theDatabaseName=0, const char *theImplementationName=0, const char *theTechnologyName=0)
 Static locator for a view object.


Protected Member Functions

 CdbView (const CdbDatabasePtr &theDatabasePtr, const char *theName, const CdbId &theId)
 CdbView (const CdbView &theView)
 The copy constructor.

virtual ~CdbView ()
 The destructor.

CdbView & operator= (const CdbView &theView)
 The assignment operator.


Friends

class CdbCPtrBase< CdbView >

Detailed Description

The transient representation for the persistent view.

Note, that this is an abstract class specifying the interface to the view. It also maintains the general status of the view object as it's seen to its clients through the API.

This class also includes the CdbStateControl, CdbFolderLocator CdbHistoryProvider and CdbCloneable interfaces.

See also:
CdbStateControl

CdbFolderLocator

CdbHistoryProvider

CdbCloneable

CdbRevisionPolicy

Definition at line 41 of file CdbView.hh.


Constructor & Destructor Documentation

CdbView::CdbView const CdbDatabasePtr   theDatabasePtr,
const char *    theName,
const CdbId   theId
[protected]
 

Initialize the context of the view with specified set of parameters. This will also validate the internal state of the object.

Both pointers should not point to 0 objects.

See also:
CdbDatabase

CdbDatabasePtr

Parameters:
theDatabasePtr  the smart pointer providing a back link to the parent object
theName  the name of the view
theId  the extended identifier of this view

Definition at line 78 of file CdbView.cc.

References CdbCPtr< CdbDatabase, CdbAlwaysClosePolicy< CdbDatabase > >::isNull().

CdbView::CdbView const CdbView &    theView [protected]
 

The copy constructor.

Details...

Definition at line 89 of file CdbView.cc.

CdbView::~CdbView   [protected, virtual]
 

The destructor.

Is only available for the derived classes and friends to prevent accidental deletion of objects.

Definition at line 95 of file CdbView.cc.


Member Function Documentation

virtual CdbStatus CdbView::configIterator const char *    theName,
CdbItr< CdbConfigElement > &    theItr
const [pure virtual]
 

Set up an iterator of "config elements" for a condition.

The iterator will retirn valid elements for the interval of validity covered by the view.

Returns:
completion status

Implemented in CdbBdbWView, CdbBdbSView, CdbRooRoView, and CdbSQLApiView.

virtual BdbTime CdbView::created   const [pure virtual]
 

Obtain the creation time of the view.

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

Returns:
a string with the object's description

Implemented in CdbBdbWView, CdbBdbSView, CdbRooRoView, and CdbSQLApiView.

virtual CdbStateId CdbView::currentStateId const BdbTime   theValidityTime const [pure virtual]
 

Get current value of the state identifier.

The method delivers a value of the identifier calculated in the scope of he view. The only explicit parameter of the method is a point of time in the validity dimension, in which the identifier is requested.

The returned identifier will be "invalid" should any problem occures to construct (calculate) the identifier.

The method is supposed to be implemented by subclasses.

See also:
CdbStateId
Returns:
a value of the identifier.

Implemented in CdbBdbWView, CdbBdbSView, CdbRooRoView, and CdbSQLApiView.

virtual CdbStatus CdbView::defaultConfigIterator CdbItr< CdbConfigElement > &    theItr const [pure virtual]
 

Set up an iterator of "default config elements".

See also:
CdbView::hasDefaultConfig()

CdbView::getDefault()

CdbView::configIterator()

Implemented in CdbBdbWView, CdbBdbSView, CdbRooRoView, and CdbSQLApiView.

virtual std::string CdbView::description   const [pure virtual]
 

Obtain the view description.

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

Returns:
a string with the object's description

Implemented in CdbBdbWView, CdbBdbSView, CdbRooRoView, and CdbSQLApiView.

virtual CdbStatus CdbView::get const char *    theName,
const BdbTime   theValidityTime,
CdbConfigElement   theConfigElement
const [pure virtual]
 

Get a "config element" for a condition at specified point of validity time.

A full path name (inluding a condition itself) is used to specify the corresponding condition.

The method delivers its results through the "config element" comprising the found revision policy and its interval of the validity.

Note, that returned policy may prohibit accessing the database for specified period of time.

See also:
CdbConfigElement

CdbRevisionPolicy

Returns:
completion status

Implemented in CdbBdbWView, CdbBdbSView, CdbRooRoView, and CdbSQLApiView.

virtual CdbStatus CdbView::getDefault const BdbTime   theValidityTime,
CdbConfigElement   theConfigElement
const [pure virtual]
 

Get a "config element" at specified point of validity time from the "default" configuration.

This method is similar to the regular get() method except it will use (if any) the so called "default" configuration of the view.

Since "default" configuration is an optional feature of the view then it may not exist at a particular view. If this is going to be the case then the method will return CdbStatus::NotFound cimpletiuon status.

See also:
CdbView::hasDefaultConfig()

CdbView::get()

Implemented in CdbBdbWView, CdbBdbSView, CdbRooRoView, and CdbSQLApiView.

virtual bool CdbView::hasDefaultConfig   const [pure virtual]
 

Check if the view has "default" configuration.

A view may have an optional "default" configuration to be used for conditions not having their private configurations.

Returns:
TRUE if there is such configuration

Implemented in CdbBdbWView, CdbBdbSView, CdbRooRoView, and CdbSQLApiView.

const CdbId & CdbView::id   const
 

Obtain the current identifier of the view.

It's an extended identifier of the view in the (potentially) distributed installation.

Returns:
a const reference to the identifier

Definition at line 122 of file CdbView.cc.

Referenced by CdbSQLApiView::clone(), CdbRooRoView::clone(), CdbBdbSView::clone(), CdbSQLApiView::currentStateId(), CdbRooRoView::currentStateId(), CdbBdbWView::currentStateId(), CdbBdbSView::currentStateId(), CdbSQLApiView::isLocal(), CdbRooRoView::isLocal(), and CdbBdbSView::isLocal().

CdbStatus CdbView::instance CdbViewPtr   theViewPtr,
const CdbId   theViewId,
const char *    theDatabaseName = 0,
const char *    theImplementationName = 0,
const char *    theTechnologyName = 0
[static]
 

Static locator for a view object.

Unlike the previous method, this one uses extended identifier of a view to find the corresponding object.

See also:
CdbId
Parameters:
theViewPtr  the smart pointer to be initialized
theViewId  the view identifier
theDatabaseName  the database name
theImplementationName  the implementation name
theTechnologyName  the technology name

Definition at line 48 of file CdbView.cc.

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

CdbStatus CdbView::instance CdbViewPtr   theViewPtr,
const char *    theViewName = 0,
const char *    theDatabaseName = 0,
const char *    theImplementationName = 0,
const char *    theTechnologyName = 0
[static]
 

Static locator for a view object.

Locates specified view object and returns a smart pointer to the transient object of the current class. This "shortcut" allows to avoid the complicated multi-staged process of the object location, which is useless when the intermediate objects are not needed.

The last parameter (a pointer to the top-level Cdb singleton) is optional. If 0 is passed then a default instance is used.

Note, that if specified object is not found then a smart pointer is initialized to point to 0.

See also:
Cdb

CdbViewPtr

CdbStatus

Returns:
a completion status
Parameters:
theViewPtr  the smart pointer to be initialized
theViewName  the view name
theDatabaseName  the database name
theImplementationName  the implementation name
theTechnologyName  the technology name

Definition at line 17 of file CdbView.cc.

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

Referenced by CdbEnvironment::defaultStateId(), CdbFolder::instance(), and main().

virtual bool CdbView::isFrozen   const [pure virtual]
 

Get the current status of the view.

A non-"frozen" view is not stable since its configuration is allowed to be changed by the database administration tools. This kind (non-"frozen") views are used where the views is being in a transition state. Once it's done the view can be turned into the "frozen" state.

Implemented in CdbBdbWView, CdbBdbSView, CdbRooRoView, and CdbSQLApiView.

virtual bool CdbView::isLocal   const [pure virtual]
 

Get the current status of the view.

The maijor difference of "local" views from others is that their configuration can be modified locally (if it's not in "frozen" state and the corresponding authorization permits modifications.)

Implemented in CdbBdbWView, CdbBdbSView, CdbRooRoView, and CdbSQLApiView.

virtual BdbTime CdbView::maxValidity   const [pure virtual]
 

Obtain the end time allowed by the view.

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

Returns:
a string with the object's description

Implemented in CdbBdbWView, CdbBdbSView, CdbRooRoView, and CdbSQLApiView.

virtual BdbTime CdbView::minValidity   const [pure virtual]
 

Obtain the begin time allowed by the view.

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

Returns:
a string with the object's description

Implemented in CdbBdbWView, CdbBdbSView, CdbRooRoView, and CdbSQLApiView.

const char * CdbView::name   const
 

Obtain the current name of the view.

This name is garanteed to be non 0 pointer.

Returns:
a const pointer to the name of the object

Definition at line 116 of file CdbView.cc.

Referenced by CdbSQLApiView::clone(), CdbRooRoView::clone(), CdbBdbWView::clone(), CdbBdbSView::clone(), CdbSQLApiView::configIterator(), CdbRooRoView::configIterator(), CdbBdbSView::configIterator(), CdbSQLApiView::folderIterator(), CdbSQLApiView::get(), CdbRooRoView::get(), CdbBdbSView::get(), CdbRooRoView::getDefault(), and CdbBdbSView::getDefault().

CdbView & CdbView::operator= const CdbView &    theView [protected]
 

The assignment operator.

Details...

Definition at line 99 of file CdbView.cc.

References _myId, _myName, and _myParentPtr.

const CdbDatabasePtr & CdbView::parent   const
 

Return a smart pointer to the parent object.

See also:
CdbDatabase

Definition at line 110 of file CdbView.cc.

Referenced by CdbSQLApiView::clone(), CdbRooRoView::clone(), CdbBdbWView::clone(), and CdbBdbSView::clone().


Friends And Related Function Documentation

friend class CdbCPtrBase< CdbView > [friend]
 

Definition at line 46 of file CdbView.hh.


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