File indexing completed on 2025-01-30 10:07:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef GAUDIKERNEL_DATAOBJECT_H
0012 #define GAUDIKERNEL_DATAOBJECT_H
0013
0014
0015 #include "GaudiKernel/ClassID.h"
0016 #include "GaudiKernel/StatusCode.h"
0017
0018
0019 #include <memory>
0020 #include <ostream>
0021 #include <string>
0022
0023
0024 class IOpaqueAddress;
0025 class StreamBuffer;
0026 class LinkManager;
0027 class IRegistry;
0028
0029
0030 static const CLID CLID_DataObject = 1;
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 class GAUDI_API DataObject {
0041 private:
0042
0043 unsigned long m_refCount = 0;
0044
0045 unsigned char m_version = 0;
0046
0047 IRegistry* m_pRegistry = nullptr;
0048
0049 std::unique_ptr<LinkManager> m_pLinkMgr;
0050
0051 public:
0052
0053 DataObject();
0054
0055 DataObject( const DataObject& rhs );
0056
0057 DataObject& operator=( const DataObject& rhs );
0058
0059 DataObject( DataObject&& rhs );
0060
0061 DataObject& operator=( DataObject&& rhs );
0062
0063 virtual ~DataObject();
0064
0065 virtual unsigned long addRef();
0066
0067 virtual unsigned long release();
0068
0069 virtual const CLID& clID() const;
0070
0071 static const CLID& classID();
0072
0073 const std::string& name() const;
0074
0075
0076 virtual StatusCode update();
0077
0078
0079
0080 void setRegistry( IRegistry* pRegistry ) { m_pRegistry = pRegistry; }
0081
0082 IRegistry* registry() const { return m_pRegistry; }
0083
0084 LinkManager* linkMgr() { return m_pLinkMgr.get(); }
0085 const LinkManager* linkMgr() const { return m_pLinkMgr.get(); }
0086
0087 unsigned char version() const { return m_version; }
0088
0089 void setVersion( unsigned char vsn ) { m_version = vsn; }
0090
0091 unsigned long refCount() const { return m_refCount; }
0092
0093 virtual std::ostream& fillStream( std::ostream& s ) const {
0094 s << "DataObject at " << std::hex << this << std::dec;
0095 return s;
0096 }
0097
0098 friend std::ostream& operator<<( std::ostream& s, const DataObject& obj ) { return obj.fillStream( s ); }
0099 };
0100
0101
0102
0103 namespace Gaudi {
0104 GAUDI_API void pushCurrentDataObject( DataObject** pobjAddr );
0105 GAUDI_API void popCurrentDataObject();
0106 GAUDI_API DataObject* getCurrentDataObject();
0107 }
0108
0109 #endif