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

CdbBdbSViewP Class Reference

A persistent incarnation for the concept of "view". More...

Inheritance diagram for CdbBdbSViewP:

CdbBdbSCollectionElementP BdbPersObj List of all members.

Public Member Functions

 CdbBdbSViewP (const char *theName, d_UShort theId, const char *theDescription, const BdbTime &theCreationTime, const BdbTime &theMinValidityTime=BdbTime::minusInfinity, const BdbTime &theMaxValidityTime=BdbTime::plusInfinity, const BdbRef(CdbBdbSConfigCollectionP)&theDefaultConfigRef=0)
 Normal constructor.

virtual ~CdbBdbSViewP ()
 Destructor.

CdbStatus clone (BdbRef(CdbBdbSViewP)&theRef, const char *theName, const char *theDescription) const
 Clone the current view.

 ooString (32) description() const
BdbTime created () const
BdbTime minValidity () const
BdbTime maxValidity () const
 BdbRef (CdbBdbSConfigCollectionP) defaultConfig() const
 BdbRef (CdbBdbSFolderP) rootFolder() const
bool isFrozen () const
 Check if this view is "frozen" from any further modifications.

void freeze ()
 "Freeze" the view

void warm ()
 "Un-freeze" the view

CdbStatus setDefaultConfig (const BdbRef(CdbBdbSConfigCollectionP)&theConfigRef)
 Set/override default configuration at a level of a view.

CdbStatus setConfig (const char *thePathName, const BdbRef(CdbBdbSConfigCollectionP)&theConfigRef, bool dontDestroyConfigObject=false)
 Set/override configuration at a level of specified condition.

CdbStatus createFolder (const char *thePathName, const char *theNewFolderName, const char *theDescription, const BdbTime &theCreationTime)
 Create new folder.

CdbStatus createFolder (const char *theFullPathName, const char *theDescription, const BdbTime &theCreationTime)
 Create new folder (RECURSIVE).

CdbStatus createCondition (const char *thePathName, const char *theNewConditionName, const char *theDescription, const BdbTime &theCreationTime, const CdbBdbSId &theId, const BdbRef(CdbBdbSConfigCollectionP)&theConfigRef=0)
 Create new condition.

CdbStatus removeFolder (const char *thePathName, bool forceFlag=false)
 Remove the folder.

CdbStatus removeCondition (const char *thePathName)
 Remove the condition.

CdbStatus findFolder (const char *thePathName, BdbRef(CdbBdbSFolderP)&theRef) const
 Find the folder.

CdbStatus findCondition (const char *thePathName, BdbRef(CdbBdbSConditionAtFolderP)&theRef) const
 Find the condition.

CdbStatus folderIterator (CdbItr< const char * > &theItr) const
 Set up an iterator of folder names.

void dump (std::ostream &o) const
 Dump the contents of the object.


Detailed Description

A persistent incarnation for the concept of "view".

See details below.

Definition at line 24 of file CdbBdbSViewP.ddl.


Constructor & Destructor Documentation

CdbBdbSViewP::CdbBdbSViewP const char *    theName,
d_UShort    theId,
const char *    theDescription,
const BdbTime   theCreationTime,
const BdbTime   theMinValidityTime = BdbTime::minusInfinity,
const BdbTime   theMaxValidityTime = BdbTime::plusInfinity,
const BdbRef(CdbBdbSConfigCollectionP)&    theDefaultConfigRef = 0
 

Normal constructor.

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

Definition at line 26 of file CdbBdbSViewP.cc.

Referenced by clone().

CdbBdbSViewP::~CdbBdbSViewP   [virtual]
 

Destructor.

Definition at line 53 of file CdbBdbSViewP.cc.


Member Function Documentation

CdbBdbSViewP::BdbRef CdbBdbSFolderP    const
 

CdbBdbSViewP::BdbRef CdbBdbSConfigCollectionP    const
 

Referenced by clone(), createCondition(), createFolder(), findCondition(), removeCondition(), removeFolder(), and setConfig().

CdbStatus CdbBdbSViewP::clone BdbRef(CdbBdbSViewP)&    theRef,
const char *    theName,
const char *    theDescription
const
 

Clone the current view.

This method will create a clone of the current view at the default location determined by the local collection of views. The resulting view will get specified name and description. Its other characteristics will be either borrowed (cloned) from the current view or generated using standard

The new view will NOT be frozen to allow its further post-creation modifications (adding/removing components, changing configurations).

Parameters:
theRef  newely created view

Definition at line 57 of file CdbBdbSViewP.cc.

References BdbRef(), CdbBdbSViewP(), CdbStatus::Error, CdbBdbSRegistryP::findLocal(), and CdbStatus::Success.

