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

CdbRooRoNameIdCollectionR< T > Class Template Reference

A persistent collection of 'named' and 'id'-ed objects. More...

Inheritance diagram for CdbRooRoNameIdCollectionR< T >:

CdbRooRoPersistentCollectionR List of all members.

Public Member Functions

 CdbRooRoNameIdCollectionR ()
 The normal and the default constructor.

 CdbRooRoNameIdCollectionR (const CdbRooRoNameIdCollectionR< T > &theOther)
 The copy constructor.

virtual ~CdbRooRoNameIdCollectionR ()
 Destructor.

UInt_t size () const
virtual CdbStatus add (const T &theObject)
virtual CdbStatus find (UShort_t theId, T &theObject) const
virtual CdbStatus find (UShort_t theId, CdbCPtr< T > &theObjectPtr) const
virtual CdbStatus find (const std::string &theName, T &theObject) const
virtual CdbStatus find (const std::string &theName, CdbCPtr< T > &theObjectPtr) const
void identifiers (std::vector< UShort_t > &theCollection) const
 Return a sorted collection of identifiers.

void names (std::vector< std::string > &theCollection) const
 Return a sorted collection of names.

CdbItr< UShort_t > iterator_identifiers () const
 Return an iterator producing a sorted sequence of identifiers.

CdbItr< std::string > iterator_names () const
 Return an iterator producing a sorted sequence of names.

virtual void dump (std::ostream &o, const std::string &indent="") const

Protected Member Functions

virtual CdbStatus storeSubCollectionsAt (const CdbRooRoCollectionAddressR &theCollectionAddress, const CdbCPtr< TFile > &theFilePtr, Int_t &theNumBytesStored)
 Store sub-collections.


Detailed Description

template<class T>
class CdbRooRoNameIdCollectionR< T >

A persistent collection of 'named' and 'id'-ed objects.

Classes eligible for this template must have the following minimal interface:

class T { public: T(); T( const T&); std::string name() const; UShort_t id() const; };

NOTE: The total number of elements stored in a collection of this type is limited by 64K. Therefore valid indexes of the elements lay in the following range: [0..0xFFFF], inclusive at both sides of the range.

Definition at line 36 of file CdbRooRoNameIdCollectionR.rdl.


Constructor & Destructor Documentation

template<class T>
CdbRooRoNameIdCollectionR< T >::CdbRooRoNameIdCollectionR  
 

The normal and the default constructor.

It's also needed for ROOT I/O.

Definition at line 25 of file CdbRooRoNameIdCollectionR.cc.

template<class T>
CdbRooRoNameIdCollectionR< T >::CdbRooRoNameIdCollectionR const CdbRooRoNameIdCollectionR< T > &    theOther
 

The copy constructor.

IMPORTANT NOTE:

Watch out for the implementation of this constructor because objects of the class can be in two states: "stored" and "transient". The same object can't be stored more than one time due to a unique naming scheme for persistent collections (and their sub-collections (and their elements)) in ROOT files. The same rule applies to copies of an object - after the master copy got stored then its copies can't be stored anymore.

The cache of objects gets always duplicated since it's using counted smart pointers.

And we don't care about supplementary transient context (other than the transient list of objects). That context is only used to populate the transient list from the persistent store. Copying this context accross objects can be dangerous too.

Definition at line 30 of file CdbRooRoNameIdCollectionR.cc.

template<class T>
CdbRooRoNameIdCollectionR< T >::~CdbRooRoNameIdCollectionR   [virtual]
 

Destructor.

Definition at line 38 of file CdbRooRoNameIdCollectionR.cc.


Member Function Documentation

template<class T>
CdbStatus CdbRooRoNameIdCollectionR< T >::add const T &    theObject [virtual]
 

Reimplemented in CdbRooRoViewCollectionR.

Definition at line 43 of file CdbRooRoNameIdCollectionR.cc.

References CdbRooRoVectorCollectionR< T >::addElement(), CdbStatus::Error, CdbRooRoPersistentCollectionR::isStored(), CdbRooRoVectorCollectionR< T >::size(), and CdbStatus::Success.

Referenced by CdbRooRoViewCollectionR::add().

