The Gaudi Framework
v30r3 (a5ef0a68)
|
Definition of the templated KeyedObject class. More...
#include <GaudiKernel/KeyedObject.h>
Public Types | |
typedef KEY | key_type |
Definition of the key-type to access object. More... | |
Public Member Functions | |
KeyedObject ()=default | |
Standard Constructor. The object key is preset to the invalid value. More... | |
KeyedObject (const key_type &kval) | |
Standard Constructor accepting the object's key. More... | |
~KeyedObject () override | |
Standard destructor. More... | |
const key_type & | key () const |
Retrieve Key of the object. More... | |
bool | hasKey () const |
Check if the object has a key assigned or not. More... | |
long | index () const override |
Distance in the parent container. More... | |
StreamBuffer & | serialize (StreamBuffer &s) const override |
Serialize the object for writing. More... | |
StreamBuffer & | serialize (StreamBuffer &s) override |
Serialize the object for reading. More... | |
Public Member Functions inherited from ContainedObject | |
virtual const CLID & | clID () const |
Retrieve pointer to class identifier. More... | |
const ObjectContainerBase * | parent () const |
Access to parent object. More... | |
void | setParent (ObjectContainerBase *value) |
Update parent member. More... | |
virtual std::ostream & | fillStream (std::ostream &s) const |
Fill the output stream (ASCII) More... | |
Protected Types | |
typedef Containers::key_traits< key_type > | traits |
definition of the container key traits to be made friend More... | |
Protected Member Functions | |
unsigned long | addRef () |
Add reference to object (Increase reference counter). More... | |
unsigned long | release () |
Release reference. If the reference count is ZERO, delete the object. More... | |
void | setKey (const key_type &key) |
Set object key. More... | |
Protected Member Functions inherited from ContainedObject | |
ContainedObject ()=default | |
Constructors. More... | |
ContainedObject (const ContainedObject &) | |
Copy constructor – do NOT copy the parent reference... More... | |
virtual | ~ContainedObject () |
Destructor. More... | |
Protected Attributes | |
key_type | m_key {} |
Object Key. More... | |
long | m_refCount = 0 |
Reference counter. More... | |
bool | m_hasKey = false |
Boolean to indicate wether a key was already assigned. More... | |
Private Member Functions | |
KeyedObject (const KeyedObject ©) | |
NOBODY may copy these objects. More... | |
Friends | |
struct | GaudiDict::KeyedObjectDict< KEY > |
struct | Containers::key_traits< key_type > |
Allow the container traits to access full object properties. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ContainedObject | |
static const CLID & | classID () |
Definition of the templated KeyedObject class.
This object, which is of the basic containedObject type allows to be identified by key.
This implementation uses a reference count mechanism for insertion into multiple containers; Once the reference count is NULL, the object will automatically be deleted.
Definition at line 30 of file KeyedObject.h.
typedef KEY KeyedObject< KEY >::key_type |
Definition of the key-type to access object.
Definition at line 36 of file KeyedObject.h.
|
protected |
definition of the container key traits to be made friend
Definition at line 40 of file KeyedObject.h.
|
default |
Standard Constructor. The object key is preset to the invalid value.
|
inline |
Standard Constructor accepting the object's key.
The key must be valid and cannot be changed later.
Definition at line 70 of file KeyedObject.h.
|
inlineoverride |
Standard destructor.
Definition at line 97 of file KeyedObject.h.
|
inlineprivate |
NOBODY may copy these objects.
Definition at line 85 of file KeyedObject.h.
|
inlineprotected |
|
inline |
Check if the object has a key assigned or not.
Definition at line 76 of file KeyedObject.h.
|
inlineoverridevirtual |
Distance in the parent container.
Reimplemented from ContainedObject.
Definition at line 77 of file KeyedObject.h.
|
inline |
|
inlineprotected |
Release reference. If the reference count is ZERO, delete the object.
Definition at line 115 of file KeyedObject.h.
|
inlineoverridevirtual |
Serialize the object for writing.
Reimplemented from ContainedObject.
Definition at line 139 of file KeyedObject.h.
|
inlineoverridevirtual |
Serialize the object for reading.
Reimplemented from ContainedObject.
Definition at line 146 of file KeyedObject.h.
|
inlineprotected |
Set object key.
The key for consistency reasons can be set only once for the object. Any attempt to redefine the key results in an exception.
Definition at line 127 of file KeyedObject.h.
|
friend |
Allow the container traits to access full object properties.
Definition at line 45 of file KeyedObject.h.
|
friend |
Definition at line 32 of file KeyedObject.h.
|
protected |
Boolean to indicate wether a key was already assigned.
Definition at line 53 of file KeyedObject.h.
|
protected |
Object Key.
Definition at line 49 of file KeyedObject.h.
|
protected |
Reference counter.
Definition at line 51 of file KeyedObject.h.