![]() |
The Gaudi Framework
master (ff829712)
|
Kernel objects: SmartRef. More...
#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/SmartRef.h>
Public Types | |
enum | { VALID = StreamBuffer::VALID , INVALID = StreamBuffer::INVALID } |
typedef TYPE | entry_type |
Entry type definition. | |
Public Member Functions | |
SmartRef (const TYPE *pObject=nullptr) | |
Standard Constructor. | |
SmartRef (const SmartRef ©) | |
Copy Constructor. | |
SmartRef (long hint, long link, const TYPE *obj=nullptr) | |
Constructor. | |
SmartRef (const ContainedObject *pObj, long hint, long link, const TYPE *obj=nullptr) | |
Constructor for references to contained objects passing environment. | |
SmartRef (const DataObject *pObj, long hint, long link, const TYPE *obj=nullptr) | |
Constructor for references to contained objects passing environment. | |
SmartRef (const DataObject *pObj, long hint, const TYPE *obj=nullptr) | |
Constructor for references to DataObjects passing environment. | |
bool | shouldFollowLink (const DataObject *) const |
Check if link should be followed: link must be valid and object not yet loaded. | |
bool | shouldFollowLink (const ContainedObject *) const |
Check if link should be followed: link must be valid and object not yet loaded. | |
long | hintID () const |
Access hint id: | |
long | linkID () const |
Access link id: | |
void | set (DataObject *pObj, long hint_id, long link_id) |
Setup smart reference when reading. Must be allowed from external sources. | |
const std::type_info * | type () const |
Access to embedded type. | |
TYPE * | data () |
Access to raw data pointer. | |
const TYPE * | data () const |
const TYPE * | target () const |
Access to the object. | |
TYPE * | target () |
Access to the object. | |
const std::string & | path () const |
Return the path of the linked object inside the data store. | |
bool | operator== (const SmartRef< TYPE > &c) const |
Equality operator. | |
bool | operator== (SmartRef< TYPE > &rhs) |
operator bool () const | |
explicit conversion to bool to check for object existence (will load object) | |
const SmartRef< TYPE > & | _setEnvironment (const DataObject *pObj, const ContainedObject *pContd) const |
Set the environment (CONST) | |
SmartRef< TYPE > & | _setEnvironment (const DataObject *pObj, const ContainedObject *pContd) |
Set the environment (CONST) | |
SmartRef< TYPE > & | operator() (ContainedObject *pObj) |
operator(): assigns parent object for serialisation | |
const SmartRef< TYPE > & | operator() (const ContainedObject *pObj) const |
operator() const: assigns parent object for serialisation | |
SmartRef< TYPE > & | operator() (DataObject *pObj) |
operator(): assigns parent object for serialisation | |
const SmartRef< TYPE > & | operator() (const DataObject *pObj) const |
operator() const: assigns parent object for serialisation | |
SmartRef< TYPE > & | operator= (const SmartRef< TYPE > &c) |
Assignment. | |
SmartRef< TYPE > & | operator= (const TYPE *pObject) |
Assignment. | |
TYPE & | operator* () |
Dereference operator. | |
const TYPE & | operator* () const |
Dereference operator. | |
TYPE * | operator-> () |
Dereference operator. | |
const TYPE * | operator-> () const |
Dereference operator to const object. | |
operator const TYPE * () const | |
Implicit type conversion to const object. | |
operator TYPE * () | |
Implicit type conversion. | |
StreamBuffer & | writeRef (StreamBuffer &s) const |
Write the reference to the stream buffer (needed due to stupid G++ compiler) | |
StreamBuffer & | readRef (StreamBuffer &s) |
Read the reference from the stream buffer (needed due to stupid G++ compiler) | |
Private Attributes | |
SmartRefBase | m_base |
const TYPE * | m_target = nullptr |
Pointer to target data object. | |
Friends | |
class | SmartRefArray< TYPE > |
The container must be a friend. | |
class | SmartRefList< TYPE > |
class | SmartRefMap< TYPE > |
bool | operator== (SmartRef< TYPE > &lhs, TYPE *rhs) |
bool | operator== (const SmartRef< TYPE > &lhs, const TYPE *rhs) |
StreamBuffer & | operator<< (StreamBuffer &_s, const SmartRef< TYPE > &ptr) |
Output Streamer operator. | |
StreamBuffer & | operator>> (StreamBuffer &_s, SmartRef< TYPE > &ptr) |
Input Streamer operator. | |
Kernel objects: SmartRef.
Description: The SmartRef class allows transparent handling of object links within the data store. Links are unloaded a priori and will only be loaded "on demand", i.e. when dereferenced.
SmartRefs should behave in the same way as normal pointers; The SmartRef object in fact is a smart pointer construct intercepting the dereference operators.
When loading, the executed code resides in the non templated base class. This ensures, that the templated code is minimized and code blow up is inhibited.
Using SmartRefs StreamBuffers are able to also save the references on data conversion requests.
Base Class: SmartRefBase
Dependencies:
History :
+---------+----------------------------------------------+--------+ | Date | Comment | Who | +---------+----------------------------------------------+--------+ | 21/04/99| Initial version. | MF | | 16/01/04| Move base class into aggregation. | MF | +---------+----------------------------------------------+--------+
Author: M.Frank Version: 1.0
Definition at line 64 of file SmartRef.h.
Entry type definition.
Definition at line 77 of file SmartRef.h.
anonymous enum |
|
inline |
Standard Constructor.
Definition at line 80 of file SmartRef.h.
|
inline |
Copy Constructor.
Definition at line 87 of file SmartRef.h.
|
inline |
Constructor.
Definition at line 94 of file SmartRef.h.
|
inline |
Constructor for references to contained objects passing environment.
Definition at line 101 of file SmartRef.h.
|
inline |
Constructor for references to contained objects passing environment.
Definition at line 109 of file SmartRef.h.
|
inline |
Constructor for references to DataObjects passing environment.
Definition at line 116 of file SmartRef.h.
|
inline |
Set the environment (CONST)
Definition at line 175 of file SmartRef.h.
|
inline |
Access to raw data pointer.
Definition at line 137 of file SmartRef.h.
Definition at line 138 of file SmartRef.h.
explicit conversion to bool to check for object existence (will load object)
Definition at line 165 of file SmartRef.h.
|
inline |
operator() const: assigns parent object for serialisation
Definition at line 187 of file SmartRef.h.
|
inline |
operator() const: assigns parent object for serialisation
Definition at line 194 of file SmartRef.h.
|
inline |
operator(): assigns parent object for serialisation
Definition at line 182 of file SmartRef.h.
|
inline |
Equality operator.
Definition at line 152 of file SmartRef.h.
Definition at line 159 of file SmartRef.h.
Return the path of the linked object inside the data store.
Definition at line 150 of file SmartRef.h.
|
inline |
|
inline |
|
inline |
|
inline |
Check if link should be followed: link must be valid and object not yet loaded.
Definition at line 123 of file SmartRef.h.
|
inline |
|
friend |
Output Streamer operator.
Definition at line 233 of file SmartRef.h.
Definition at line 162 of file SmartRef.h.
Definition at line 161 of file SmartRef.h.
|
friend |
Input Streamer operator.
Definition at line 236 of file SmartRef.h.
|
friend |
The container must be a friend.
Definition at line 64 of file SmartRef.h.
|
friend |
Definition at line 64 of file SmartRef.h.
|
friend |
Definition at line 64 of file SmartRef.h.
|
private |
Definition at line 70 of file SmartRef.h.
Pointer to target data object.
Definition at line 72 of file SmartRef.h.