The Gaudi Framework  master (37c0b60a)
DataObject.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #pragma once
12 
13 #include <GaudiKernel/ClassID.h>
14 #include <GaudiKernel/StatusCode.h>
15 #include <memory>
16 #include <ostream>
17 #include <string>
18 
19 // Forward declarations
20 class IOpaqueAddress;
21 class StreamBuffer;
22 class LinkManager;
23 class IRegistry;
24 
25 // Definition of the CLID for this class
26 static const CLID CLID_DataObject = 1;
27 
37 private:
39  unsigned long m_refCount = 0;
41  unsigned char m_version = 0;
43  IRegistry* m_pRegistry = nullptr;
46 
47 public:
49  DataObject();
51  DataObject( const DataObject& rhs );
53  DataObject& operator=( const DataObject& rhs );
55  DataObject( DataObject&& rhs );
57  DataObject& operator=( DataObject&& rhs );
59  virtual ~DataObject();
61  virtual unsigned long addRef();
63  virtual unsigned long release();
65  virtual const CLID& clID() const;
67  static const CLID& classID();
69  const std::string& name() const;
70 
72  virtual StatusCode update();
73 
75  void setRegistry( IRegistry* pRegistry ) { m_pRegistry = pRegistry; }
78  IRegistry* registry() const { return m_pRegistry; }
80  LinkManager* linkMgr() { return m_pLinkMgr.get(); }
81  const LinkManager* linkMgr() const { return m_pLinkMgr.get(); }
83  unsigned char version() const { return m_version; }
85  void setVersion( unsigned char vsn ) { m_version = vsn; }
87  unsigned long refCount() const { return m_refCount; }
89  virtual std::ostream& fillStream( std::ostream& s ) const;
91  friend std::ostream& operator<<( std::ostream& s, const DataObject& obj ) { return obj.fillStream( s ); }
92 };
93 
94 // Additional functions to support the Serialization of objects in the transient store
95 
96 namespace Gaudi {
100 } // namespace Gaudi
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:82
std::string
STL class.
DataObject::m_pLinkMgr
std::unique_ptr< LinkManager > m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:45
gaudirun.s
string s
Definition: gaudirun.py:346
IOpaqueAddress
Definition: IOpaqueAddress.h:33
ClassID.h
DataObject::setVersion
void setVersion(unsigned char vsn)
Set version number of this object representation.
Definition: DataObject.h:85
std::unique_ptr::get
T get(T... args)
Gaudi::popCurrentDataObject
GAUDI_API void popCurrentDataObject()
conf.release
string release
Definition: conf.py:27
IRegistry
Definition: IRegistry.h:32
StatusCode.h
Gaudi::getCurrentDataObject
GAUDI_API DataObject * getCurrentDataObject()
StreamBuffer
Definition: StreamBuffer.h:52
DataObject::linkMgr
const LinkManager * linkMgr() const
Definition: DataObject.h:81
StatusCode
Definition: StatusCode.h:65
DataObject::operator<<
friend std::ostream & operator<<(std::ostream &s, const DataObject &obj)
Output operator (ASCII)
Definition: DataObject.h:91
std::ostream
STL class.
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition: __init__.py:1
Gaudi::pushCurrentDataObject
GAUDI_API void pushCurrentDataObject(DataObject **pobjAddr)
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
DataObject::refCount
unsigned long refCount() const
Return the refcount.
Definition: DataObject.h:87
GaudiPython.Pythonizations.update
update
Definition: Pythonizations.py:145
DataObject::version
unsigned char version() const
Retrieve version number of this object representation.
Definition: DataObject.h:83
DataObject
Definition: DataObject.h:36
DataObject::linkMgr
LinkManager * linkMgr()
Retrieve Link manager.
Definition: DataObject.h:80
std::unique_ptr< LinkManager >
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:78
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
DataObject::fillStream
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: DataObject.cpp:77