| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
RefTableBase< FROM, MAPENTRY > Class Template Reference

template <class FROM, class TO, class MAPENTRY> class RefTable More...

`#include <GaudiKernel/RefTable.h>`

Inheritance diagram for RefTableBase< FROM, MAPENTRY >:
[legend]
Collaboration diagram for RefTableBase< FROM, MAPENTRY >:
[legend]

## Public Types
typedef FROM | KeyType
typedef MAPENTRY | EntryType
typedef RefTableBase< FROM, EntryType > | BaseType
typedef GaudiUtils::HashMap< const void *, EntryType > | TableType
| Define Reference map. More...
typedef TableType::iterator | iterator
| Definition of map iterator. More...
typedef TableType::const_iterator | const_iterator
| Definition of map iterator (CONST) More...

## Public Member Functions
| RefTableBase (const CLID &clid, int len)
| Constructors. More...
virtual | ~RefTableBase ()=default
| Destructor. More...
virtual void | clear ()
| Clear Reference map. More...
iterator | begin ()
| Start of direct access iterator. More...
const_iterator | begin () const
| Start of direct access iterator (CONST) More...
iterator | end ()
| End of direct access iterator. More...
const_iterator | end () const
| End of direct access iterator (CONST) More...
long | size () const
| Size of References. More...
void | reserve (int len)
| Size of References. More...
virtual StreamBuffer & | serialize (StreamBuffer &s) const
| Serialize the object for writing. More...
virtual StreamBuffer & | serialize (StreamBuffer &s)
| Serialize the object for reading. More...
Public Member Functions inherited from DataObject
| DataObject ()
| Standard Constructor. More...
| DataObject (const DataObject &rhs)
| Copy Constructor. More...
DataObject & | operator= (const DataObject &rhs)
| Assignment Operator. More...
| DataObject (DataObject &&rhs)
| Move Constructor. More...
DataObject & | operator= (DataObject &&rhs)
| Move Assignment Operator. More...
virtual | ~DataObject ()
| Standard Destructor. More...
virtual unsigned long | addRef ()
| Add reference to object. More...
virtual unsigned long | release ()
| release reference to object More...
virtual const CLID & | clID () const
| Retrieve reference to class definition structure. More...
const std::string & | name () const
| Retreive DataObject name. It is the name when registered in the store. More...
virtual StatusCode | update ()
| Provide empty placeholder for internal object reconfiguration callback. More...
void | setRegistry (IRegistry *pRegistry)
| Set pointer to Registry. More...
IRegistry * | registry () const
| Get pointer to Registry. More...
LinkManager * | linkMgr () const
| Retrieve Link manager. More...
unsigned char | version () const
| Retrieve version number of this object representation. More...
void | setVersion (unsigned char vsn)
| Set version number of this object representation. More...
unsigned long | refCount () const
| Return the refcount. More...
virtual std::ostream & | fillStream (std::ostream &s) const
| Fill the output stream (ASCII) More...

## Public Attributes
CLID | m_clid
| Class id of the reference table. More...

## Protected Member Functions
bool | insertMapElement (const KeyType *from, EntryType &to)
| Insert new Entry into Reference container. More...
EntryType * | i_reference (const KeyType *from)
| Find Reference from it's source entry. More...
const EntryType * | i_reference (const KeyType *from) const
| Find Reference from it's source entry (CONST) More...

## Private Attributes
TableType | m_table
| Reference map. More...
SmartRef< KeyType > | m_fromRef
| This is a completely useless entry, but the compiler wants it to be instantiated before the serialize function is defined. More...

## Additional Inherited Members
Static Public Member Functions inherited from DataObject
static const CLID & | classID ()
| Retrieve reference to class definition structure (static access) More...

## Detailed Description

### template<class FROM, class MAPENTRY>
class RefTableBase< FROM, MAPENTRY >

template <class FROM, class TO, class MAPENTRY> class RefTable

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 45 of file RefTable.h.

## Member Typedef Documentation

template<class FROM, class MAPENTRY>

typedef RefTableBase<FROM, EntryType> RefTableBase< FROM, MAPENTRY >::BaseType

Definition at line 52 of file RefTable.h.

template<class FROM, class MAPENTRY>

typedef TableType::const_iterator RefTableBase< FROM, MAPENTRY >::const_iterator

Definition of map iterator (CONST)

Definition at line 60 of file RefTable.h.

template<class FROM, class MAPENTRY>

typedef MAPENTRY RefTableBase< FROM, MAPENTRY >::EntryType

Definition at line 50 of file RefTable.h.

template<class FROM, class MAPENTRY>

typedef TableType::iterator RefTableBase< FROM, MAPENTRY >::iterator

Definition of map iterator.

Definition at line 58 of file RefTable.h.

template<class FROM, class MAPENTRY>

typedef FROM RefTableBase< FROM, MAPENTRY >::KeyType

Definition at line 48 of file RefTable.h.

template<class FROM, class MAPENTRY>

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 56 of file RefTable.h.

## Constructor & Destructor Documentation

template<class FROM, class MAPENTRY>

RefTableBase< FROM, MAPENTRY >::RefTableBase | ( | const CLID & | clid,
|  | int | len
| ) |  |
| inline

Constructors.

Definition at line 90 of file RefTable.h.

90 : m_clid(clid), m_table(len) {
91 }
RefTableBase::m_clid
CLID m_clid
Class id of the reference table.
Definition: RefTable.h:62
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65
template<class FROM, class MAPENTRY>

virtual RefTableBase< FROM, MAPENTRY >::~RefTableBase | ( |  | ) |
| virtual default

Destructor.

## Member Function Documentation

template<class FROM, class MAPENTRY>

iterator RefTableBase< FROM, MAPENTRY >::begin | ( |  | ) |
| inline

