#include <RefTable.h>
Inheritance diagram for RefTableBase< FROM, MAPENTRY >:
inline code of class DataObject | |
void | setRegistry (IRegistry *pRegistry) |
Set pointer to Registry. | |
IRegistry * | registry () const |
Get pointer to Registry. | |
LinkManager * | linkMgr () const |
Retrieve Link manager. | |
unsigned char | version () const |
Retrieve version number of this object representation. | |
void | setVersion (unsigned char vsn) |
Set version number of this object representation. | |
unsigned long | refCount () const |
Return the refcount. | |
virtual std::ostream & | fillStream (std::ostream &s) const |
Fill the output stream (ASCII). | |
std::ostream & | operator<< (std::ostream &s, const DataObject &obj) |
Output operator (ASCII). | |
Public Types | |
typedef FROM | KeyType |
typedef MAPENTRY | EntryType |
typedef RefTableBase< FROM, EntryType > | BaseType |
typedef GaudiUtils::HashMap< const void *, EntryType > | TableType |
Define Reference map. | |
typedef TableType::iterator | iterator |
Definition of map iterator. | |
typedef TableType::const_iterator | const_iterator |
Definition of map iterator (CONST). | |
Public Member Functions | |
RefTableBase (const CLID &clid, int len) | |
Constructors. | |
virtual | ~RefTableBase () |
Destructor. | |
virtual void | clear () |
Clear Reference map. | |
iterator | begin () |
Start of direct access iterator. | |
const_iterator | begin () const |
Start of direct access iterator (CONST). | |
iterator | end () |
End of direct access iterator. | |
const_iterator | end () const |
End of direct access iterator (CONST). | |
long | size () const |
Size of References. | |
void | reserve (int len) |
Size of References. | |
virtual StreamBuffer & | serialize (StreamBuffer &s) const |
Serialize the object for writing. | |
virtual StreamBuffer & | serialize (StreamBuffer &s) |
Serialize the object for reading. | |
virtual unsigned long | addRef () |
Add reference to object. | |
virtual unsigned long | release () |
release reference to object | |
virtual const CLID & | clID () const |
Retrieve reference to class definition structure. | |
const std::string & | name () const |
Retreive DataObject name. It is the name when registered in the store. | |
Static Public Member Functions | |
static const CLID & | classID () |
Retrieve reference to class definition structure (static access). | |
Public Attributes | |
CLID | m_clid |
Class id of the reference table. | |
Protected Member Functions | |
bool | insertMapElement (const KeyType *from, EntryType &to) |
Insert new Entry into Reference container. | |
EntryType * | i_reference (const KeyType *from) |
Find Reference from it's source entry. | |
const EntryType * | i_reference (const KeyType *from) const |
Find Reference from it's source entry (CONST). | |
Private Attributes | |
TableType | m_table |
Reference map. | |
SmartRef< KeyType > | m_fromRef |
This is a completely useless entry, but the compiler wants it to be instantiated before the serialize function is defined. |
ClassName: RefTableBase
Description: Essential information of the RefTable References can be of several kinds: multiplicity: FROM TO 1 0 = 1 (no existing Reference) 1 1 <-> 1 relationship n 1 <-> n relationship Template parameters: FROM type of the source object TO type of the referenced object(s) MAPENTRY entry type used for the referenced objects within the map.
Author: Markus Frank
Definition at line 46 of file RefTable.h.
typedef FROM RefTableBase< FROM, MAPENTRY >::KeyType |
Definition at line 49 of file RefTable.h.
typedef MAPENTRY RefTableBase< FROM, MAPENTRY >::EntryType |
Definition at line 51 of file RefTable.h.
typedef RefTableBase<FROM, EntryType> RefTableBase< FROM, MAPENTRY >::BaseType |
Definition at line 53 of file RefTable.h.
typedef GaudiUtils::HashMap< const void* , EntryType > RefTableBase< FROM, MAPENTRY >::TableType |
Define Reference map.
Need to use index into vector, because location of vector entries is not fixed
Definition at line 57 of file RefTable.h.
typedef TableType::iterator RefTableBase< FROM, MAPENTRY >::iterator |
typedef TableType::const_iterator RefTableBase< FROM, MAPENTRY >::const_iterator |
RefTableBase< FROM, MAPENTRY >::RefTableBase | ( | const CLID & | clid, | |
int | len | |||
) | [inline] |
virtual RefTableBase< FROM, MAPENTRY >::~RefTableBase | ( | ) | [inline, virtual] |
bool RefTableBase< FROM, MAPENTRY >::insertMapElement | ( | const KeyType * | from, | |
EntryType & | to | |||
) | [inline, protected] |
EntryType* RefTableBase< FROM, MAPENTRY >::i_reference | ( | const KeyType * | from | ) | [inline, protected] |
Find Reference from it's source entry.
Definition at line 79 of file RefTable.h.
00079 { 00080 iterator i = m_table.find( from ); 00081 if ( i != 0 ) { 00082 return &((*i).second); 00083 } 00084 return 0; 00085 }
const EntryType* RefTableBase< FROM, MAPENTRY >::i_reference | ( | const KeyType * | from | ) | const [inline, protected] |
Find Reference from it's source entry (CONST).
Definition at line 87 of file RefTable.h.
00087 { 00088 const_iterator i = m_table.find( from ); 00089 if ( i != m_table.end() ) { 00090 return &((*i).second); 00091 } 00092 return 0; 00093 }
virtual void RefTableBase< FROM, MAPENTRY >::clear | ( | ) | [inline, virtual] |
iterator RefTableBase< FROM, MAPENTRY >::begin | ( | ) | [inline] |
const_iterator RefTableBase< FROM, MAPENTRY >::begin | ( | ) | const [inline] |
iterator RefTableBase< FROM, MAPENTRY >::end | ( | ) | [inline] |
const_iterator RefTableBase< FROM, MAPENTRY >::end | ( | ) | const [inline] |
long RefTableBase< FROM, MAPENTRY >::size | ( | ) | const [inline] |
void RefTableBase< FROM, MAPENTRY >::reserve | ( | int | len | ) | [inline] |
Size of References.
Definition at line 128 of file RefTable.h.
00128 { 00129 m_table.reserve(len); 00130 }
virtual StreamBuffer& RefTableBase< FROM, MAPENTRY >::serialize | ( | StreamBuffer & | s | ) | const [inline, virtual] |
Serialize the object for writing.
Reimplemented from DataObject.
Definition at line 132 of file RefTable.h.
00132 { 00133 DataObject::serialize(s) << m_table.size(); 00134 //for (TableType::const_iterator i = m_table.begin(), stop = m_table.end(); i != stop; i++ ) { 00135 // SmartRef<KeyType> fromRef; 00136 // fromRef = (KeyType*)(*i).first; 00137 // s << fromRef(this); 00138 // s << (*i).second(this); 00139 //} 00140 return s; 00141 }
virtual StreamBuffer& RefTableBase< FROM, MAPENTRY >::serialize | ( | StreamBuffer & | s | ) | [inline, virtual] |
Serialize the object for reading.
Reimplemented from DataObject.
Definition at line 143 of file RefTable.h.
00143 { 00144 long siz; 00145 DataObject::serialize(s) >> siz; 00146 m_table.reserve(siz); 00147 //for ( long i = 0; i < siz; i++ ) { 00148 // SmartRef<KeyType> fromRef; 00149 // EntryType entry; 00150 // s >> fromRef(this); 00151 // s >> entry(this); 00152 // insertMapElement( fromRef, entry); 00153 //} 00154 return s; 00155 }
virtual unsigned long DataObject::addRef | ( | ) | [virtual, inherited] |
Add reference to object.
virtual unsigned long DataObject::release | ( | ) | [virtual, inherited] |
release reference to object
virtual const CLID& DataObject::clID | ( | ) | const [virtual, inherited] |
Retrieve reference to class definition structure.
Reimplemented in AlgorithmHistory, AlgToolHistory, DataHistory, HistoryObj, JobHistory, KeyedContainer< DATATYPE, MAPPING >, NTuple::Directory, NTuple::File, NTuple::ColumnWiseTuple, NTuple::RowWiseTuple, ObjectList< TYPE >, ObjectVector< TYPE >, RefTable1to1< FROM, TO >, RefTable1toN< FROM, TO >, ServiceHistory, and SharedObjectsContainer< TYPE >.
static const CLID& DataObject::classID | ( | ) | [static, inherited] |
Retrieve reference to class definition structure (static access).
Reimplemented in AlgorithmHistory, AlgToolHistory, DataHistory, HistoryObj, JobHistory, KeyedContainer< DATATYPE, MAPPING >, NTuple::Directory, NTuple::File, NTuple::ColumnWiseTuple, NTuple::RowWiseTuple, ObjectList< TYPE >, ObjectVector< TYPE >, ServiceHistory, and SharedObjectsContainer< TYPE >.
const std::string& DataObject::name | ( | ) | const [inherited] |
Retreive DataObject name. It is the name when registered in the store.
Reimplemented in NTuple::File, and ServiceHistory.
void DataObject::setRegistry | ( | IRegistry * | pRegistry | ) | [inline, inherited] |
Set pointer to Registry.
Definition at line 67 of file DataObject.h.
00067 { 00068 m_pRegistry = pRegistry; 00069 }
IRegistry* DataObject::registry | ( | ) | const [inline, inherited] |
Get pointer to Registry.
Definition at line 71 of file DataObject.h.
00071 { 00072 return m_pRegistry; 00073 }
LinkManager* DataObject::linkMgr | ( | ) | const [inline, inherited] |
Retrieve Link manager.
Definition at line 75 of file DataObject.h.
00075 { 00076 return m_pLinkMgr; 00077 }
unsigned char DataObject::version | ( | ) | const [inline, inherited] |
Retrieve version number of this object representation.
Definition at line 79 of file DataObject.h.
00079 { 00080 return m_version; 00081 }
void DataObject::setVersion | ( | unsigned char | vsn | ) | [inline, inherited] |
Set version number of this object representation.
Definition at line 83 of file DataObject.h.
00083 { 00084 m_version = vsn; 00085 }
unsigned long DataObject::refCount | ( | ) | const [inline, inherited] |
Return the refcount.
Definition at line 87 of file DataObject.h.
00087 { 00088 return m_refCount; 00089 }
virtual std::ostream& DataObject::fillStream | ( | std::ostream & | s | ) | const [inline, virtual, inherited] |
Fill the output stream (ASCII).
Reimplemented in ObjectList< TYPE >, and ObjectVector< TYPE >.
Definition at line 91 of file DataObject.h.
std::ostream& operator<< | ( | std::ostream & | s, | |
const DataObject & | obj | |||
) | [friend, inherited] |
Output operator (ASCII).
Definition at line 96 of file DataObject.h.
00096 { 00097 return obj.fillStream(s); 00098 }
CLID RefTableBase< FROM, MAPENTRY >::m_clid |
TableType RefTableBase< FROM, MAPENTRY >::m_table [private] |
SmartRef<KeyType> RefTableBase< FROM, MAPENTRY >::m_fromRef [private] |
This is a completely useless entry, but the compiler wants it to be instantiated before the serialize function is defined.
Definition at line 71 of file RefTable.h.