1 #ifndef GAUDIKERNEL_REFTABLE_H 2 #define GAUDIKERNEL_REFTABLE_H 1 13 static const CLID CLID_RefTable1to1 = 300;
14 static const CLID CLID_RefTable1toN = 301;
43 template <
class FROM,
class MAPENTRY>
79 auto i = m_table.
find( from );
80 return i != 0 ? &( i->second ) :
nullptr;
85 auto i = m_table.
find( from );
86 return i != m_table.
end() ? &( i->second ) :
nullptr;
103 const_iterator
end()
const {
return m_table.
end(); }
107 void reserve(
int len ) { m_table.reserve( len ); }
111 DataObject::serialize( s ) << m_table.
size();
124 DataObject::serialize( s ) >> siz;
125 m_table.reserve( siz );
137 template <
class FROM,
class TO>
163 return ( 0 == e ) ? 0 : ( *e );
170 return e ? *e :
nullptr;
177 return e && ( *e == to );
183 return assoc && ( *e != to ) && ( e->
target() == to.
target() );
187 template <
class FROM,
class TO>
205 if ( !( 0 == newEntry ) ) {
221 if ( !( 0 == newEntry ) ) {
240 return e ? *e : empty;
247 return e ? *e : empty;
253 return e && ( *e == to );
265 #endif // GAUDIKERNEL_REFTABLE_H CLID m_clid
Class id of the reference table.
RefTableBase< FROM, EntryType > BaseType
iterator begin()
Start of direct access iterator.
bool isReferenced(const FROM *from, const TO *to)
Check if two entries are Referenced to each other.
The stream buffer is a small object collecting object data.
virtual StreamBuffer & serialize(StreamBuffer &s)
Serialize the object for reading.
const TYPE * target() const
Access to the object.
const EntryType * i_reference(const KeyType *from) const
Find Reference from it's source entry (CONST)
TableType::const_iterator const_iterator
Definition of map iterator (CONST)
const_iterator begin() const
Start of direct access iterator (CONST)
TO * reference(const FROM *from)
Find Reference from it's source entry.
bool isReferenced(const FROM *from, const EntryType &to)
Check if two entries are Referenced to each other.
virtual const CLID & clID() const
Retrieve reference to class definition structure.
const EntryType & reference(const FROM *from) const
Find Reference from it's source entry (CONST)
Kernel objects: SmartRefVector.
EntryType * i_reference(const KeyType *from)
Find Reference from it's source entry.
bool insert(const FROM *from, const EntryType &to)
Insert new Entry into Reference container.
const TO * reference(const FROM *from) const
Find Reference from it's source entry (CONST)
std::pair< iterator, bool > insert(ValueType &&val)
void reserve(int len)
Size of References.
long size() const
Size of References.
TableType::iterator iterator
Definition of map iterator.
TYPE * data()
Access to raw data pointer.
iterator end()
End of direct access iterator.
RefTableBase(const CLID &clid, int len)
Constructors.
iterator find(const key_type &key)
RefTable1toN(const CLID &clid, int len=16)
Standard Constructor.
const_iterator end() const
End of direct access iterator (CONST)
unsigned int CLID
Class ID definition.
map_type::const_iterator const_iterator
virtual void clear()
Clear Reference map.
GaudiUtils::HashMap< const void *, EntryType > TableType
Define Reference map.
virtual StreamBuffer & serialize(StreamBuffer &s) const
Serialize the object for writing.
template <class FROM, class TO, class MAPENTRY> class RefTable
TableType m_table
Reference map.
map_type::iterator iterator
long hintID() const
Access hint id:
bool isReferenced(const FROM *from, const SmartRef< TO > &to)
Check if two entries are Referenced to each other.
bool insert(const FROM *from, const SmartRef< TO > &to)
Insert new Entry into Reference container.
RefTable1to1(const CLID &clid, int len=16)
Standard Constructor.
bool insert(const FROM *from, const EntryType &to)
Insert new Entry into Reference container.
bool insert(const FROM *from, TO *to)
Insert new Entry into Reference container.
virtual const CLID & clID() const
Retrieve reference to class definition structure.
bool insertMapElement(const KeyType *from, EntryType &to)
Insert new Entry into Reference container.
SmartRef< KeyType > m_fromRef
This is a completely useless entry, but the compiler wants it to be instantiated before the serialize...
EntryType & reference(const FROM *from)
Find Reference from it's source entry.
A DataObject is the base class of any identifiable object on any data store.
bool isReferenced(const FROM *from, const TO *to) const
Check if two entries are associated to each other.
virtual ~RefTableBase()=default
Destructor.
bool isReferenced(const FROM *from, const EntryType &to)
Check if two entries are Referenced to each other.
bool insert(const FROM *from, TO *to)
Insert new Entry into Reference container.