1 #ifndef GAUDIKERNEL_REFTABLE_H 2 #define GAUDIKERNEL_REFTABLE_H 1 14 static const CLID CLID_RefTable1to1 = 300;
15 static const CLID CLID_RefTable1toN = 301;
75 return m_table.
insert( from, to );
79 auto i = m_table.
find( from );
80 return i != 0 ? &(i->second) :
nullptr;
84 auto i = m_table.
find( from );
85 return i != m_table.
end() ? &(i->second) :
nullptr;
100 return m_table.
begin();
104 return m_table.
begin();
108 return m_table.
end();
111 const_iterator
end()
const {
112 return m_table.
end();
116 return m_table.
size();
120 m_table.reserve(len);
124 DataObject::serialize(s) << m_table.
size();
136 DataObject::serialize(s) >> siz;
137 m_table.reserve(siz);
165 bool insert (
const FROM* from, TO* to ) {
179 return (0 == e) ? 0 : (*e);
185 return e ? *e :
nullptr;
191 return e && ( *e == to );
215 bool insert (
const FROM* from, TO* to) {
220 if ( !( 0 == newEntry) ) {
235 if ( !(0 == newEntry) ) {
252 return e ? *e : empty;
258 return e ? *e : empty;
263 return e && ( *e == to );
277 #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)
GaudiUtils::HashMap< const void *, EntryType > TableType
Define Reference map.
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)
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.
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.
std::pair< iterator, bool > insert(ValueType &&val)
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.