![]() |
The Gaudi Framework
master (77e7e51e)
|
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. More... | |
Public Member Functions | |
SmartRef (const TYPE *pObject=nullptr) | |
Standard Constructor. More... | |
SmartRef (const SmartRef ©) | |
Copy Constructor. More... | |
SmartRef (long hint, long link, const TYPE *obj=nullptr) | |
Constructor. More... | |
SmartRef (const ContainedObject *pObj, long hint, long link, const TYPE *obj=nullptr) | |
Constructor for references to contained objects passing environment. More... | |
SmartRef (const DataObject *pObj, long hint, long link, const TYPE *obj=nullptr) | |
Constructor for references to contained objects passing environment. More... | |
SmartRef (const DataObject *pObj, long hint, const TYPE *obj=nullptr) | |
Constructor for references to DataObjects passing environment. More... | |
bool | shouldFollowLink (const DataObject *) const |
Check if link should be followed: link must be valid and object not yet loaded. More... | |
bool | shouldFollowLink (const ContainedObject *) const |
Check if link should be followed: link must be valid and object not yet loaded. More... | |
long | hintID () const |
Access hint id: More... | |
long | linkID () const |
Access link id: More... | |
void | set (DataObject *pObj, long hint_id, long link_id) |
Setup smart reference when reading. Must be allowed from external sources. More... | |
const std::type_info * | type () const |
Access to embedded type. More... | |
TYPE * | data () |
Access to raw data pointer. More... | |
const TYPE * | data () const |
const TYPE * | target () const |
Access to the object. More... | |
TYPE * | target () |
Access to the object. More... | |
const std::string & | path () const |
Return the path of the linked object inside the data store. More... | |
bool | operator== (const SmartRef< TYPE > &c) const |
Equality operator. More... | |
bool | operator!= (const SmartRef< TYPE > &c) const |
NON-Equality operator. More... | |
operator bool () const | |
explicit conversion to bool to check for object existence (will load object) More... | |
const SmartRef< TYPE > & | _setEnvironment (const DataObject *pObj, const ContainedObject *pContd) const |
Set the environment (CONST) More... | |
SmartRef< TYPE > & | _setEnvironment (const DataObject *pObj, const ContainedObject *pContd) |
Set the environment (CONST) More... | |
SmartRef< TYPE > & | operator() (ContainedObject *pObj) |
operator(): assigns parent object for serialisation More... | |
const SmartRef< TYPE > & | operator() (const ContainedObject *pObj) const |
operator() const: assigns parent object for serialisation More... | |
SmartRef< TYPE > & | operator() (DataObject *pObj) |
operator(): assigns parent object for serialisation More... | |
const SmartRef< TYPE > & | operator() (const DataObject *pObj) const |
operator() const: assigns parent object for serialisation More... | |
SmartRef< TYPE > & | operator= (const SmartRef< TYPE > &c) |
Assignment. More... | |
SmartRef< TYPE > & | operator= (const TYPE *pObject) |
Assignment. More... | |
TYPE & | operator* () |
Dereference operator. More... | |
const TYPE & | operator* () const |
Dereference operator. More... | |
TYPE * | operator-> () |
Dereference operator. More... | |
const TYPE * | operator-> () const |
Dereference operator to const object. More... | |
operator const TYPE * () const | |
Implicit type conversion to const object. More... | |
operator TYPE * () | |
Implicit type conversion. More... | |
StreamBuffer & | writeRef (StreamBuffer &s) const |
Write the reference to the stream buffer (needed due to stupid G++ compiler) More... | |
StreamBuffer & | readRef (StreamBuffer &s) |
Read the reference from the stream buffer (needed due to stupid G++ compiler) More... | |
Private Attributes | |
SmartRefBase | m_base |
const TYPE * | m_target = nullptr |
Pointer to target data object. More... | |
Friends | |
class | SmartRefArray< TYPE > |
The container must be a friend. More... | |
class | SmartRefList< TYPE > |
class | SmartRefMap< TYPE > |
bool | operator== (const SmartRef< TYPE > &ref, std::nullptr_t) |
bool | operator== (std::nullptr_t, const SmartRef< TYPE > &ref) |
Friend helper to check for object existence (will load object) More... | |
bool | operator!= (const SmartRef< TYPE > &ref, std::nullptr_t) |
bool | operator!= (std::nullptr_t, const SmartRef< TYPE > &ref) |
Friend helper to check for object existence (will load object) More... | |
StreamBuffer & | operator<< (StreamBuffer &_s, const SmartRef< TYPE > &ptr) |
Output Streamer operator. More... | |
StreamBuffer & | operator>> (StreamBuffer &_s, SmartRef< TYPE > &ptr) |
Input Streamer operator. More... | |
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 76 of file SmartRef.h.
typedef TYPE SmartRef< TYPE >::entry_type |
Entry type definition.
Definition at line 89 of file SmartRef.h.
anonymous enum |
Standard Constructor.
Definition at line 92 of file SmartRef.h.
|
inline |
Constructor.
Definition at line 106 of file SmartRef.h.
|
inline |
Constructor for references to contained objects passing environment.
Definition at line 113 of file SmartRef.h.
|
inline |
Constructor for references to contained objects passing environment.
Definition at line 121 of file SmartRef.h.
|
inline |
Constructor for references to DataObjects passing environment.
Definition at line 128 of file SmartRef.h.
|
inline |
Set the environment (CONST)
Definition at line 194 of file SmartRef.h.
|
inline |
Set the environment (CONST)
Definition at line 187 of file SmartRef.h.
|
inline |
|
inline |
Definition at line 150 of file SmartRef.h.
|
inline |
|
inline |
|
inlineexplicit |
explicit conversion to bool to check for object existence (will load object)
Definition at line 184 of file SmartRef.h.
|
inline |
|
inline |
|
inline |
operator() const: assigns parent object for serialisation
Definition at line 206 of file SmartRef.h.
|
inline |
operator() const: assigns parent object for serialisation
Definition at line 213 of file SmartRef.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the path of the linked object inside the data store.
Definition at line 162 of file SmartRef.h.
|
inline |
Read the reference from the stream buffer (needed due to stupid G++ compiler)
Definition at line 246 of file SmartRef.h.
|
inline |
Setup smart reference when reading. Must be allowed from external sources.
Definition at line 145 of file SmartRef.h.
|
inline |
|
inline |
|
inline |
Access to the object.
Definition at line 157 of file SmartRef.h.
|
inline |
Access to the object.
Definition at line 152 of file SmartRef.h.
|
inline |
|
inline |
Write the reference to the stream buffer (needed due to stupid G++ compiler)
Definition at line 241 of file SmartRef.h.
|
friend |
Definition at line 178 of file SmartRef.h.
|
friend |
Friend helper to check for object existence (will load object)
Definition at line 181 of file SmartRef.h.
|
friend |
|
friend |
Definition at line 171 of file SmartRef.h.
|
friend |
Friend helper to check for object existence (will load object)
Definition at line 174 of file SmartRef.h.
|
friend |
|
friend |
The container must be a friend.
Definition at line 1 of file SmartRef.h.
|
friend |
Definition at line 1 of file SmartRef.h.
|
friend |
Definition at line 1 of file SmartRef.h.
|
private |
Definition at line 82 of file SmartRef.h.
|
mutableprivate |
Pointer to target data object.
Definition at line 84 of file SmartRef.h.