| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

SmartRefBase.h
Go to the documentation of this file.
1 // ====================================================================
2 // SmartRefBase.h
3 // --------------------------------------------------------------------
4 //
5 // Package : Gaudi/Kernel
6 // Base class for SmartReference objects
7 //
8 // Author : Markus Frank
9 //
10 // ====================================================================
11 #ifndef KERNEL_SMARTREFBASE_H
12 #define KERNEL_SMARTREFBASE_H 1
13
14 // Framework include files
15 #include "GaudiKernel/StreamBuffer.h"
16
17 class ObjectContainerBase;
18 class SmartRefBase;
19 class ContainedObject;
20 class DataObject;
21
47 class GAUDI_API SmartRefBase
48 {
49 public:
51 mutable long m_hintID;
53 mutable long m_linkID;
55 mutable const DataObject* m_data;
57 mutable const ContainedObject* m_contd;
58
59 mutable long m_type;
60
61 enum { DATAOBJECT, CONTAINEDOBJECT };
62
64 const ContainedObject* accessData( const ContainedObject* typ ) const;
66 const DataObject* accessData( const DataObject* typ ) const;
67
69 bool isEqualEx( const DataObject* pObj, const SmartRefBase& c ) const;
71 bool isEqualEx( const ContainedObject* pObj, const SmartRefBase& c ) const;
73 bool isEqual( const ContainedObject* /* pObj */, const SmartRefBase& c ) const
74 {
75 return ( m_hintID == c.m_hintID && m_linkID == c.m_linkID && m_data == c.m_data && m_contd == c.m_contd );
76 }
78 bool isEqual( const DataObject* /* pObj */, const SmartRefBase& c ) const
79 {
80 return m_linkID == c.m_linkID && m_data == c.m_data;
81 }
83 void writeObject( const DataObject* pObject, StreamBuffer& s ) const { s.addIdentifiedLink( pObject, m_hintID ); }
85 void writeObject( const ContainedObject* pObject, StreamBuffer& s ) const
86 {
87 s.addContainedLink( pObject, m_hintID, m_linkID );
88 }
90 DataObject* readObject( const DataObject* /* pObject */, StreamBuffer& s ) const
91 {
92 DataObject* pObj = 0;
93 s.getIdentifiedLink( pObj, m_hintID );
94 return pObj;
95 }
97 ContainedObject* readObject( const ContainedObject* /* pObject */, StreamBuffer& s ) const
98 {
99 ContainedObject* pObj = 0;
100 s.getContainedLink( pObj, m_hintID, m_linkID );
101 return pObj;
102 }
103 void setObjectType( const ContainedObject* /* pobj */ ) const { m_type = CONTAINEDOBJECT; }
104 void setObjectType( const DataObject* /* pobj */ ) const { m_type = DATAOBJECT; }
105
107 const std::string& path() const;
108
109 public:
110 int objectType() const { return m_type; }
112 void set( DataObject* pObj, long hint_id, long link_id );
113 };
114 #endif // KERNEL_SMARTREFBASE_H
SmartRefBase::isEqual
bool isEqual(const ContainedObject *, const SmartRefBase &c) const
Equality operator for ContainedObject like references.
Definition: SmartRefBase.h:73
gaudirun.c
c
Definition: gaudirun.py:407
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
SmartRefBase::m_data
const DataObject * m_data
Object data: Pointer to the identifiable object the link originates.
Definition: SmartRefBase.h:55
StreamBuffer
The stream buffer is a small object collecting object data.
Definition: StreamBuffer.h:41
SmartRefBase::m_hintID
long m_hintID
Object data: ID of the link hint to the identifiable object.
Definition: SmartRefBase.h:51
SmartRefBase::readObject
ContainedObject * readObject(const ContainedObject *, StreamBuffer &s) const
Output streamer for ContainedObject like references.
Definition: SmartRefBase.h:97
SmartRefBase::writeObject
void writeObject(const DataObject *pObject, StreamBuffer &s) const
Output streamer for DataObject like references.
Definition: SmartRefBase.h:83
SmartRefBase::writeObject
void writeObject(const ContainedObject *pObject, StreamBuffer &s) const
Output streamer for ContainedObject like references.
Definition: SmartRefBase.h:85
SmartRefBase::setObjectType
void setObjectType(const ContainedObject *) const
Definition: SmartRefBase.h:103
SmartRefBase
User example objects: SmartRefBase.
Definition: SmartRefBase.h:47
StreamBuffer.h
std::string
STL class.
SmartRefBase::m_contd
const ContainedObject * m_contd
Object data: Pointer to the Contained object (if applicable)
Definition: SmartRefBase.h:57
SmartRefBase::DATAOBJECT
Definition: SmartRefBase.h:61
SmartRefBase::isEqual
bool isEqual(const DataObject *, const SmartRefBase &c) const
Equality operator for DataObject like references.
Definition: SmartRefBase.h:78
SmartRefBase::setObjectType
void setObjectType(const DataObject *) const
Definition: SmartRefBase.h:104
StreamBuffer::addIdentifiedLink
void addIdentifiedLink(const DataObject *pObject, long hint)
Definition: StreamBuffer.h:299
SmartRefBase::m_linkID
long m_linkID
Object data: ID of the object within the identifiable container (if any)
Definition: SmartRefBase.h:53
ContainedObject
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
Definition: ContainedObject.h:31
SmartRefBase::m_type
long m_type
Definition: SmartRefBase.h:59
gaudirun.s
string s
Definition: gaudirun.py:253
SmartRefBase::readObject
DataObject * readObject(const DataObject *, StreamBuffer &s) const
Input streamer for DataObject like references.
Definition: SmartRefBase.h:90
ObjectContainerBase
ObjectContainerBase is the base class for Gaudi container classes.
Definition: ObjectContainerBase.h:19
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
StreamBuffer::addContainedLink
void addContainedLink(const ContainedObject *pObject, long hint, long link)
Definition: StreamBuffer.h:312
SmartRefBase::objectType
int objectType() const
Definition: SmartRefBase.h:110
StreamBuffer::getContainedLink
void getContainedLink(ContainedObject *&pObject, long &hint, long &link)
Definition: StreamBuffer.h:304
StreamBuffer::getIdentifiedLink
void getIdentifiedLink(DataObject *&pObject, long &hint)
Definition: StreamBuffer.h:292