| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
30 enum Mode {
31 Reader = 1<<2,
32 Writer = 1<<4,
33 Updater = Reader | Writer
34 };
35
36
37 DataHandle(const DataObjID& k, Mode a=Reader,
38 IDataHandleHolder* owner=nullptr):
39 m_key(k), m_owner(owner), m_mode(a) {};
40
41 DataHandle(const DataObjID& k, const bool& isCond, Mode a=Reader,
42 IDataHandleHolder* owner=nullptr):
43 m_key(k), m_owner(owner), m_mode(a), m_isCond(isCond) {};
44
45
46 virtual ~DataHandle() = default;
47
48 virtual void setOwner(IDataHandleHolder* o) { m_owner = o; }
49 virtual IDataHandleHolder* owner() const { return m_owner; }
50
51 virtual Mode mode() const { return m_mode; }
52
53 virtual void setKey(const DataObjID& key) const { m_key = key; }
54 virtual void updateKey(const std::string& key) const { m_key.updateKey(key); }
55
56 virtual const std::string& objKey() const { return m_key.key(); }
57 virtual const DataObjID& fullKey() const { return m_key; }
58
59 virtual void reset(bool) {};
60 virtual StatusCode commit() { return StatusCode::SUCCESS; }
61
62 virtual std::string pythonRepr() const;
63 virtual bool init() { return true; }
64
65 // is this a ConditionHandle?
66 virtual bool isCondition() const { return m_isCond; }
67
68 protected:
69
76 mutable DataObjID m_key = { "NONE" };
77 IDataHandleHolder* m_owner = nullptr;
78
79 private:
80 Mode m_mode = Reader;
81 bool m_isCond = false;
82
83 };
84
85 }
86
87 #endif
Gaudi::DataHandle::reset
virtual void reset(bool)
Definition: DataHandle.h:59
StatusCode::SUCCESS
Definition: StatusCode.h:30
Gaudi::DataHandle::DataHandle
DataHandle(const DataObjID &k, const bool &isCond, Mode a=Reader, IDataHandleHolder *owner=nullptr)
Definition: DataHandle.h:41
Gaudi::DataHandle::setOwner
virtual void setOwner(IDataHandleHolder *o)
Definition: DataHandle.h:48
DataObjID
Definition: DataObjID.h:38
Gaudi::DataHandle::objKey
virtual const std::string & objKey() const
Definition: DataHandle.h:56
Gaudi::DataHandle::mode
virtual Mode mode() const
Definition: DataHandle.h:51
Gaudi::DataHandle::~DataHandle
virtual ~DataHandle()=default
DataObjID::updateKey
void updateKey(const std::string &key)
Definition: DataObjID.h:109
Gaudi::DataHandle::m_mode
Mode m_mode
Definition: DataHandle.h:80
Gaudi::DataHandle::setKey
virtual void setKey(const DataObjID &key) const
Definition: DataHandle.h:53
Gaudi::DataHandle::Reader
Definition: DataHandle.h:31
std::string
STL class.
Gaudi::DataHandle::fullKey
virtual const DataObjID & fullKey() const
Definition: DataHandle.h:57
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:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObjID::key
const std::string & key() const
Definition: DataObjID.h:49
Gaudi::DataHandle::m_owner
IDataHandleHolder * m_owner
Definition: DataHandle.h:77
Gaudi::DataHandle
Definition: DataHandle.h:27
Gaudi::DataHandle::m_isCond
bool m_isCond
Definition: DataHandle.h:81
Gaudi::DataHandle::isCondition
virtual bool isCondition() const
Definition: DataHandle.h:66
DataObjID.h
Gaudi::DataHandle::DataHandle
DataHandle(const DataObjID &k, Mode a=Reader, IDataHandleHolder *owner=nullptr)
Definition: DataHandle.h:37
Gaudi::DataHandle::pythonRepr
virtual std::string pythonRepr() const
Definition: DataHandle.cpp:10
Gaudi::DataHandle::commit
virtual StatusCode commit()
Definition: DataHandle.h:60
Gaudi::DataHandle::Writer
Definition: DataHandle.h:32
Gaudi::DataHandle::Updater
Definition: DataHandle.h:33
Gaudi::DataHandle::Mode
Mode
Definition: DataHandle.h:30
Gaudi::DataHandle::init
virtual bool init()
Definition: DataHandle.h:63
Gaudi::DataHandle::updateKey
virtual void updateKey(const std::string &key) const
Definition: DataHandle.h:54
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1
Gaudi::DataHandle::owner
virtual IDataHandleHolder * owner() const
Definition: DataHandle.h:49