| The Gaudi Framework v32r1 (f65d50dc)

DataHandle.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_DATAHANDLE
2 #define GAUDIKERNEL_DATAHANDLE 1
3
4 #include "GaudiKernel/DataObjID.h"
5
6 //---------------------------------------------------------------------------
7
21 //---------------------------------------------------------------------------
22
23 class IDataHandleHolder;
24
25 namespace Gaudi {
26
27 class DataHandle {
28 public:
29 enum Mode { Reader = 1 << 2, Writer = 1 << 4, Updater = Reader | Writer };
30
31 DataHandle( const DataObjID& k, Mode a = Reader, IDataHandleHolder* owner = nullptr )
32 : m_key( k ), m_owner( owner ), m_mode( a ){};
33
34 DataHandle( const DataObjID& k, const bool& isCond, Mode a = Reader, IDataHandleHolder* owner = nullptr )
35 : m_key( k ), m_owner( owner ), m_mode( a ), m_isCond( isCond ){};
36
37 virtual ~DataHandle() = default;
38
39 virtual void setOwner( IDataHandleHolder* o ) { m_owner = o; }
40 virtual IDataHandleHolder* owner() const { return m_owner; }
41
42 virtual Mode mode() const { return m_mode; }
43
44 virtual void setKey( const DataObjID& key ) const { m_key = key; }
45 virtual void updateKey( const std::string& key ) const { m_key.updateKey( key ); }
46
47 virtual const std::string& objKey() const { return m_key.key(); }
48 virtual const DataObjID& fullKey() const { return m_key; }
49
50 virtual void reset( bool ){};
51
52 virtual std::string pythonRepr() const;
53 virtual bool init() { return true; }
54
55 // is this a ConditionHandle?
56 virtual bool isCondition() const { return m_isCond; }
57
58 protected:
65 mutable DataObjID m_key = {"NONE"};
66 IDataHandleHolder* m_owner = nullptr;
67
68 private:
69 Mode m_mode = Reader;
70 bool m_isCond = false;
71 };
72 } // namespace Gaudi
73
74 #endif
Gaudi::DataHandle::mode
virtual Mode mode() const
Definition: DataHandle.h:42
Gaudi::DataHandle::reset
virtual void reset(bool)
Definition: DataHandle.h:50
Gaudi::DataHandle::DataHandle
DataHandle(const DataObjID &k, const bool &isCond, Mode a=Reader, IDataHandleHolder *owner=nullptr)
Definition: DataHandle.h:34
Gaudi::DataHandle::isCondition
virtual bool isCondition() const
Definition: DataHandle.h:56
Gaudi::DataHandle::setOwner
virtual void setOwner(IDataHandleHolder *o)
Definition: DataHandle.h:39
DataObjID
Definition: DataObjID.h:37
Gaudi::DataHandle::owner
virtual IDataHandleHolder * owner() const
Definition: DataHandle.h:40
Gaudi::DataHandle::~DataHandle
virtual ~DataHandle()=default
Gaudi::DataHandle::objKey
virtual const std::string & objKey() const
Definition: DataHandle.h:47
Gaudi::DataHandle::pythonRepr
virtual std::string pythonRepr() const
Definition: DataHandle.cpp:9
DataObjID::updateKey
void updateKey(const std::string &key)
Definition: DataObjID.h:93
Gaudi::DataHandle::updateKey
virtual void updateKey(const std::string &key) const
Definition: DataHandle.h:45
Gaudi::DataHandle::setKey
virtual void setKey(const DataObjID &key) const
Definition: DataHandle.h:44
Gaudi::DataHandle::m_mode
Mode m_mode
Definition: DataHandle.h:69
Gaudi::DataHandle::Reader
Definition: DataHandle.h:29
std::string
STL class.
IDataHandleHolder
Definition: IDataHandleHolder.h:14
Gaudi::DataHandle::m_key
DataObjID m_key
The key of the object behind this DataHandle Although it may look strange to have it mutable,...
Definition: DataHandle.h:65
Gaudi::DataHandle::fullKey
virtual const DataObjID & fullKey() const
Definition: DataHandle.h:48
Gaudi::DataHandle::m_owner
IDataHandleHolder * m_owner
Definition: DataHandle.h:66
Gaudi::DataHandle
Definition: DataHandle.h:27
Gaudi::DataHandle::m_isCond
bool m_isCond
Definition: DataHandle.h:70
DataObjID.h
DataObjID::key
const std::string & key() const
Definition: DataObjID.h:48
Gaudi::DataHandle::DataHandle
DataHandle(const DataObjID &k, Mode a=Reader, IDataHandleHolder *owner=nullptr)
Definition: DataHandle.h:31
Gaudi::DataHandle::Writer
Definition: DataHandle.h:29
Gaudi::DataHandle::Updater
Definition: DataHandle.h:29
Gaudi::DataHandle::Mode
Mode
Definition: DataHandle.h:29
Gaudi::DataHandle::init
virtual bool init()
Definition: DataHandle.h:53
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1