|
Gaudi Framework, version v23r2 |
| Home | Generated: Thu Jun 28 2012 |
Kernel objects: SmartRef. More...
#include <SmartRef.h>

Public Types | |
| enum | { VALID = StreamBuffer::VALID, INVALID = StreamBuffer::INVALID } |
| typedef TYPE | entry_type |
| Entry type definition. | |
Public Member Functions | |
| SmartRef () | |
| Standard Constructor. | |
| SmartRef (TYPE *pObject) | |
| Standard Constructor with initialisation. | |
| SmartRef (const TYPE *pObject) | |
| Standard Constructor with initialisation from const object. | |
| SmartRef (const SmartRef ©) | |
| Copy Constructor. | |
| SmartRef (long hint, long link, TYPE *obj=0) | |
| Constructor. | |
| SmartRef (const ContainedObject *pObj, long hint, long link, TYPE *obj=0) | |
| Constructor for references to contained objects passing environment. | |
| SmartRef (const DataObject *pObj, long hint, long link, TYPE *obj=0) | |
| Constructor for references to contained objects passing environment. | |
| SmartRef (const DataObject *pObj, long hint, TYPE *obj=0) | |
| Constructor for references to DataObjects passing environment. | |
| bool | shouldFollowLink (const DataObject *) const |
| Standard destructor. | |
| 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!= (const SmartRef< TYPE > &c) const |
| NON-Equality operator. | |
| 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= (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) | |
Protected Attributes | |
| SmartRefBase | m_base |
| const TYPE * | m_target |
| Pointer to target data object. | |
Friends | |
| class | SmartRefArray< TYPE > |
| The container must be a friend. | |
| class | SmartRefList< TYPE > |
| class | SmartRefMap< TYPE > |
| 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 62 of file SmartRef.h.
| typedef TYPE SmartRef< TYPE >::entry_type |
Entry type definition.
Definition at line 71 of file SmartRef.h.
| anonymous enum |
Definition at line 69 of file SmartRef.h.
{ VALID = StreamBuffer::VALID, INVALID = StreamBuffer::INVALID };
Standard Constructor.
Definition at line 79 of file SmartRef.h.
Standard Constructor with initialisation.
Definition at line 86 of file SmartRef.h.
Standard Constructor with initialisation from const object.
Definition at line 93 of file SmartRef.h.
Constructor.
Definition at line 107 of file SmartRef.h.
| SmartRef< TYPE >::SmartRef | ( | const ContainedObject * | pObj, |
| long | hint, | ||
| long | link, | ||
| TYPE * | obj = 0 |
||
| ) | [inline] |
Constructor for references to contained objects passing environment.
Definition at line 114 of file SmartRef.h.
{
m_base.m_hintID = hint;
m_base.m_linkID = link;
m_target = obj;
const DataObject* src = (0==pObj) ? 0 : pObj->parent();
_setEnvironment(src, pObj);
}
| SmartRef< TYPE >::SmartRef | ( | const DataObject * | pObj, |
| long | hint, | ||
| long | link, | ||
| TYPE * | obj = 0 |
||
| ) | [inline] |
Constructor for references to contained objects passing environment.
Definition at line 122 of file SmartRef.h.
| SmartRef< TYPE >::SmartRef | ( | const DataObject * | pObj, |
| long | hint, | ||
| TYPE * | obj = 0 |
||
| ) | [inline] |
Constructor for references to DataObjects passing environment.
Definition at line 129 of file SmartRef.h.
| const SmartRef<TYPE>& SmartRef< TYPE >::_setEnvironment | ( | const DataObject * | pObj, |
| const ContainedObject * | pContd | ||
| ) | const [inline] |
Set the environment (CONST)
Definition at line 196 of file SmartRef.h.
| SmartRef<TYPE>& SmartRef< TYPE >::_setEnvironment | ( | const DataObject * | pObj, |
| const ContainedObject * | pContd | ||
| ) | [inline] |
Set the environment (CONST)
Definition at line 203 of file SmartRef.h.
| const TYPE* SmartRef< TYPE >::data | ( | ) | const [inline] |
Definition at line 166 of file SmartRef.h.
{
return m_target;
}
| TYPE* SmartRef< TYPE >::data | ( | ) | [inline] |
Access to raw data pointer.
Definition at line 163 of file SmartRef.h.
{
return const_cast<TYPE*>(m_target);
}
| long SmartRef< TYPE >::hintID | ( | ) | const [inline] |
| long SmartRef< TYPE >::linkID | ( | ) | const [inline] |
| SmartRef< TYPE >::operator const TYPE * | ( | ) | const [inline] |
Implicit type conversion to const object.
Definition at line 249 of file SmartRef.h.
{ return SmartRef<TYPE>::target(); }
| SmartRef< TYPE >::operator TYPE * | ( | ) | [inline] |
Implicit type conversion.
Definition at line 251 of file SmartRef.h.
{ return SmartRef<TYPE>::target(); }
| bool SmartRef< TYPE >::operator!= | ( | const SmartRef< TYPE > & | c ) | const [inline] |
NON-Equality operator.
Definition at line 192 of file SmartRef.h.
{
return !(this->operator==(c));
}
| SmartRef<TYPE>& SmartRef< TYPE >::operator() | ( | ContainedObject * | pObj ) | [inline] |
operator(): assigns parent object for serialisation
Definition at line 210 of file SmartRef.h.
{
const DataObject* src = (0==pObj) ? 0 : pObj->parent();
return _setEnvironment(src, pObj);
}
| const SmartRef<TYPE>& SmartRef< TYPE >::operator() | ( | const ContainedObject * | pObj ) | const [inline] |
operator() const: assigns parent object for serialisation
Definition at line 215 of file SmartRef.h.
{
const DataObject* src = (0==pObj) ? 0 : pObj->parent();
return _setEnvironment(src, pObj);
}
| SmartRef<TYPE>& SmartRef< TYPE >::operator() | ( | DataObject * | pObj ) | [inline] |
operator(): assigns parent object for serialisation
Definition at line 220 of file SmartRef.h.
{
return _setEnvironment(pObj,0);
}
| const SmartRef<TYPE>& SmartRef< TYPE >::operator() | ( | const DataObject * | pObj ) | const [inline] |
operator() const: assigns parent object for serialisation
Definition at line 224 of file SmartRef.h.
{
return _setEnvironment(pObj,0);
}
| TYPE& SmartRef< TYPE >::operator* | ( | ) | [inline] |
Dereference operator.
Definition at line 241 of file SmartRef.h.
{ return *SmartRef<TYPE>::target(); }
| const TYPE& SmartRef< TYPE >::operator* | ( | ) | const [inline] |
Dereference operator.
Definition at line 243 of file SmartRef.h.
{ return *SmartRef<TYPE>::target(); }
| const TYPE* SmartRef< TYPE >::operator-> | ( | ) | const [inline] |
Dereference operator to const object.
Definition at line 247 of file SmartRef.h.
{ return SmartRef<TYPE>::target(); }
| TYPE* SmartRef< TYPE >::operator-> | ( | ) | [inline] |
Dereference operator.
Definition at line 245 of file SmartRef.h.
{ return SmartRef<TYPE>::target(); }
| bool SmartRef< TYPE >::operator== | ( | const SmartRef< TYPE > & | c ) | const [inline] |
Equality operator.
Definition at line 176 of file SmartRef.h.
{
if ( 0 != m_target && 0 != c.m_target ) {
return m_target == c.m_target;
}
else if ( 0 == m_target && 0 == c.m_target ) {
return m_base.isEqual(m_target,c.m_base);
}
else if ( 0 != m_target && 0 == c.m_target ) {
return m_base.isEqualEx(m_target, c.m_base);
}
else if ( 0 == m_target && 0 != c.m_target ) {
return c.m_base.isEqualEx(c.m_target, m_base);
}
return false;
}
| const std::string& SmartRef< TYPE >::path | ( | ) | const [inline] |
Return the path of the linked object inside the data store.
Definition at line 174 of file SmartRef.h.
| StreamBuffer & SmartRef< TYPE >::readRef | ( | StreamBuffer & | s ) | [inline] |
Read the reference from the stream buffer (needed due to stupid G++ compiler)
Definition at line 304 of file SmartRef.h.
{
m_target = dynamic_cast<TYPE*>( m_base.readObject(m_target, s) );
return s;
}
| void SmartRef< TYPE >::set | ( | DataObject * | pObj, |
| long | hint_id, | ||
| long | link_id | ||
| ) | [inline] |
Setup smart reference when reading. Must be allowed from external sources.
Definition at line 155 of file SmartRef.h.
| bool SmartRef< TYPE >::shouldFollowLink | ( | const ContainedObject * | ) | const [inline] |
| bool SmartRef< TYPE >::shouldFollowLink | ( | const DataObject * | ) | const [inline] |
| const TYPE * SmartRef< TYPE >::target | ( | ) | const [inline] |
| TYPE * SmartRef< TYPE >::target | ( | ) | [inline] |
Access to the object.
Definition at line 279 of file SmartRef.h.
| const std::type_info* SmartRef< TYPE >::type | ( | ) | const [inline] |
| StreamBuffer & SmartRef< TYPE >::writeRef | ( | StreamBuffer & | s ) | const [inline] |
Write the reference to the stream buffer (needed due to stupid G++ compiler)
Definition at line 297 of file SmartRef.h.
{
m_base.writeObject(m_target, s);
return s;
}
| StreamBuffer& operator<< | ( | StreamBuffer & | _s, |
| const SmartRef< TYPE > & | ptr | ||
| ) | [friend] |
| StreamBuffer& operator>> | ( | StreamBuffer & | _s, |
| SmartRef< TYPE > & | ptr | ||
| ) | [friend] |
friend class SmartRefArray< TYPE > [friend] |
The container must be a friend.
Definition at line 64 of file SmartRef.h.
friend class SmartRefList< TYPE > [friend] |
Definition at line 65 of file SmartRef.h.
friend class SmartRefMap< TYPE > [friend] |
Definition at line 66 of file SmartRef.h.
SmartRefBase SmartRef< TYPE >::m_base [protected] |
Definition at line 73 of file SmartRef.h.
Pointer to target data object.
Definition at line 75 of file SmartRef.h.