1 #ifndef GAUDIKERNEL_KEYEDOBJECT_H
2 #define GAUDIKERNEL_KEYEDOBJECT_H
27 template <
class KEY >
71 bool hasKey()
const {
return m_hasKey; }
90 template<
class KEY>
inline
101 template<
class KEY>
inline
107 template<
class KEY>
inline
109 long cnt = --m_refCount;
120 template<
class KEY>
inline
131 template<
class KEY>
inline
137 template<
class KEY>
inline
145 #endif // GAUDIKERNEL_KEYEDOBJECT_H
static long addRef(obj_type *v)
Add reference counter to object when inserted into the container.
Definition of the templated KeyedObject class.
virtual long index() const
Distance in the parent container.
The stream buffer is a small object collecting object data.
KEY key_type
Definition of the key-type to access object.
KeyedObject(const KeyedObject ©)
NOBODY may copy these objects.
long m_refCount
Reference counter.
static key_type makeKey(long k)
Create key from its full integer representation.
KeyedObject(const key_type &kval)
Standard Constructor accepting the object's key.
virtual StreamBuffer & serialize(StreamBuffer &s) const
Serialize the object for writing.
void setKey(const key_type &key)
Set object key.
Containers::key_traits< key_type > traits
definition of the container key traits to be made friend
virtual ~KeyedObject()
Standard destructor.
const key_type & key() const
Retrieve Key of the object.
unsigned long addRef()
Add reference to object (Increase reference counter).
unsigned long release()
Release reference. If the reference count is ZERO, delete the object.
key_type m_key
Object Key; It's initial value is not determined.
static long identifier(const key_type &k)
Full unhashed key identifier.
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
bool hasKey() const
Check if the object has a key assigned or not.
GAUDI_API void cannotAssignObjectKey()
Function to be called when an object key cannot be assigned.
KeyedObject()
Standard Constructor. The object key is preset to the invalid value.
bool m_hasKey
Boolean to indicate wether a key was already assigned.
virtual long remove(ContainedObject *value)=0
Release object from the container (the pointer will be removed from the container, but the object itself will remain alive).
static long release(obj_type *v)
Release reference to object.
ObjectContainerBase is the base class for Gaudi container classes.
virtual StreamBuffer & serialize(StreamBuffer &s) const
Serialize the object for writing.
static void setKey(obj_type *v, const key_type &k)
Set object key when inserted into the container.