| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 <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.
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.
Public Member Functions inherited from DataObject
| DataObject ()
| Standard Constructor.
| DataObject (const DataObject &)
| Copy Constructor.
virtual | ~DataObject ()
| Standard Destructor.
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.
virtual StatusCode | update ()
| Provide empty placeholder for internal object reconfiguration callback.
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)

## 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.

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

## 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.

: m_clid(clid), m_table(len) {
}
template<class FROM, class MAPENTRY>

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

Destructor.

Definition at line 100 of file RefTable.h.

{
clear();
}

## 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.

{
return m_table.begin();
}
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.

{
return m_table.begin();
}
template<class FROM, class MAPENTRY>

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

Clear Reference map.

Definition at line 104 of file RefTable.h.

{
m_table.clear();
}
template<class FROM, class MAPENTRY>

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

End of direct access iterator.

Definition at line 116 of file RefTable.h.

{
return m_table.end();
}
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.

{
return m_table.end();
}
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 79 of file RefTable.h.

{
iterator i = m_table.find( from );
if ( i != 0 ) {
return &((*i).second);
}
return 0;
}
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 87 of file RefTable.h.

{
const_iterator i = m_table.find( from );
if ( i != m_table.end() ) {
return &((*i).second);
}
return 0;
}
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 75 of file RefTable.h.

{
return m_table.insert( from, to );
}
template<class FROM, class MAPENTRY>

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

Size of References.

Definition at line 128 of file RefTable.h.

{
m_table.reserve(len);
}
template<class FROM, class MAPENTRY>

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

Serialize the object for writing.

Definition at line 132 of file RefTable.h.

{
DataObject::serialize(s) << m_table.size();
//for (TableType::const_iterator i = m_table.begin(), stop = m_table.end(); i != stop; i++ ) {
// SmartRef<KeyType> fromRef;
// fromRef = (KeyType*)(*i).first;
// s << fromRef(this);
// s << (*i).second(this);
//}
return s;
}
template<class FROM, class MAPENTRY>

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

Serialize the object for reading.

Definition at line 143 of file RefTable.h.

{
long siz;
DataObject::serialize(s) >> siz;
m_table.reserve(siz);
//for ( long i = 0; i < siz; i++ ) {
// SmartRef<KeyType> fromRef;
// EntryType entry;
// s >> fromRef(this);
// s >> entry(this);
// insertMapElement( fromRef, entry);
//}
return s;
}
template<class FROM, class MAPENTRY>

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

Size of References.

Definition at line 124 of file RefTable.h.

{
return m_table.size();
}

## 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:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiKernel/GaudiKernel/RefTable.h