CdbStatus CdbBdbSViewP::createCondition const char *    thePathName,
const char *    theNewConditionName,
const char *    theDescription,
const BdbTime   theCreationTime,
const CdbBdbSId   theId,
const BdbRef(CdbBdbSConfigCollectionP)&    theConfigRef = 0
 

Create new condition.

This operation requires the full path to a "host" folder where the specified condition will be placed into. The "host" folder must already be existing at a time when this method is called.

If the specified "host" folder is not found then CdbStatus::NotFound will be returned. The usual error status will be returned in other cases.

Parameters:
thePathName  the path name to a "host" folder
theNewConditionName  the condition name at the "host" folder
theDescription  the description of the condition
theCreationTime  the time when the condition is supposed to be created
theId  the "extended" identifier of the "physical" condition
theConfigRef  an optional configuration object

Definition at line 419 of file CdbBdbSViewP.cc.

References BdbRef(), CdbStatus::Error, findFolder(), CdbPathName::isComposite(), isFrozen(), CdbPathName::isRoot(), CdbPathName::isValid(), and CdbStatus::Success.

BdbTime CdbBdbSViewP::created   const
 

Definition at line 173 of file CdbBdbSViewP.cc.

CdbStatus CdbBdbSViewP::createFolder const char *    theFullPathName,
const char *    theDescription,
const BdbTime   theCreationTime
 

Create new folder (RECURSIVE).

This operation creates the specified folder path, including intermediate subdirectories if they still do not exist.

NOTE: The specified "description" and "creation" timestamp will be assigned to all newely created folders.

Parameters:
theFullPathName  the full path name of the folder to be created
theDescription  the description of the folder
theCreationTime  the time when the folder is supposed to be created

Definition at line 364 of file CdbBdbSViewP.cc.

References CdbPathName::afterFirst(), CdbStatus::Error, CdbPathName::isAbsolute(), isFrozen(), CdbPathName::isRoot(), CdbPathName::isValid(), CdbStatus::Success, and CdbPathName::toString().

CdbStatus CdbBdbSViewP::createFolder const char *    thePathName,
const char *    theNewFolderName,
const char *    theDescription,
const BdbTime   theCreationTime
 

Create new folder.

This operation requires the full path to a "host" folder where the specified one will be placed into. The "host" folder must already be existing at a time when this method is called.

If the specified "host" folder is not found then CdbStatus::NotFound will be returned. The usual error status will be returned in other cases.

Parameters:
thePathName  the path name to a "host" folder
theNewFolderName  the folder name at the "host" folder
theDescription  the description of the folder
theCreationTime  the time when the folder is supposed to be created

Definition at line 304 of file CdbBdbSViewP.cc.

References BdbRef(), CdbStatus::Error, findFolder(), CdbPathName::isComposite(), isFrozen(), CdbPathName::isRoot(), CdbPathName::isValid(), and CdbStatus::Success.

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

Dump the contents of the object.

Definition at line 658 of file CdbBdbSViewP.cc.

References CdbBdbSCollectionElementP::id().

CdbStatus CdbBdbSViewP::findCondition const char *    thePathName,
BdbRef(CdbBdbSConditionAtFolderP)&    theRef
const
 

Find the condition.

This operation requires the full path to the required condition. Upon successfull completion it will return CdbStatus::Success. If the condition is not found CdbStatus::NotFound will be returned. The error status will be returned in other cases.

Parameters:
thePathName  the full path name to the condition
theRef  the reference to the found condition to be set up

Definition at line 608 of file CdbBdbSViewP.cc.

References BdbRef(), CdbPathName::beforeLast(), CdbStatus::Error, findFolder(), CdbPathName::isAbsolute(), CdbPathName::isRoot(), CdbPathName::isValid(), CdbPathName::last(), CdbStatus::NotFound, CdbStatus::Success, and CdbPathName::toString().

Referenced by setConfig().

CdbStatus CdbBdbSViewP::findFolder const char *    thePathName,
BdbRef(CdbBdbSFolderP)&    theRef
const
 

Find the folder.

This operation requires the full path to the required folder. Upon successfull completion it will return CdbStatus::Success. If the folder is not found CdbStatus::NotFound will be returned. The error status will be returned in other cases.

Parameters:
thePathName  the full path name to the folder
theRef  the reference to the found folder to be set up

Definition at line 574 of file CdbBdbSViewP.cc.

References CdbPathName::afterFirst(), CdbStatus::Error, CdbBdbSFolderP::findFolder(), CdbPathName::isAbsolute(), CdbPathName::isRoot(), CdbPathName::isValid(), and CdbStatus::Success.

Referenced by createCondition(), createFolder(), findCondition(), removeCondition(), and removeFolder().

