Go to the documentation of this file.
11 #ifndef GAUDIKERNEL_KEYEDOBJECT_H
12 #define GAUDIKERNEL_KEYEDOBJECT_H
61 bool m_hasKey =
false;
84 bool hasKey()
const {
return m_hasKey; }
85 long index()
const override {
return traits::identifier( m_key ); }
108 setParent(
nullptr );
122 long cnt = --m_refCount;
123 if ( cnt <= 0 )
delete this;
152 m_key = traits::makeKey( k );
156 #endif // GAUDIKERNEL_KEYEDOBJECT_H
unsigned long addRef()
Add reference to object (Increase reference counter).
long index() const override
Distance in the parent container.
void setKey(const key_type &key)
Set object key.
StreamBuffer & serialize(StreamBuffer &s) const override
Serialize the object for writing.
KeyedObject()=default
Standard Constructor. The object key is preset to the invalid value.
virtual long remove(ContainedObject *value)=0
Release object from the container (the pointer will be removed from the container,...
KeyedObject(const key_type &kval)
Standard Constructor accepting the object's key.
Containers::key_traits< key_type > traits
definition of the container key traits to be made friend
Definition of the templated KeyedObject class.
bool hasKey() const
Check if the object has a key assigned or not.
KEY key_type
Definition of the key-type to access object.
KeyedObject(const KeyedObject ©)
NOBODY may copy these objects.
StreamBuffer & serialize(StreamBuffer &s) override
Serialize the object for reading.
const key_type & key() const
Retrieve Key of the object.
GAUDI_API void cannotAssignObjectKey()
Function to be called when an object key cannot be assigned.
~KeyedObject() override
Standard destructor.
unsigned long release()
Release reference. If the reference count is ZERO, delete the object.
virtual StreamBuffer & serialize(StreamBuffer &s) const
Serialize the object for writing.