All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RefTable1to1< FROM, TO > Class Template Reference

#include <GaudiKernel/RefTable.h>

Inheritance diagram for RefTable1to1< FROM, TO >:
Collaboration diagram for RefTable1to1< FROM, TO >:

Public Member Functions

 RefTable1to1 (const CLID &clid, int len=16)
 Standard Constructor. More...
 
virtual ~RefTable1to1 ()
 Standard Destructor. More...
 
virtual const CLIDclID () const
 Retrieve reference to class definition structure. More...
 
bool insert (const FROM *from, TO *to)
 Insert new Entry into Reference container. More...
 
bool insert (const FROM *from, const EntryType &to)
 Insert new Entry into Reference container. More...
 
TO * reference (const FROM *from)
 Find Reference from it's source entry. More...
 
const TO * reference (const FROM *from) const
 Find Reference from it's source entry (CONST) More...
 
bool isReferenced (const FROM *from, const TO *to)
 Check if two entries are associated to each other. More...
 
bool isReferenced (const FROM *from, const EntryType &to)
 Check if two entries are Referenced to each other. More...
 
- Public Member Functions inherited from RefTableBase< FROM, SmartRef< TO > >
 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...
 
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...
 

Additional Inherited Members

- Public Types inherited from RefTableBase< FROM, SmartRef< TO > >
typedef FROM KeyType
 
typedef SmartRef< TO > 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...
 
- Static Public Member Functions inherited from DataObject
static const CLIDclassID ()
 Retrieve reference to class definition structure (static access) More...
 
- Public Attributes inherited from RefTableBase< FROM, SmartRef< TO > >
CLID m_clid
 Class id of the reference table. More...
 
- Protected Member Functions inherited from RefTableBase< FROM, SmartRef< TO > >
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...
 

Detailed Description

template<class FROM, class TO>
class RefTable1to1< FROM, TO >

Definition at line 158 of file RefTable.h.

Constructor & Destructor Documentation

template<class FROM , class TO >
RefTable1to1< FROM, TO >::RefTable1to1 ( const CLID clid,
int  len = 16 
)
inline

Standard Constructor.

Definition at line 162 of file RefTable.h.

163  : RefTableBase< FROM , SmartRef<TO> >(clid, len)
164  {
165  }
template class RefTable
Definition: RefTable.h:46
template<class FROM , class TO >
virtual RefTable1to1< FROM, TO >::~RefTable1to1 ( )
inlinevirtual

Standard Destructor.

Definition at line 167 of file RefTable.h.

167  {
168  }

Member Function Documentation

template<class FROM , class TO >
virtual const CLID& RefTable1to1< FROM, TO >::clID ( ) const
inlinevirtual

Retrieve reference to class definition structure.

Reimplemented from DataObject.

Definition at line 170 of file RefTable.h.

170  {
171  return m_clid;
172  }
CLID m_clid
Class id of the reference table.
Definition: RefTable.h:63
template<class FROM , class TO >
bool RefTable1to1< FROM, TO >::insert ( const FROM *  from,
TO *  to 
)
inline

Insert new Entry into Reference container.

Definition at line 174 of file RefTable.h.

174  {
175  return insertMapElement(from, EntryType(to));
176  }
bool insertMapElement(const KeyType *from, EntryType &to)
Insert new Entry into Reference container.
Definition: RefTable.h:75
template<class FROM , class TO >
bool RefTable1to1< FROM, TO >::insert ( const FROM *  from,
const EntryType to 
)
inline

Insert new Entry into Reference container.

Definition at line 178 of file RefTable.h.

178  {
179  // We MUST check the environment of the smart pointer!
180  if ( 0 != to.data() || StreamBuffer::INVALID != to.hintID() ) {
181  return insertMapElement(from, EntryType(to));
182  }
183  return false;
184  }
bool insertMapElement(const KeyType *from, EntryType &to)
Insert new Entry into Reference container.
Definition: RefTable.h:75
template<class FROM , class TO >
bool RefTable1to1< FROM, TO >::isReferenced ( const FROM *  from,
const TO *  to 
)
inline

Check if two entries are associated to each other.

Definition at line 198 of file RefTable.h.

198  {
199  const EntryType* e = i_reference(from);
200  return (e == 0) ? false : ((*e) == to);
201  }
EntryType * i_reference(const KeyType *from)
Find Reference from it's source entry.
Definition: RefTable.h:79
template<class FROM , class TO >
bool RefTable1to1< FROM, TO >::isReferenced ( const FROM *  from,
const EntryType to 
)
inline

Check if two entries are Referenced to each other.

Definition at line 203 of file RefTable.h.

203  {
204  const EntryType* e = i_reference(from);
205  return (assoc!=0) ? ((*e)!=to) ? (e->target()==to.target()) : false : false;
206  }
EntryType * i_reference(const KeyType *from)
Find Reference from it's source entry.
Definition: RefTable.h:79
template<class FROM , class TO >
TO* RefTable1to1< FROM, TO >::reference ( const FROM *  from)
inline

Find Reference from it's source entry.

Definition at line 186 of file RefTable.h.

186  {
187  EntryType* e = i_reference(from);
188  return (0 == e) ? 0 : (*e);
189  }
EntryType * i_reference(const KeyType *from)
Find Reference from it's source entry.
Definition: RefTable.h:79
template<class FROM , class TO >
const TO* RefTable1to1< FROM, TO >::reference ( const FROM *  from) const
inline

Find Reference from it's source entry (CONST)

Definition at line 192 of file RefTable.h.

192  {
193  const EntryType* e = i_reference(from);
194  return (0 == e) ? 0 : (*e);
195  }
EntryType * i_reference(const KeyType *from)
Find Reference from it's source entry.
Definition: RefTable.h:79

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