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