Start of direct access iterator.

Definition at line 99 of file RefTable.h.

99 {
100 return m_table.begin();
101 }
GaudiUtils::Map::begin
iterator begin()
Definition: Map.h:131
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65
template<class FROM, class MAPENTRY>

const_iterator RefTableBase< FROM, MAPENTRY >::begin | ( |  | ) | const
| inline

Start of direct access iterator (CONST)

Definition at line 103 of file RefTable.h.

103 {
104 return m_table.begin();
105 }
GaudiUtils::Map::begin
iterator begin()
Definition: Map.h:131
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65
template<class FROM, class MAPENTRY>

virtual void RefTableBase< FROM, MAPENTRY >::clear | ( |  | ) |
| inline virtual

Clear Reference map.

Definition at line 95 of file RefTable.h.

95 {
96 m_table.clear();
97 }
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65
GaudiUtils::Map::clear
void clear()
Definition: Map.h:178
template<class FROM, class MAPENTRY>

iterator RefTableBase< FROM, MAPENTRY >::end | ( |  | ) |
| inline

End of direct access iterator.

Definition at line 107 of file RefTable.h.

107 {
108 return m_table.end();
109 }
GaudiUtils::Map::end
iterator end()
Definition: Map.h:132
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65
template<class FROM, class MAPENTRY>

const_iterator RefTableBase< FROM, MAPENTRY >::end | ( |  | ) | const
| inline

End of direct access iterator (CONST)

Definition at line 111 of file RefTable.h.

111 {
112 return m_table.end();
113 }
GaudiUtils::Map::end
iterator end()
Definition: Map.h:132
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65
template<class FROM, class MAPENTRY>

EntryType* RefTableBase< FROM, MAPENTRY >::i_reference | ( | const KeyType * | from | ) |
| inline protected

Find Reference from it's source entry.

Definition at line 78 of file RefTable.h.

78 {
79 auto i = m_table.find( from );
80 return i != 0 ? &(i->second) : nullptr;
81 }
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:149
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65
ana.i
list i
Definition: ana.py:128
template<class FROM, class MAPENTRY>

const EntryType* RefTableBase< FROM, MAPENTRY >::i_reference | ( | const KeyType * | from | ) | const
| inline protected

Find Reference from it's source entry (CONST)

Definition at line 83 of file RefTable.h.

83 {
84 auto i = m_table.find( from );
85 return i != m_table.end() ? &(i->second) : nullptr;
86 }
GaudiUtils::Map::end
iterator end()
Definition: Map.h:132
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:149
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65
ana.i
list i
Definition: ana.py:128
template<class FROM, class MAPENTRY>

bool RefTableBase< FROM, MAPENTRY >::insertMapElement | ( | const KeyType * | from,
|  | EntryType & | to
| ) |  |
| inline protected

Insert new Entry into Reference container.

Definition at line 74 of file RefTable.h.

74 {
75 return m_table.insert( from, to );
76 }
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65
GaudiUtils::Map::insert
std::pair< iterator, bool > insert(ValueType &&val)
Definition: Map.h:168
template<class FROM, class MAPENTRY>

void RefTableBase< FROM, MAPENTRY >::reserve | ( | int | len | ) |
| inline

Size of References.

Definition at line 119 of file RefTable.h.

119 {
120 m_table.reserve(len);
121 }
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65
template<class FROM, class MAPENTRY>

virtual StreamBuffer& RefTableBase< FROM, MAPENTRY >::serialize | ( | StreamBuffer & | s | ) | const
| inline virtual

Serialize the object for writing.

Definition at line 123 of file RefTable.h.

123 {
124 DataObject::serialize(s) << m_table.size();
125 //for (TableType::const_iterator i = m_table.begin(), stop = m_table.end(); i != stop; i++ ) {
126 // SmartRef<KeyType> fromRef;
127 // fromRef = (KeyType*)(*i).first;
128 // s << fromRef(this);
129 // s << (*i).second(this);
130 //}
131 return s;
132 }
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:182
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65
gaudirun.s
string s
Definition: gaudirun.py:245
template<class FROM, class MAPENTRY>

virtual StreamBuffer& RefTableBase< FROM, MAPENTRY >::serialize | ( | StreamBuffer & | s | ) |
| inline virtual

Serialize the object for reading.

Definition at line 134 of file RefTable.h.

134 {
135 long siz;
136 DataObject::serialize(s) >> siz;
137 m_table.reserve(siz);
138 //for ( long i = 0; i < siz; i++ ) {
139 // SmartRef<KeyType> fromRef;
140 // EntryType entry;
141 // s >> fromRef(this);
142 // s >> entry(this);
143 // insertMapElement( fromRef, entry);
144 //}
145 return s;
146 }
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65
gaudirun.s
string s
Definition: gaudirun.py:245
template<class FROM, class MAPENTRY>

long RefTableBase< FROM, MAPENTRY >::size | ( |  | ) | const
| inline

Size of References.

Definition at line 115 of file RefTable.h.

115 {
116 return m_table.size();
117 }
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:182
RefTableBase::m_table
TableType m_table
Reference map.
Definition: RefTable.h:65

## Member Data Documentation

template<class FROM, class MAPENTRY>

CLID RefTableBase< FROM, MAPENTRY >::m_clid

Class id of the reference table.

Definition at line 62 of file RefTable.h.

template<class FROM, class MAPENTRY>

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 70 of file RefTable.h.

template<class FROM, class MAPENTRY>

TableType RefTableBase< FROM, MAPENTRY >::m_table
| private

Reference map.

Definition at line 65 of file RefTable.h.

The documentation for this class was generated from the following file:

- GaudiKernel/GaudiKernel/RefTable.h