All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
DataObject.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_DATAOBJECT_H
2 #define GAUDIKERNEL_DATAOBJECT_H
3 
4 // Framework include files
5 #include "GaudiKernel/ClassID.h"
7 
8 // STL includes
9 #include <string>
10 #include <ostream>
11 
12 // Forward declarations
13 class IOpaqueAddress;
14 class StreamBuffer;
15 class LinkManager;
16 class IRegistry;
17 
18 
19 // Definition of the CLID for this class
20 static const CLID CLID_DataObject = 1;
21 
31 private:
33  unsigned long m_refCount = 0;
35  unsigned char m_version = 0;
37  IRegistry* m_pRegistry = nullptr;
40 
41 public:
43  DataObject();
45  DataObject(const DataObject& rhs);
47  DataObject& operator=(const DataObject& rhs);
49  DataObject(DataObject&& rhs);
51  DataObject& operator=(DataObject&& rhs);
53  virtual ~DataObject();
55  virtual unsigned long addRef();
57  virtual unsigned long release();
59  virtual const CLID& clID() const;
61  static const CLID& classID();
63  const std::string& name() const;
64 
66  virtual StatusCode update();
67 
69  void setRegistry(IRegistry* pRegistry) {
71  m_pRegistry = pRegistry;
72  }
74  IRegistry* registry() const {
75  return m_pRegistry;
76  }
78  LinkManager* linkMgr() const {
79  return m_pLinkMgr.get();
80  }
82  unsigned char version() const {
83  return m_version;
84  }
86  void setVersion(unsigned char vsn) {
87  m_version = vsn;
88  }
90  unsigned long refCount() const {
91  return m_refCount;
92  }
94  virtual std::ostream& fillStream( std::ostream& s ) const {
95  s << "DataObject at " << std::hex << this;
96  return s;
97  }
99  friend std::ostream& operator<< ( std::ostream& s, const DataObject& obj ) {
100  return obj.fillStream(s);
101  }
102 };
103 
104 // Additional functions to support the Serialization of objects in the transient store
105 
106 namespace Gaudi
107 {
108  GAUDI_API void pushCurrentDataObject(DataObject** pobjAddr);
111 }
112 
113 
114 #endif // GAUDIKERNEL_DATAOBJECT_H
GAUDI_API void popCurrentDataObject()
The stream buffer is a small object collecting object data.
Definition: StreamBuffer.h:41
GAUDI_API DataObject * getCurrentDataObject()
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
LinkManager * linkMgr() const
Retrieve Link manager.
Definition: DataObject.h:78
STL class.
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: DataObject.h:94
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
unsigned long refCount() const
Return the refcount.
Definition: DataObject.h:90
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
GAUDI_API void pushCurrentDataObject(DataObject **pobjAddr)
unsigned char version() const
Retrieve version number of this object representation.
Definition: DataObject.h:82
T get(T...args)
std::unique_ptr< LinkManager > m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:39
def update
Definition: install.py:213
string s
Definition: gaudirun.py:245
T hex(T...args)
Opaque address interface definition.
#define GAUDI_API
Definition: Kernel.h:107
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STL class.
Helper functions to set/get the application return code.
Definition: __init__.py:1
std::ostream & operator<<(std::ostream &str, const GaudiAlg::ID &id)
Operator overloading for ostream.
Definition: GaudiHistoID.h:134
void setVersion(unsigned char vsn)
Set version number of this object representation.
Definition: DataObject.h:86