| The Gaudi Framework v32r1 (f65d50dc)

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"
6 #include "GaudiKernel/StatusCode.h"
7
8 // STL includes
9 #include <memory>
10 #include <ostream>
11 #include <string>
12
13 // Forward declarations
14 class IOpaqueAddress;
15 class StreamBuffer;
16 class LinkManager;
17 class IRegistry;
18
19 // Definition of the CLID for this class
20 static const CLID CLID_DataObject = 1;
21
30 class GAUDI_API DataObject {
31 private:
33 unsigned long m_refCount = 0;
35 unsigned char m_version = 0;
37 IRegistry* m_pRegistry = nullptr;
39 std::unique_ptr<LinkManager> m_pLinkMgr;
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 ) { m_pRegistry = pRegistry; }
72 IRegistry* registry() const { return m_pRegistry; }
74 LinkManager* linkMgr() const { return m_pLinkMgr.get(); }
76 unsigned char version() const { return m_version; }
78 void setVersion( unsigned char vsn ) { m_version = vsn; }
80 unsigned long refCount() const { return m_refCount; }
82 virtual std::ostream& fillStream( std::ostream& s ) const {
83 s << "DataObject at " << std::hex << this;
84 return s;
85 }
87 friend std::ostream& operator<<( std::ostream& s, const DataObject& obj ) { return obj.fillStream( s ); }
88 };
89
90 // Additional functions to support the Serialization of objects in the transient store
91
92 namespace Gaudi {
93 GAUDI_API void pushCurrentDataObject( DataObject** pobjAddr );
94 GAUDI_API void popCurrentDataObject();
95 GAUDI_API DataObject* getCurrentDataObject();
96 } // namespace Gaudi
97
98 #endif // GAUDIKERNEL_DATAOBJECT_H
ClassID.h
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Gaudi::popCurrentDataObject
GAUDI_API void popCurrentDataObject()
Definition: RootIOHandler.cpp:38
StreamBuffer
The stream buffer is a small object collecting object data.
Definition: StreamBuffer.h:41
Gaudi::getCurrentDataObject
GAUDI_API DataObject * getCurrentDataObject()
DataObject::linkMgr
LinkManager * linkMgr() const
Retrieve Link manager.
Definition: DataObject.h:74
DataObject::fillStream
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: DataObject.h:82
DataObject::version
unsigned char version() const
Retrieve version number of this object representation.
Definition: DataObject.h:76
DataObject::refCount
unsigned long refCount() const
Return the refcount.
Definition: DataObject.h:80
std::string
STL class.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
Gaudi::pushCurrentDataObject
GAUDI_API void pushCurrentDataObject(DataObject **pobjAddr)
Definition: RootIOHandler.cpp:34
std::unique_ptr::get
T get(T... args)
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:55
DataObject::operator<<
friend std::ostream & operator<<(std::ostream &s, const DataObject &obj)
Output operator (ASCII)
Definition: DataObject.h:87
DataObject::m_pLinkMgr
std::unique_ptr< LinkManager > m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:39
std::unique_ptr< LinkManager >
gaudirun.s
string s
Definition: gaudirun.py:316
std::hex
T hex(T... args)
StatusCode.h
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
std::ostream
STL class.
LinkManager
A LinkManager is the object aggregated into a DataObject, which is responsible for the handling of no...
Definition: LinkManager.h:21
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
GaudiPython.Pythonizations.update
update
Definition: Pythonizations.py:119
DataObject::setVersion
void setVersion(unsigned char vsn)
Set version number of this object representation.
Definition: DataObject.h:78