All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 >:
Collaboration diagram for RefTableBase< FROM, MAPENTRY >:

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 ()
 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 StreamBufferserialize (StreamBuffer &s) const
 Serialize the object for writing. More...
 
virtual StreamBufferserialize (StreamBuffer &s)
 Serialize the object for reading. More...
 
- Public Member Functions inherited from DataObject
 DataObject ()
 Standard Constructor. More...
 
 DataObject (const DataObject &)
 Copy Constructor. 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 CLIDclID () 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...
 
IRegistryregistry () const
 Get pointer to Registry. More...
 
LinkManagerlinkMgr () 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...
 
EntryTypei_reference (const KeyType *from)
 Find Reference from it's source entry. More...
 
const EntryTypei_reference (const KeyType *from) const
 Find Reference from it's source entry (CONST) More...
 

Private Attributes

TableType m_table
 Reference map. More...
 
SmartRef< KeyTypem_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 CLIDclassID ()
 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 46 of file RefTable.h.

Member Typedef Documentation

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

Definition at line 53 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 61 of file RefTable.h.

template<class FROM, class MAPENTRY>
typedef MAPENTRY RefTableBase< FROM, MAPENTRY >::EntryType

Definition at line 51 of file RefTable.h.

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

Definition of map iterator.

Definition at line 59 of file RefTable.h.

template<class FROM, class MAPENTRY>
typedef FROM RefTableBase< FROM, MAPENTRY >::KeyType

Definition at line 49 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 57 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 97 of file RefTable.h.

97  : m_clid(clid), m_table(len) {
98  }
CLID m_clid
Class id of the reference table.
Definition: RefTable.h:63
TableType m_table
Reference map.
Definition: RefTable.h:66
template<class FROM, class MAPENTRY>
virtual RefTableBase< FROM, MAPENTRY >::~RefTableBase ( )
inlinevirtual

Destructor.

Definition at line 100 of file RefTable.h.

100  {
101  clear();
102  }
virtual void clear()
Clear Reference map.
Definition: RefTable.h:104

Member Function Documentation

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

Start of direct access iterator.

Definition at line 108 of file RefTable.h.

108  {
109  return m_table.begin();
110  }
iterator begin()
Definition: Map.h:130
TableType m_table
Reference map.
Definition: RefTable.h:66
template<class FROM, class MAPENTRY>
const_iterator RefTableBase< FROM, MAPENTRY >::begin ( ) const
inline

Start of direct access iterator (CONST)

Definition at line 112 of file RefTable.h.

112  {
113  return m_table.begin();
114  }
iterator begin()
Definition: Map.h:130
TableType m_table
Reference map.
Definition: RefTable.h:66
template<class FROM, class MAPENTRY>
virtual void RefTableBase< FROM, MAPENTRY >::clear ( )
inlinevirtual

Clear Reference map.

Definition at line 104 of file RefTable.h.

104  {
105  m_table.clear();
106  }
TableType m_table
Reference map.
Definition: RefTable.h:66
void clear()
Definition: Map.h:176
template<class FROM, class MAPENTRY>
iterator RefTableBase< FROM, MAPENTRY >::end ( )
inline

End of direct access iterator.

Definition at line 116 of file RefTable.h.

116  {
117  return m_table.end();
118  }
iterator end()
Definition: Map.h:131
TableType m_table
Reference map.
Definition: RefTable.h:66
template<class FROM, class MAPENTRY>
const_iterator RefTableBase< FROM, MAPENTRY >::end ( ) const
inline

End of direct access iterator (CONST)

Definition at line 120 of file RefTable.h.

120  {
121  return m_table.end();
122  }
iterator end()
Definition: Map.h:131
TableType m_table
Reference map.
Definition: RefTable.h:66
template<class FROM, class MAPENTRY>
EntryType* RefTableBase< FROM, MAPENTRY >::i_reference ( const KeyType from)
inlineprotected

Find Reference from it's source entry.

Definition at line 79 of file RefTable.h.

