Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
20 #ifndef KERNEL_SMARTREF_H
21 #define KERNEL_SMARTREF_H 1
110 m_target =
const_cast<TYPE*
>( pObject );
121 SmartRef(
long hint,
long link, TYPE* obj =
nullptr ) {
177 return const_cast<TYPE*
>(
m_target );
208 explicit operator bool()
const {
return target() !=
nullptr; }
282 #endif // KERNEL_SMARTREF_H
const SmartRef< TYPE > & operator()(const ContainedObject *pObj) const
operator() const: assigns parent object for serialisation
const TYPE * operator->() const
Dereference operator to const object.
SmartRef(const ContainedObject *pObj, long hint, long link, TYPE *obj=nullptr)
Constructor for references to contained objects passing environment.
friend bool operator!=(const SmartRef< TYPE > &ref, std::nullptr_t)
friend bool operator==(const SmartRef< TYPE > &ref, int)
SmartRef< TYPE > & operator()(ContainedObject *pObj)
operator(): assigns parent object for serialisation
SmartRef< TYPE > & operator=(TYPE *pObject)
Assignment.
const TYPE * m_target
Pointer to target data object.
SmartRef(long hint, long link, TYPE *obj=nullptr)
Constructor.
TYPE & operator*()
Dereference operator.
TYPE * operator->()
Dereference operator.
bool operator==(const SmartRef< TYPE > &c) const
Equality operator.
friend bool operator==(int, const SmartRef< TYPE > &ref)
Friend helper to check for object existence (will load object)
const TYPE * data() const
bool shouldFollowLink(const ContainedObject *) const
Check if link should be followed: link must be valid and object not yet loaded.
User example objects: SmartRefBase.
friend bool operator!=(int, const SmartRef< TYPE > &ref)
Friend helper to check for object existence (will load object)
long m_linkID
Object data: ID of the object within the identifiable container (if any)
StreamBuffer & readRef(StreamBuffer &s)
Read the reference from the stream buffer (needed due to stupid G++ compiler)
DataObject * readObject(const DataObject *, StreamBuffer &s) const
Input streamer for DataObject like references.
long hintID() const
Access hint id:
long linkID() const
Access link id:
SmartRef(TYPE *pObject)
Standard Constructor with initialisation.
void writeObject(const DataObject *pObject, StreamBuffer &s) const
Output streamer for DataObject like references.
const std::string & path() const
Return the path of the linked object inside the data store.
TYPE * target()
Access to the object.
friend bool operator!=(const SmartRef< TYPE > &ref, int)
friend StreamBuffer & operator>>(StreamBuffer &_s, SmartRef< TYPE > &ptr)
Input Streamer operator.
bool operator!=(const SmartRef< TYPE > &c) const
NON-Equality operator.
SmartRef< TYPE > & operator=(const SmartRef< TYPE > &c)
Assignment.
SmartRef(const TYPE *pObject)
Standard Constructor with initialisation from const object.
const SmartRef< TYPE > & operator()(const DataObject *pObj) const
operator() const: assigns parent object for serialisation
SmartRef(const DataObject *pObj, long hint, TYPE *obj=nullptr)
Constructor for references to DataObjects passing environment.
const std::string & path() const
Shortcut to access the path to the linked object.
const DataObject * m_data
Object data: Pointer to the identifiable object the link originates.
void set(DataObject *pObj, long hint_id, long link_id)
Setup smart reference when reading. Must be allowed from external sources.
SmartRef()
Standard Constructor.
TYPE entry_type
Entry type definition.
long m_hintID
Object data: ID of the link hint to the identifiable object.
bool shouldFollowLink(const DataObject *) const
Standard destructor.
void set(DataObject *pObj, long hint_id, long link_id)
Setup smart reference when reading. Must be allowed from external sources.
const ObjectContainerBase * parent() const
Access to parent object.
friend bool operator==(std::nullptr_t, const SmartRef< TYPE > &ref)
void setObjectType(const ContainedObject *) const
friend bool operator==(const SmartRef< TYPE > &ref, std::nullptr_t)
const SmartRef< TYPE > & _setEnvironment(const DataObject *pObj, const ContainedObject *pContd) const
Set the environment (CONST)
const TYPE & operator*() const
Dereference operator.
const ContainedObject * m_contd
Object data: Pointer to the Contained object (if applicable)
friend bool operator!=(std::nullptr_t, const SmartRef< TYPE > &ref)
SmartRef(const SmartRef ©)
Copy Constructor.
SmartRef< TYPE > & _setEnvironment(const DataObject *pObj, const ContainedObject *pContd)
Set the environment (CONST)
SmartRef(const DataObject *pObj, long hint, long link, TYPE *obj=nullptr)
Constructor for references to contained objects passing environment.
const ContainedObject * accessData(const ContainedObject *typ) const
Load on demand of ContainedObject like references.
StreamBuffer & writeRef(StreamBuffer &s) const
Write the reference to the stream buffer (needed due to stupid G++ compiler)
friend StreamBuffer & operator<<(StreamBuffer &_s, const SmartRef< TYPE > &ptr)
Output Streamer operator.
Kernel objects: SmartRef.
bool isEqualEx(const DataObject *pObj, const SmartRefBase &c) const
Extended equality check.
TYPE * data()
Access to raw data pointer.
SmartRef< TYPE > & operator()(DataObject *pObj)
operator(): assigns parent object for serialisation
bool isEqual(const ContainedObject *, const SmartRefBase &c) const
Equality operator for ContainedObject like references.
const TYPE * target() const
Access to the object.
const std::type_info * type() const
Access to embedded type.