Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (d98a2936)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
DataObject.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 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 <atomic>
16 #include <memory>
17 #include <ostream>
18 #include <string>
19 
20 // Forward declarations
21 class IOpaqueAddress;
22 class StreamBuffer;
23 class LinkManager;
24 class IRegistry;
25 
26 // Definition of the CLID for this class
27 static const CLID CLID_DataObject = 1;
28 
38 private:
40  std::atomic<unsigned long> m_refCount = 0;
42  unsigned char m_version = 0;
44  IRegistry* m_pRegistry = nullptr;
46  std::unique_ptr<LinkManager> m_pLinkMgr;
47 
48 public:
50  DataObject();
52  DataObject( const DataObject& rhs );
54  DataObject& operator=( const DataObject& rhs );
56  DataObject( DataObject&& rhs );
58  DataObject& operator=( DataObject&& rhs );
60  virtual ~DataObject();
62  virtual unsigned long addRef();
64  virtual unsigned long release();
66  virtual const CLID& clID() const;
68  static const CLID& classID();
70  const std::string& name() const;
71 
73  virtual StatusCode update();
74 
76  void setRegistry( IRegistry* pRegistry ) { m_pRegistry = pRegistry; }
79  IRegistry* registry() const { return m_pRegistry; }
81  LinkManager* linkMgr() { return m_pLinkMgr.get(); }
82  const LinkManager* linkMgr() const { return m_pLinkMgr.get(); }
84  unsigned char version() const { return m_version; }
86  void setVersion( unsigned char vsn ) { m_version = vsn; }
88  unsigned long refCount() const { return m_refCount; }
90  virtual std::ostream& fillStream( std::ostream& s ) const;
92  friend std::ostream& operator<<( std::ostream& s, const DataObject& obj ) { return obj.fillStream( s ); }
93 };
94 
95 // Additional functions to support the Serialization of objects in the transient store
96 
97 namespace Gaudi {
101 } // namespace Gaudi
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:82
DataObject::m_pLinkMgr
std::unique_ptr< LinkManager > m_pLinkMgr
Store of symbolic links.
Definition: DataObject.h:46
gaudirun.s
string s
Definition: gaudirun.py:346
IOpaqueAddress
Definition: IOpaqueAddress.h:28
ClassID.h
DataObject::setVersion
void setVersion(unsigned char vsn)
Set version number of this object representation.
Definition: DataObject.h:86
Gaudi::popCurrentDataObject
GAUDI_API void popCurrentDataObject()
conf.release
string release
Definition: conf.py:27
IRegistry
Definition: IRegistry.h:29
StatusCode.h
Gaudi::getCurrentDataObject
GAUDI_API DataObject * getCurrentDataObject()
StreamBuffer
Definition: StreamBuffer.h:48
DataObject::linkMgr
const LinkManager * linkMgr() const
Definition: DataObject.h:82
StatusCode
Definition: StatusCode.h:64
DataObject::operator<<
friend std::ostream & operator<<(std::ostream &s, const DataObject &obj)
Output operator (ASCII)
Definition: DataObject.h:92
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:16
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:88
GaudiPython.Pythonizations.update
update
Definition: Pythonizations.py:145
DataObject::version
unsigned char version() const
Retrieve version number of this object representation.
Definition: DataObject.h:84
DataObject
Definition: DataObject.h:37
DataObject::linkMgr
LinkManager * linkMgr()
Retrieve Link manager.
Definition: DataObject.h:81
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:79
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:49
DataObject::fillStream
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: DataObject.cpp:77