13#define CHECK_KEYED_CONTAINER
20template <
class T,
class M>
38 template <
class CONTAINER,
class DATATYPE>
44 template <
class SETUP>
89 static long hash(
const key_type& key_value ) {
return key_value; }
92 if ( v ) v->setKey( k );
99#ifdef CHECK_KEYED_CONTAINER
100 return ( v ) ? (
hash( v->key() ) ==
hash( k ) ) :
false;
119 template <
class CONTAINER,
class DATATYPE>
122 static bool checkBounds(
const std::vector<DATATYPE*>* cnt,
const typename DATATYPE::key_type& k ) {
123#ifdef CHECK_KEYED_CONTAINER
124 return size_t( cnt->size() ) > size_t(
traits::hash( k ) );
KeyedObjectManager()
Standard Constructor.
template class KeyedContainer, KeyedContainer.h
Definition of the templated KeyedObject class.
GAUDI_API void containerIsInconsistent()
Function to be called to indicate that the container is found to be inconsistent.
@ OBJ_DELETED
Object was removed from the container and deleted.
@ OBJ_INSERTED
Object was inserted into the container.
@ OBJ_ERASED
Object was removed, but not deleted.
@ OBJ_NOT_FOUND
Object not present in the container.
@ OBJ_CANNOT_INSERT
Cannot insert object into container.
GAUDI_API void cannotAssignObjectKey()
Function to be called when an object key cannot be assigned.
GAUDI_API void cannotInsertToContainer()
Function to be called to indicate that an object cannot be inserted to the container.
GAUDI_API void invalidContainerOperation()
Function to be called to indicate that an operation should be performed on the container or it's cont...
static long identifier(const key_type &k)
Full unhashed key identifier.
static bool checkKey(obj_type *v, const key_type &k)
Check the validity of the object's key.
static void setKey(obj_type *v, const key_type &k)
Set object key when inserted into the container.
KeyedObject< key_type > obj_type
static key_type makeKey(int k)
static long release(obj_type *v)
Release reference to object.
static long hash(const key_type &key_value)
Hash function for this key.
static key_type makeKey(long k)
Create key from its full integer representation.
static long addRef(obj_type *v)
Add reference counter to object when inserted into the container.
static bool checkBounds(const std::vector< DATATYPE * > *cnt, const typename DATATYPE::key_type &k)
Allow to check the access to container elements for consistency.