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

CdbRooRoViewR Class Reference

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

List of all members.

Public Member Functions

 CdbRooRoViewR ()
 Default constructor.

 CdbRooRoViewR (const std::string &theName, UShort_t theId, const std::string &theDescription, const BdbTime &theCreationTime, const BdbTime &theMinValidityTime=BdbTime::minusInfinity, const BdbTime &theMaxValidityTime=BdbTime::plusInfinity, CdbRooRoConfigCollectionR *theDefaultConfigPtr=0)
 Normal constructor.

 CdbRooRoViewR (const CdbRooRoViewR &theOther)
 Copy constructor.

virtual ~CdbRooRoViewR ()
 Destructor.

CdbRooRoViewR & operator= (const CdbRooRoViewR &theOther)
 Assignment operator.

const std::string & name () const
UShort_t id () const
const std::string & description () const
BdbTime created () const
BdbTime minValidity () const
BdbTime maxValidity () const
const CdbRooRoConfigCollectionRdefaultConfig () const
CdbRooRoConfigCollectionRdefaultConfig ()
const CdbRooRoFolderRrootFolder () const
CdbRooRoFolderRrootFolder ()
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 (CdbRooRoConfigCollectionR *theConfigPtr)
 Set/override default configuration at a level of a view.

CdbStatus setConfig (const std::string &thePathName, CdbRooRoConfigCollectionR *theConfigPtr, bool dontDestroyConfigObject=false)
 Set/override configuration at a level of specified condition.

CdbStatus createFolder (const std::string &thePathName, const std::string &theNewFolderName, const std::string &theDescription, const BdbTime &theCreationTime)
 Create new folder.

CdbStatus createFolder (const std::string &theFullPathName, const std::string &theDescription, const BdbTime &theCreationTime)
 Create new folder (RECURSIVE).

CdbStatus createCondition (const std::string &thePathName, const std::string &theNewConditionName, const std::string &theDescription, const BdbTime &theCreationTime, const CdbRooRoIdR &theId, CdbRooRoConfigCollectionR *theConfigPtr=0)
 Create new condition.

CdbStatus removeFolder (const std::string &thePathName, bool forceFlag=false)
 Remove the folder.

CdbStatus removeCondition (const std::string &thePathName)
 Remove the condition.

CdbStatus findFolder (const std::string &thePathName, CdbRooRoFolderR *&thePtr)
 Find the folder.

CdbStatus findCondition (const std::string &thePathName, CdbRooRoConditionAtFolderR *&thePtr)
 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 23 of file CdbRooRoViewR.rdl.


Constructor & Destructor Documentation

CdbRooRoViewR::CdbRooRoViewR  
 

Default constructor.

It's required by ROOT I/O

Definition at line 25 of file CdbRooRoViewR.cc.

CdbRooRoViewR::CdbRooRoViewR const std::string &    theName,
UShort_t    theId,
const std::string &    theDescription,
const BdbTime   theCreationTime,
const BdbTime   theMinValidityTime = BdbTime::minusInfinity,
const BdbTime   theMaxValidityTime = BdbTime::plusInfinity,
CdbRooRoConfigCollectionR   theDefaultConfigPtr = 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 39 of file CdbRooRoViewR.cc.

CdbRooRoViewR::CdbRooRoViewR const CdbRooRoViewR &    theOther
 

Copy constructor.

Need a non-trivial constructor because we have we have a cyclic graph of View, Folder and ConditionAtFolder objects.

Definition at line 63 of file CdbRooRoViewR.cc.

CdbRooRoViewR::~CdbRooRoViewR   [virtual]
 

Destructor.

Definition at line 77 of file CdbRooRoViewR.cc.


Member Function Documentation

CdbStatus CdbRooRoViewR::createCondition const std::string &    thePathName,
const std::string &    theNewConditionName,
const std::string &    theDescription,
const BdbTime   theCreationTime,
const CdbRooRoIdR   theId,
CdbRooRoConfigCollectionR   theConfigPtr = 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
theConfigPtr  an optional configuration object

Definition at line 300 of file CdbRooRoViewR.cc.

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

BdbTime CdbRooRoViewR::created   const [inline]
 

Definition at line 74 of file CdbRooRoViewR.rdl.

References CdbRooRoTimeR::getBdbTime().

Referenced by CdbRooRoViewCollectionR::add(), and dump().

CdbStatus CdbRooRoViewR::createFolder const std::string &    theFullPathName,
const std::string &    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 247 of file CdbRooRoViewR.cc.

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

CdbStatus CdbRooRoViewR::createFolder const std::string &    thePathName,
const std::string &    theNewFolderName,
const std::string &    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 191 of file CdbRooRoViewR.cc.

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

