94 SmartRef(
long hint,
long link,
const TYPE* obj =
nullptr ) {
135 const std::type_info*
type()
const {
return &
typeid( TYPE ); }
147 return const_cast<TYPE*
>(
m_target );
156 if ( !
m_target && c.m_target )
return c.m_base.isEqualEx( c.m_target,
m_base );
165 explicit operator bool()
const {
return target() !=
nullptr; }
198 m_base.m_hintID = c.m_base.m_hintID;
199 m_base.m_linkID = c.m_base.m_linkID;
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
const ObjectContainerBase * parent() const
Access to parent object.
A DataObject is the base class of any identifiable object on any data store.
User example objects: SmartRefBase.
long m_linkID
Object data: ID of the object within the identifiable container (if any)
long m_hintID
Object data: ID of the link hint to the identifiable object.
const ContainedObject * m_contd
Object data: Pointer to the Contained object (if applicable)
const DataObject * m_data
Object data: Pointer to the identifiable object the link originates.
TYPE * target()
Access to the object.
SmartRef(long hint, long link, const TYPE *obj=nullptr)
Constructor.
SmartRef< TYPE > & _setEnvironment(const DataObject *pObj, const ContainedObject *pContd)
Set the environment (CONST)
TYPE & operator*()
Dereference operator.
SmartRef(const TYPE *pObject=nullptr)
Standard Constructor.
bool operator==(const SmartRef< TYPE > &c) const
Equality operator.
const TYPE * operator->() const
Dereference operator to const object.
const TYPE * target() const
Access to the object.
const TYPE * data() const
SmartRef(const DataObject *pObj, long hint, long link, const TYPE *obj=nullptr)
Constructor for references to contained objects passing environment.
StreamBuffer & readRef(StreamBuffer &s)
Read the reference from the stream buffer (needed due to stupid G++ compiler)
StreamBuffer & writeRef(StreamBuffer &s) const
Write the reference to the stream buffer (needed due to stupid G++ compiler)
bool operator==(SmartRef< TYPE > &rhs)
const std::type_info * type() const
Access to embedded type.
friend StreamBuffer & operator<<(StreamBuffer &_s, const SmartRef< TYPE > &ptr)
Output Streamer operator.
SmartRef< TYPE > & operator=(const SmartRef< TYPE > &c)
Assignment.
void set(DataObject *pObj, long hint_id, long link_id)
Setup smart reference when reading. Must be allowed from external sources.
const TYPE & operator*() const
Dereference operator.
bool shouldFollowLink(const DataObject *) const
Check if link should be followed: link must be valid and object not yet loaded.
SmartRef(const SmartRef ©)
Copy Constructor.
const SmartRef< TYPE > & operator()(const DataObject *pObj) const
operator() const: assigns parent object for serialisation
SmartRef(const DataObject *pObj, long hint, const TYPE *obj=nullptr)
Constructor for references to DataObjects passing environment.
SmartRef(const ContainedObject *pObj, long hint, long link, const TYPE *obj=nullptr)
Constructor for references to contained objects passing environment.
TYPE entry_type
Entry type definition.
const std::string & path() const
Return the path of the linked object inside the data store.
SmartRef< TYPE > & operator()(ContainedObject *pObj)
operator(): assigns parent object for serialisation
long hintID() const
Access hint id:
SmartRef< TYPE > & operator()(DataObject *pObj)
operator(): assigns parent object for serialisation
const TYPE * m_target
Pointer to target data object.
long linkID() const
Access link id:
friend bool operator==(SmartRef< TYPE > &lhs, TYPE *rhs)
bool shouldFollowLink(const ContainedObject *) const
Check if link should be followed: link must be valid and object not yet loaded.
const SmartRef< TYPE > & operator()(const ContainedObject *pObj) const
operator() const: assigns parent object for serialisation
const SmartRef< TYPE > & _setEnvironment(const DataObject *pObj, const ContainedObject *pContd) const
Set the environment (CONST)
friend bool operator==(const SmartRef< TYPE > &lhs, const TYPE *rhs)
friend StreamBuffer & operator>>(StreamBuffer &_s, SmartRef< TYPE > &ptr)
Input Streamer operator.
TYPE * data()
Access to raw data pointer.
SmartRef< TYPE > & operator=(const TYPE *pObject)
Assignment.
TYPE * operator->()
Dereference operator.
The stream buffer is a small object collecting object data.