The Gaudi Framework  v30r1 (5d4f4ae2)
RefTable1toN< FROM, TO > Class Template Reference

#include <GaudiKernel/RefTable.h>

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

Public Member Functions

 RefTable1toN (const CLID &clid, int len=16)
 Standard Constructor. 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 SmartRef< TO > &to)
 Insert new Entry into Reference container. More...
 
bool insert (const FROM *from, const EntryType &to)
 Insert new Entry into Reference container. More...
 
EntryTypereference (const FROM *from)
 Find Reference from it's source entry. More...
 
const EntryTypereference (const FROM *from) const
 Find Reference from it's source entry (CONST) More...
 
bool isReferenced (const FROM *from, const EntryType &to)
 Check if two entries are Referenced to each other. More...
 
bool isReferenced (const FROM *from, const TO *to)
 Check if two entries are Referenced to each other. More...
 
bool isReferenced (const FROM *from, const SmartRef< TO > &to)
 Check if two entries are Referenced to each other. More...
 
- Public Member Functions inherited from RefTableBase< FROM, SmartRefVector< TO > >
 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 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 &rhs)
 Copy Constructor. More...
 
DataObjectoperator= (const DataObject &rhs)
 Assignment Operator. More...
 
 DataObject (DataObject &&rhs)
 Move Constructor. More...
 
DataObjectoperator= (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...
 
const std::stringname () 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::ostreamfillStream (std::ostream &s) const
 Fill the output stream (ASCII) More...
 

Additional Inherited Members

- Public Types inherited from RefTableBase< FROM, SmartRefVector< TO > >
typedef FROM KeyType
 
typedef SmartRefVector< TO > EntryType
 
typedef RefTableBase< FROM, EntryTypeBaseType
 
typedef GaudiUtils::HashMap< const void *, EntryTypeTableType
 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, SmartRefVector< TO > >
CLID m_clid
 Class id of the reference table. More...
 
- Protected Member Functions inherited from RefTableBase< FROM, SmartRefVector< 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 RefTable1toN< FROM, TO >

Definition at line 186 of file RefTable.h.

Constructor & Destructor Documentation

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

Standard Constructor.

Definition at line 190 of file RefTable.h.

190 : RefTableBase<FROM, SmartRefVector<TO>>( clid, len ) {}
template <class FROM, class TO, class MAPENTRY> class RefTable
Definition: RefTable.h:44

Member Function Documentation

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

Retrieve reference to class definition structure.

Reimplemented from DataObject.

Definition at line 193 of file RefTable.h.

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

Insert new Entry into Reference container.

Definition at line 195 of file RefTable.h.

196  {
197  EntryType* entry = i_reference( from );
198  if ( 0 == entry ) {
199  bool result = insertMapElement( from, EntryType() );
200  EntryType* newEntry = i_reference( from );
201  if ( !( 0 == newEntry ) ) {
202  newEntry->push_back( SmartRef<TO>( to ) );
203  return true;
204  }
205  return false;
206  }
207  entry->push_back( SmartRef<TO>( to ) );
208  return true;
209  }
Kernel objects: SmartRef.
Definition: SmartRef.h:66
EntryType * i_reference(const KeyType *from)
Find Reference from it&#39;s source entry.
Definition: RefTable.h:77
bool insertMapElement(const KeyType *from, EntryType &to)
Insert new Entry into Reference container.
Definition: RefTable.h:75
template<class FROM , class TO >
bool RefTable1toN< FROM, TO >::insert ( const FROM *  from,
const SmartRef< TO > &  to 
)
inline

Insert new Entry into Reference container.

Definition at line 211 of file RefTable.h.

212  {
213  EntryType* entry = i_reference( from );
214  if ( 0 == entry ) {
215  bool result = insertMapElement( from, EntryType() );
216  EntryType* newEntry = i_reference( from );
217  if ( !( 0 == newEntry ) ) {
218  newEntry->push_back( to );
219  return true;
220  }
221  return false;
222  }
223  entry->push_back( to );
224  return true;
225  }
EntryType * i_reference(const KeyType *from)
Find Reference from it&#39;s source entry.
Definition: RefTable.h:77
bool insertMapElement(const KeyType *from, EntryType &to)
Insert new Entry into Reference container.
Definition: RefTable.h:75
template<class FROM , class TO >
bool RefTable1toN< FROM, TO >::insert ( const FROM *  from,
const EntryType to 
)
inline

Insert new Entry into Reference container.

Definition at line 227 of file RefTable.h.

228  {
229  return insertMapElement( from, const_cast<EntryType&>( to ) );
230  }
bool insertMapElement(const KeyType *from, EntryType &to)
Insert new Entry into Reference container.
Definition: RefTable.h:75
template<class FROM , class TO >
bool RefTable1toN< FROM, TO >::isReferenced ( const FROM *  from,
const EntryType to 
)
inline

Check if two entries are Referenced to each other.

Definition at line 246 of file RefTable.h.

247  {
248  auto e = i_reference( from );
249  return e && ( *e == to );
250  }
EntryType * i_reference(const KeyType *from)
Find Reference from it&#39;s source entry.
Definition: RefTable.h:77
template<class FROM , class TO >
bool RefTable1toN< FROM, TO >::isReferenced ( const FROM *  from,
const TO *  to 
)
inline

Check if two entries are Referenced to each other.

Definition at line 252 of file RefTable.h.

252 { return isReferenced( from, SmartRef<TO>( to ) ); }
Kernel objects: SmartRef.
Definition: SmartRef.h:66
bool isReferenced(const FROM *from, const EntryType &to)
Check if two entries are Referenced to each other.
Definition: RefTable.h:246
template<class FROM , class TO >
bool RefTable1toN< FROM, TO >::isReferenced ( const FROM *  from,
const SmartRef< TO > &  to 
)
inline

Check if two entries are Referenced to each other.

Definition at line 254 of file RefTable.h.

255  {
256  const EntryType* e = i_reference( from );
257  return assoc && std::find( e->begin(), e->end(), to ) != e->end();
258  }
EntryType * i_reference(const KeyType *from)
Find Reference from it&#39;s source entry.
Definition: RefTable.h:77
T find(T...args)
template<class FROM , class TO >
EntryType& RefTable1toN< FROM, TO >::reference ( const FROM *  from)
inline

Find Reference from it's source entry.

Definition at line 232 of file RefTable.h.

233  {
234  static EntryType empty;
235  EntryType* e = i_reference( from );
236  return e ? *e : empty;
237  }
EntryType * i_reference(const KeyType *from)
Find Reference from it&#39;s source entry.
Definition: RefTable.h:77
template<class FROM , class TO >
const EntryType& RefTable1toN< FROM, TO >::reference ( const FROM *  from) const
inline

Find Reference from it's source entry (CONST)

Definition at line 239 of file RefTable.h.

240  {
241  static const EntryType empty;
242  EntryType* e = i_reference( from );
243  return e ? *e : empty;
244  }
EntryType * i_reference(const KeyType *from)
Find Reference from it&#39;s source entry.
Definition: RefTable.h:77

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