CdbRooRoConfigCollectionR* CdbRooRoViewR::defaultConfig   [inline]
 

Definition at line 79 of file CdbRooRoViewR.rdl.

const CdbRooRoConfigCollectionR* CdbRooRoViewR::defaultConfig   const [inline]
 

Definition at line 78 of file CdbRooRoViewR.rdl.

Referenced by dump(), CdbRooRoConditionAtFolderR::find(), and setDefaultConfig().

const std::string& CdbRooRoViewR::description   const [inline]
 

Definition at line 72 of file CdbRooRoViewR.rdl.

Referenced by dump().

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

Dump the contents of the object.

Definition at line 532 of file CdbRooRoViewR.cc.

References created(), defaultConfig(), description(), CdbRooRoConfigCollectionR::dump(), id(), isFrozen(), maxValidity(), minValidity(), name(), and CdbTimeUtils::time2string().

CdbStatus CdbRooRoViewR::findCondition const std::string &    thePathName,
CdbRooRoConditionAtFolderR *&    thePtr
 

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
thePtr  the poinjter to the found condition to be set up

Definition at line 482 of file CdbRooRoViewR.cc.

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

Referenced by setConfig().

CdbStatus CdbRooRoViewR::findFolder const std::string &    thePathName,
CdbRooRoFolderR *&    thePtr
 

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
thePtr  the pointer to the found folder to be set up

Definition at line 448 of file CdbRooRoViewR.cc.

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

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

CdbStatus CdbRooRoViewR::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 518 of file CdbRooRoViewR.cc.

References CdbStatus::Success.

void CdbRooRoViewR::freeze   [inline]
 

"Freeze" the view

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

See also:
CdbRooRoViewR::isFrozen()

Definition at line 100 of file CdbRooRoViewR.rdl.

UShort_t CdbRooRoViewR::id   const [inline]
 

Definition at line 70 of file CdbRooRoViewR.rdl.

Referenced by CdbRooRoViewCollectionR::add(), and dump().

bool CdbRooRoViewR::isFrozen   const [inline]
 

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 92 of file CdbRooRoViewR.rdl.

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

BdbTime CdbRooRoViewR::maxValidity   const [inline]
 

Definition at line 76 of file CdbRooRoViewR.rdl.

References CdbRooRoTimeR::getBdbTime().

Referenced by dump(), and CdbRooRoConditionAtFolderR::find().

BdbTime CdbRooRoViewR::minValidity   const [inline]
 

Definition at line 75 of file CdbRooRoViewR.rdl.

References CdbRooRoTimeR::getBdbTime().

Referenced by dump(), and CdbRooRoConditionAtFolderR::find().

const std::string& CdbRooRoViewR::name   const [inline]
 

Definition at line 68 of file CdbRooRoViewR.rdl.

Referenced by dump().

CdbRooRoViewR & CdbRooRoViewR::operator= const CdbRooRoViewR &    theOther
 

Assignment operator.

Need a non-trivial constructor because we have we have a cyclic graph of View, Folder and ConditionAtFolder objects.

Definition at line 90 of file CdbRooRoViewR.cc.

References _created, _defaultConfigPtr, _description, _id, _isFrozen, _maxValidityTime, _minValidityTime, _name, _rootFolderPtr, _useDefaultConfigPtr, and _useRootFolderPtr.

CdbStatus CdbRooRoViewR::removeCondition const std::string &    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 405 of file CdbRooRoViewR.cc.

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

CdbStatus CdbRooRoViewR::removeFolder const std::string &    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 359 of file CdbRooRoViewR.cc.

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

CdbRooRoFolderR* CdbRooRoViewR::rootFolder   [inline]
 

Definition at line 82 of file CdbRooRoViewR.rdl.

const CdbRooRoFolderR* CdbRooRoViewR::rootFolder   const [inline]
 

Definition at line 81 of file CdbRooRoViewR.rdl.

Referenced by createFolder(), and findFolder().

CdbStatus CdbRooRoViewR::setConfig const std::string &    thePathName,
CdbRooRoConfigCollectionR   theConfigPtr,
bool    dontDestroyConfigObject = false
 

Set/override configuration at a level of specified condition.

The passed pointer can be 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
theConfigPtr  a configuration object
dontDestroyConfigObject  an optional flag

Definition at line 153 of file CdbRooRoViewR.cc.

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

CdbStatus CdbRooRoViewR::setDefaultConfig CdbRooRoConfigCollectionR   theConfigPtr
 

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

The passed pointer can be 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:
theConfigPtr  a configuration object

Definition at line 113 of file CdbRooRoViewR.cc.

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

void CdbRooRoViewR::warm   [inline]
 

"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:
CdbRooRoViewR::isFrozen()

Definition at line 109 of file CdbRooRoViewR.rdl.


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