| The Gaudi Framework v30r0 (c919700c)

- 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
28 class DataHandle
29 {
30 public:
31 enum Mode { Reader = 1 << 2, Writer = 1 << 4, Updater = Reader | Writer };
32
33 DataHandle( const DataObjID& k, Mode a = Reader, IDataHandleHolder* owner = nullptr )
34 : m_key( k ), m_owner( owner ), m_mode( a ){};
35
36 DataHandle( const DataObjID& k, const bool& isCond, Mode a = Reader, IDataHandleHolder* owner = nullptr )
37 : m_key( k ), m_owner( owner ), m_mode( a ), m_isCond( isCond ){};
38
39 virtual ~DataHandle() = default;
40
41 virtual void setOwner( IDataHandleHolder* o ) { m_owner = o; }
42 virtual IDataHandleHolder* owner() const { return m_owner; }
43
44 virtual Mode mode() const { return m_mode; }
45
46 virtual void setKey( const DataObjID& key ) const { m_key = key; }
47 virtual void updateKey( const std::string& key ) const { m_key.updateKey( key ); }
48
49 virtual const std::string& objKey() const { return m_key.key(); }
50 virtual const DataObjID& fullKey() const { return m_key; }
51
52 virtual void reset( bool ){};
53 virtual StatusCode commit() { return StatusCode::SUCCESS; }
54
55 virtual std::string pythonRepr() const;
56 virtual bool init() { return true; }
57
58 // is this a ConditionHandle?
59 virtual bool isCondition() const { return m_isCond; }
60
61 protected:
68 mutable DataObjID m_key = {"NONE"};
69 IDataHandleHolder* m_owner = nullptr;
70
71 private:
72 Mode m_mode = Reader;
73 bool m_isCond = false;
74 };
75 }
76
77 #endif
Gaudi::DataHandle::reset
virtual void reset(bool)
Definition: DataHandle.h:52
StatusCode::SUCCESS
Definition: StatusCode.h:29
Gaudi::DataHandle::DataHandle
DataHandle(const DataObjID &k, const bool &isCond, Mode a=Reader, IDataHandleHolder *owner=nullptr)
Definition: DataHandle.h:36
Gaudi::DataHandle::setOwner
virtual void setOwner(IDataHandleHolder *o)
Definition: DataHandle.h:41
DataObjID
Definition: DataObjID.h:37
Gaudi::DataHandle::objKey
virtual const std::string & objKey() const
Definition: DataHandle.h:49
Gaudi::DataHandle::mode
virtual Mode mode() const
Definition: DataHandle.h:44
Gaudi::DataHandle::~DataHandle
virtual ~DataHandle()=default
DataObjID::updateKey
void updateKey(const std::string &key)
Definition: DataObjID.h:98
Gaudi::DataHandle::m_mode
Mode m_mode
Definition: DataHandle.h:72
Gaudi::DataHandle::setKey
virtual void setKey(const DataObjID &key) const
Definition: DataHandle.h:46
Gaudi::DataHandle::Reader
Definition: DataHandle.h:31
std::string
STL class.
Gaudi::DataHandle::fullKey
virtual const DataObjID & fullKey() const
Definition: DataHandle.h:50
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:68
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:69
Gaudi::DataHandle
Definition: DataHandle.h:28
Gaudi::DataHandle::m_isCond
bool m_isCond
Definition: DataHandle.h:73
Gaudi::DataHandle::isCondition
virtual bool isCondition() const
Definition: DataHandle.h:59
DataObjID.h
Gaudi::DataHandle::DataHandle
DataHandle(const DataObjID &k, Mode a=Reader, IDataHandleHolder *owner=nullptr)
Definition: DataHandle.h:33
Gaudi::DataHandle::pythonRepr
virtual std::string pythonRepr() const
Definition: DataHandle.cpp:10
Gaudi::DataHandle::commit
virtual StatusCode commit()
Definition: DataHandle.h:53
Gaudi::DataHandle::Writer
Definition: DataHandle.h:31
Gaudi::DataHandle::Updater
Definition: DataHandle.h:31
Gaudi::DataHandle::Mode
Mode
Definition: DataHandle.h:31
Gaudi::DataHandle::init
virtual bool init()
Definition: DataHandle.h:56
Gaudi::DataHandle::updateKey
virtual void updateKey(const std::string &key) const
Definition: DataHandle.h:47
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1
Gaudi::DataHandle::owner
virtual IDataHandleHolder * owner() const
Definition: DataHandle.h:42