79  {
80  iterator i = m_table.find( from );
81  if ( i != 0 ) {
82  return &((*i).second);
83  }
84  return 0;
85  }
TableType::iterator iterator
Definition of map iterator.
Definition: RefTable.h:59
iterator find(const key_type &key)
Definition: Map.h:148
TableType m_table
Reference map.
Definition: RefTable.h:66
list i
Definition: ana.py:128
template<class FROM, class MAPENTRY>
const EntryType* RefTableBase< FROM, MAPENTRY >::i_reference ( const KeyType from) const
inlineprotected

Find Reference from it's source entry (CONST)

Definition at line 87 of file RefTable.h.

87  {
88  const_iterator i = m_table.find( from );
89  if ( i != m_table.end() ) {
90  return &((*i).second);
91  }
92  return 0;
93  }
TableType::const_iterator const_iterator
Definition of map iterator (CONST)
Definition: RefTable.h:61
iterator end()
Definition: Map.h:131
iterator find(const key_type &key)
Definition: Map.h:148
TableType m_table
Reference map.
Definition: RefTable.h:66
list i
Definition: ana.py:128
template<class FROM, class MAPENTRY>
bool RefTableBase< FROM, MAPENTRY >::insertMapElement ( const KeyType from,
EntryType to 
)
inlineprotected

Insert new Entry into Reference container.

Definition at line 75 of file RefTable.h.

75  {
76  return m_table.insert( from, to );
77  }
std::pair< iterator, bool > insert(const value_type &val)
Definition: Map.h:165
TableType m_table
Reference map.
Definition: RefTable.h:66
template<class FROM, class MAPENTRY>
void RefTableBase< FROM, MAPENTRY >::reserve ( int  len)
inline

Size of References.

Definition at line 128 of file RefTable.h.

128  {
129  m_table.reserve(len);
130  }
TableType m_table
Reference map.
Definition: RefTable.h:66
template<class FROM, class MAPENTRY>
virtual StreamBuffer& RefTableBase< FROM, MAPENTRY >::serialize ( StreamBuffer s) const
inlinevirtual

Serialize the object for writing.

Definition at line 132 of file RefTable.h.

132  {
133  DataObject::serialize(s) << m_table.size();
134  //for (TableType::const_iterator i = m_table.begin(), stop = m_table.end(); i != stop; i++ ) {
135  // SmartRef<KeyType> fromRef;
136  // fromRef = (KeyType*)(*i).first;
137  // s << fromRef(this);
138  // s << (*i).second(this);
139  //}
140  return s;
141  }
size_type size() const
Definition: Map.h:180
TableType m_table
Reference map.
Definition: RefTable.h:66
string s
Definition: gaudirun.py:210
template<class FROM, class MAPENTRY>
virtual StreamBuffer& RefTableBase< FROM, MAPENTRY >::serialize ( StreamBuffer s)
inlinevirtual

Serialize the object for reading.

Definition at line 143 of file RefTable.h.

143  {
144  long siz;
145  DataObject::serialize(s) >> siz;
146  m_table.reserve(siz);
147  //for ( long i = 0; i < siz; i++ ) {
148  // SmartRef<KeyType> fromRef;
149  // EntryType entry;
150  // s >> fromRef(this);
151  // s >> entry(this);
152  // insertMapElement( fromRef, entry);
153  //}
154  return s;
155  }
TableType m_table
Reference map.
Definition: RefTable.h:66
string s
Definition: gaudirun.py:210
template<class FROM, class MAPENTRY>
long RefTableBase< FROM, MAPENTRY >::size ( ) const
inline

Size of References.

Definition at line 124 of file RefTable.h.

124  {
125  return m_table.size();
126  }
size_type size() const
Definition: Map.h:180
TableType m_table
Reference map.
Definition: RefTable.h:66

Member Data Documentation

template<class FROM, class MAPENTRY>
CLID RefTableBase< FROM, MAPENTRY >::m_clid

Class id of the reference table.

Definition at line 63 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 71 of file RefTable.h.

template<class FROM, class MAPENTRY>
TableType RefTableBase< FROM, MAPENTRY >::m_table
private

Reference map.

Definition at line 66 of file RefTable.h.


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