The Gaudi Framework  v30r3 (a5ef0a68)
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 <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 
31 {
32 private:
34  unsigned long m_refCount = 0;
36  unsigned char m_version = 0;
38  IRegistry* m_pRegistry = nullptr;
41 
42 public:
44  DataObject();
46  DataObject( const DataObject& rhs );
48  DataObject& operator=( const DataObject& rhs );
50  DataObject( DataObject&& rhs );
54  virtual ~DataObject();
56  virtual unsigned long addRef();
58  virtual unsigned long release();
60  virtual const CLID& clID() const;
62  static const CLID& classID();
64  const std::string& name() const;
65 
67  virtual StatusCode update();
68 
70  void setRegistry( IRegistry* pRegistry ) { m_pRegistry = pRegistry; }
73  IRegistry* registry() const { return m_pRegistry; }
75  LinkManager* linkMgr() const { return m_pLinkMgr.get(); }
77  unsigned char version() const { return m_version; }
79  void setVersion( unsigned char vsn ) { m_version = vsn; }
81  unsigned long refCount() const { return m_refCount; }
84  {
85  s << "DataObject at " << std::hex << this;
86  return s;
87  }
89  friend std::ostream& operator<<( std::ostream& s, const DataObject& obj ) { return obj.fillStream( s ); }
90 };
91 
92 // Additional functions to support the Serialization of objects in the transient store
93 
94 namespace Gaudi
95 {
96  GAUDI_API void pushCurrentDataObject( DataObject** pobjAddr );
99 }
100 
101 #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:73
LinkManager * linkMgr() const
Retrieve Link manager.
Definition: DataObject.h:75
PropertyMgr & operator=(const PropertyMgr &)=delete
STL class.
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: DataObject.h:83
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
unsigned long refCount() const
Return the refcount.
Definition: DataObject.h:81
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:77
T get(T...args)
friend std::ostream & operator<<(std::ostream &s, const DataObject &obj)
Output operator (ASCII)
Definition: DataObject.h:89
std::unique_ptr< LinkManager > m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:40
string s
Definition: gaudirun.py:253
T hex(T...args)
Opaque address interface definition.
#define GAUDI_API
Definition: Kernel.h:104
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
void setVersion(unsigned char vsn)
Set version number of this object representation.
Definition: DataObject.h:79