template<class T>
void CdbRooRoNameIdCollectionR< T >::dump std::ostream &    o,
const std::string &    indent = ""
const [virtual]
 

Definition at line 242 of file CdbRooRoNameIdCollectionR.cc.

References CdbRooRoPersistentCollectionR::isStored(), CdbRooRoVectorCollectionR< T >::size(), and CdbRooRoPersistentCollectionR::storedCollectionAddress().

template<class T>
CdbStatus CdbRooRoNameIdCollectionR< T >::find const std::string &    theName,
CdbCPtr< T > &    theObjectPtr
const [virtual]
 

Definition at line 153 of file CdbRooRoNameIdCollectionR.cc.

References CdbRooRoVectorCollectionR< T >::elementAt(), CdbStatus::Error, CdbStatus::NotFound, and CdbStatus::Success.

template<class T>
CdbStatus CdbRooRoNameIdCollectionR< T >::find const std::string &    theName,
T &    theObject
const [virtual]
 

Definition at line 126 of file CdbRooRoNameIdCollectionR.cc.

References CdbRooRoVectorCollectionR< T >::elementAt(), CdbStatus::Error, CdbStatus::NotFound, and CdbStatus::Success.

template<class T>
CdbStatus CdbRooRoNameIdCollectionR< T >::find UShort_t    theId,
CdbCPtr< T > &    theObjectPtr
const [virtual]
 

Definition at line 99 of file CdbRooRoNameIdCollectionR.cc.

References CdbRooRoVectorCollectionR< T >::elementAt(), CdbStatus::Error, CdbStatus::NotFound, and CdbStatus::Success.

template<class T>
CdbStatus CdbRooRoNameIdCollectionR< T >::find UShort_t    theId,
T &    theObject
const [virtual]
 

Definition at line 72 of file CdbRooRoNameIdCollectionR.cc.

References CdbRooRoVectorCollectionR< T >::elementAt(), CdbStatus::Error, CdbStatus::NotFound, and CdbStatus::Success.

template<class T>
void CdbRooRoNameIdCollectionR< T >::identifiers std::vector< UShort_t > &    theCollection const
 

Return a sorted collection of identifiers.

Definition at line 180 of file CdbRooRoNameIdCollectionR.cc.

Referenced by CdbRooRoNameIdCollectionR< T >::iterator_identifiers().

template<class T>
CdbItr< UShort_t > CdbRooRoNameIdCollectionR< T >::iterator_identifiers   const
 

Return an iterator producing a sorted sequence of identifiers.

Definition at line 210 of file CdbRooRoNameIdCollectionR.cc.

References CdbRooRoNameIdCollectionR< T >::identifiers().

template<class T>
CdbItr< std::string > CdbRooRoNameIdCollectionR< T >::iterator_names   const
 

Return an iterator producing a sorted sequence of names.

Definition at line 226 of file CdbRooRoNameIdCollectionR.cc.

References CdbRooRoNameIdCollectionR< T >::names().

template<class T>
void CdbRooRoNameIdCollectionR< T >::names std::vector< std::string > &    theCollection const
 

Return a sorted collection of names.

Definition at line 195 of file CdbRooRoNameIdCollectionR.cc.

Referenced by CdbRooRoNameIdCollectionR< T >::iterator_names().

template<class T>
UInt_t CdbRooRoNameIdCollectionR< T >::size   const [inline]
 

Definition at line 76 of file CdbRooRoNameIdCollectionR.rdl.

template<class T>
CdbStatus CdbRooRoNameIdCollectionR< T >::storeSubCollectionsAt const CdbRooRoCollectionAddressR   theCollectionAddress,
const CdbCPtr< TFile > &    theFilePtr,
Int_t &    theNumBytesStored
[protected, virtual]
 

Store sub-collections.

Implement the corresponding method defined in a base class.

See also:
CdbRooRoPersistentCollectionR::storeSubCollectionsAt()

Reimplemented from CdbRooRoPersistentCollectionR.

Definition at line 258 of file CdbRooRoNameIdCollectionR.cc.

References CdbRooRoVectorCollectionR< T >::elementAt(), CdbStatus::Error, CdbRooRoVectorCollectionR< T >::size(), CdbRooRoPersistentCollectionR::storeAsEmbeddedAt(), and CdbStatus::Success.


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