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

CdbRooRoIdCollectionR< T > Class Template Reference

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

Inheritance diagram for CdbRooRoIdCollectionR< T >:

CdbRooRoPersistentCollectionR List of all members.

Public Member Functions

 CdbRooRoIdCollectionR ()
 The normal and the default constructor.

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

virtual ~CdbRooRoIdCollectionR ()
 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
void identifiers (std::vector< UShort_t > &theCollection) const
 Return a sorted collection of identifiers.

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

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 CdbRooRoIdCollectionR< T >

A persistent collection of 'id'-ed objects.

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

class T { public: T(); T( const T&); 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 35 of file CdbRooRoIdCollectionR.rdl.


Constructor & Destructor Documentation

template<class T>
CdbRooRoIdCollectionR< T >::CdbRooRoIdCollectionR  
 

The normal and the default constructor.

It's also needed for ROOT I/O.

Definition at line 25 of file CdbRooRoIdCollectionR.cc.

template<class T>
CdbRooRoIdCollectionR< T >::CdbRooRoIdCollectionR const CdbRooRoIdCollectionR< 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 CdbRooRoIdCollectionR.cc.

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

Destructor.

Definition at line 37 of file CdbRooRoIdCollectionR.cc.


Member Function Documentation

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

Definition at line 42 of file CdbRooRoIdCollectionR.cc.

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

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

Definition at line 154 of file CdbRooRoIdCollectionR.cc.

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

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

Definition at line 96 of file CdbRooRoIdCollectionR.cc.

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

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

Definition at line 69 of file CdbRooRoIdCollectionR.cc.

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

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

Return a sorted collection of identifiers.

Definition at line 124 of file CdbRooRoIdCollectionR.cc.

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

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

Return an iterator producing a sorted sequence of identifiers.

Definition at line 139 of file CdbRooRoIdCollectionR.cc.

References CdbRooRoIdCollectionR< T >::identifiers().

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

Definition at line 75 of file CdbRooRoIdCollectionR.rdl.

template<class T>
CdbStatus CdbRooRoIdCollectionR< 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 169 of file CdbRooRoIdCollectionR.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