CdbStatus CdbBdbSViewP::folderIterator CdbItr< const char * > &    theItr const
 

Set up an iterator of folder names.

This method will always return CdbStatus::Success and the only name returned by the iterator would be the root folder's name.

Parameters:
theItr  the value of the iterator be set up

Definition at line 644 of file CdbBdbSViewP.cc.

References CdbStatus::Success.

void CdbBdbSViewP::freeze  
 

"Freeze" the view

Once a view is frozen then there is no way to revert it back.

See also:
CdbBdbSViewP::isFrozen()

Definition at line 209 of file CdbBdbSViewP.cc.

bool CdbBdbSViewP::isFrozen   const
 

Check if this view is "frozen" from any further modifications.

If a view is in "frozen" state then it can't be modified (adding/removing folders or conditions or any other relevant operations). A view gets into this state immediatelly upon its creation.

A view in the "frozen" is available to clients.

Definition at line 203 of file CdbBdbSViewP.cc.

Referenced by createCondition(), createFolder(), removeCondition(), removeFolder(), setConfig(), and setDefaultConfig().

BdbTime CdbBdbSViewP::maxValidity   const
 

Definition at line 185 of file CdbBdbSViewP.cc.

BdbTime CdbBdbSViewP::minValidity   const
 

Definition at line 179 of file CdbBdbSViewP.cc.

CdbBdbSViewP::ooString 32    const
 

Reimplemented from CdbBdbSCollectionElementP.

CdbStatus CdbBdbSViewP::removeCondition const char *    thePathName
 

Remove the condition.

This operation requires the absolute path to the condition.

If there is no such condition then CdbStatus::NotFound will be returned. Other status values are as usual.

Parameters:
thePathName  the full path name of the condition to be removed

Definition at line 529 of file CdbBdbSViewP.cc.

References BdbRef(), CdbPathName::beforeLast(), CdbStatus::Error, findFolder(), isFrozen(), CdbPathName::isRoot(), CdbPathName::isValid(), CdbPathName::last(), CdbStatus::Success, and CdbPathName::toString().

CdbStatus CdbBdbSViewP::removeFolder const char *    thePathName,
bool    forceFlag = false
 

Remove the folder.

This operation requires the absolute path to the folder. The "root" folder can never be deleted.

If the "forceFlag" is set FALSE then only an empty folder with no other subfolders or conditions in it can be removed. Otherwise both the folder itself and its contents will be exterminated.

NOTE: This operation does not affect 'physical conditions'.

If there is no such folder then CdbStatus::NotFound will be returned. Other status values are as usual.

Parameters:
thePathName  the full path name of the folder to be removed
forceFlag  force removal if the folder is not empty

Definition at line 481 of file CdbBdbSViewP.cc.

References BdbRef(), CdbPathName::beforeLast(), CdbStatus::Error, findFolder(), isFrozen(), CdbPathName::isRoot(), CdbPathName::isValid(), CdbPathName::last(), CdbStatus::Success, and CdbPathName::toString().

CdbStatus CdbBdbSViewP::setConfig const char *    thePathName,
const BdbRef(CdbBdbSConfigCollectionP)&    theConfigRef,
bool    dontDestroyConfigObject = false
 

Set/override configuration at a level of specified condition.

The passed reference can be 0-0-0-0. The previously stored configuration object (if any) will be destroyed unless an optional 'dontDestroyConfigObject' flag is set to true.

If there is no such folder then CdbStatus::NotFound will be returned. Other status values are as usual.

NOTE: This operation requires the view to be available for modifications (not being frozen).

Parameters:
thePathName  the full path name of the condition to be modified
theConfigRef  a configuration object
dontDestroyConfigObject  an optional flag

Definition at line 264 of file CdbBdbSViewP.cc.

References BdbRef(), CdbStatus::Error, findCondition(), isFrozen(), CdbStatus::NotFound, and CdbStatus::Success.

CdbStatus CdbBdbSViewP::setDefaultConfig const BdbRef(CdbBdbSConfigCollectionP)&    theConfigRef
 

Set/override default configuration at a level of a view.

The passed reference can be 0-0-0-0. The previously stored configuration object (if any) will be destroyed.

NOTE: This operation requires the view to be available for modifications (not being frozen).

Parameters:
theConfigRef  a configuration object

Definition at line 223 of file CdbBdbSViewP.cc.

References CdbStatus::Error, isFrozen(), and CdbStatus::Success.

void CdbBdbSViewP::warm  
 

"Un-freeze" the view

Once a view is frozen then generally there is no way to revert it back. However we still need to do this sometimes.

See also:
CdbBdbSViewP::isFrozen()

Definition at line 216 of file CdbBdbSViewP.cc.


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