1 #ifndef GAUDIKERNEL_KEYEDTRAITS_H 2 #define GAUDIKERNEL_KEYEDTRAITS_H 4 #define CHECK_KEYED_CONTAINER 13 template <
class T,
class M>
34 template <
class CONTAINER,
class DATATYPE>
40 template <
class SETUP>
83 static long identifier(
const key_type& k ) {
return k; }
85 static long hash(
const key_type& key_value ) {
return key_value; }
87 static void setKey( obj_type* v,
const key_type& k )
95 static bool checkKey( obj_type* v,
const key_type& k )
97 #ifdef CHECK_KEYED_CONTAINER 98 return ( v ) ? (
hash( v->
key() ) ==
hash( k ) ) :
false;
117 template <
class CONTAINER,
class DATATYPE>
122 #ifdef CHECK_KEYED_CONTAINER 130 #endif // GAUDIKERNEL_KEYEDTRAITS_H
static long addRef(obj_type *v)
Add reference counter to object when inserted into the container.
static key_type makeKey(int k)
static bool checkBounds(const std::vector< DATATYPE * > *cnt, const typename DATATYPE::key_type &k)
Allow to check the access to container elements for consistency.
Definition of the templated KeyedObject class.
GAUDI_API void containerIsInconsistent()
Function to be called to indicate that the container is found to be inconsistent. ...
Object not present in the container.
template class KeyedContainer, KeyedContainer.h
static bool checkKey(obj_type *v, const key_type &k)
Check the validity of the object's key.
static key_type makeKey(long k)
Create key from its full integer representation.
Object was inserted into the container.
KeyedObject< key_type > obj_type
Declaration of keyed object type.
GAUDI_API void cannotInsertToContainer()
Function to be called to indicate that an object cannot be inserted to the container.
void setKey(const key_type &key)
Set object key.
KEY key_type
Declaration of key-type.
static long hash(const key_type &key_value)
Hash function for this key.
GAUDI_API void invalidContainerOperation()
Function to be called to indicate that an operation should be performed on the container or it's cont...
const key_type & key() const
Retrieve Key of the object.
unsigned long addRef()
Add reference to object (Increase reference counter).
Object was removed, but not deleted.
unsigned long release()
Release reference. If the reference count is ZERO, delete the object.
static long identifier(const key_type &k)
Full unhashed key identifier.
GAUDI_API void cannotAssignObjectKey()
Function to be called when an object key cannot be assigned.
Cannot insert object into container.
KeyedObjectManager Class to manage keyed objects.
static long release(obj_type *v)
Release reference to object.
Object was removed from the container and deleted.
static void setKey(obj_type *v, const key_type &k)
Set object key when inserted into the container.