The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
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>
15#include <atomic>
16#include <memory>
17#include <ostream>
18#include <string>
19
20// Forward declarations
21class IOpaqueAddress;
22class StreamBuffer;
23class LinkManager;
24class IRegistry;
25
26// Definition of the CLID for this class
27static const CLID CLID_DataObject = 1;
28
38private:
40 std::atomic<unsigned long> m_refCount = 0;
42 unsigned char m_version = 0;
46 std::unique_ptr<LinkManager> m_pLinkMgr;
47
48public:
50 DataObject();
52 DataObject( const DataObject& rhs );
54 DataObject& operator=( const DataObject& rhs );
56 DataObject( 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
77 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
97namespace Gaudi {
101} // namespace Gaudi
unsigned int CLID
Class ID definition.
Definition ClassID.h:16
#define GAUDI_API
Definition Kernel.h:49
A DataObject is the base class of any identifiable object on any data store.
Definition DataObject.h:37
virtual unsigned long addRef()
Add reference to object.
std::atomic< unsigned long > m_refCount
Reference count.
Definition DataObject.h:40
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition DataObject.h:77
DataObject & operator=(const DataObject &rhs)
Assignment Operator.
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
IRegistry * m_pRegistry
Pointer to the Registry Object.
Definition DataObject.h:44
IRegistry * registry() const
Get pointer to Registry.
Definition DataObject.h:79
unsigned char version() const
Retrieve version number of this object representation.
Definition DataObject.h:84
friend std::ostream & operator<<(std::ostream &s, const DataObject &obj)
Output operator (ASCII)
Definition DataObject.h:92
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
LinkManager * linkMgr()
Retrieve Link manager.
Definition DataObject.h:81
std::unique_ptr< LinkManager > m_pLinkMgr
Store of symbolic links.
Definition DataObject.h:46
virtual const CLID & clID() const
Retrieve reference to class definition structure.
virtual StatusCode update()
Provide empty placeholder for internal object reconfiguration callback.
DataObject()
Standard Constructor.
unsigned long refCount() const
Return the refcount.
Definition DataObject.h:88
void setVersion(unsigned char vsn)
Set version number of this object representation.
Definition DataObject.h:86
const LinkManager * linkMgr() const
Definition DataObject.h:82
virtual unsigned long release()
release reference to object
static const CLID & classID()
Retrieve reference to class definition structure (static access)
unsigned char m_version
Version number.
Definition DataObject.h:42
Opaque address interface definition.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition IRegistry.h:29
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
The stream buffer is a small object collecting object data.
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1
GAUDI_API void pushCurrentDataObject(DataObject **pobjAddr)
GAUDI_API void popCurrentDataObject()
GAUDI_API DataObject * getCurrentDataObject()