Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
DataHandle.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_DATAHANDLE
2 #define GAUDIKERNEL_DATAHANDLE 1
3 
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"};
67 
68  private:
70  bool m_isCond = false;
71  };
72 } // namespace Gaudi
73 
74 #endif
virtual void reset(bool)
Definition: DataHandle.h:50
DataHandle(const DataObjID &k, const bool &isCond, Mode a=Reader, IDataHandleHolder *owner=nullptr)
Definition: DataHandle.h:34
virtual void setOwner(IDataHandleHolder *o)
Definition: DataHandle.h:39
virtual const std::string & objKey() const
Definition: DataHandle.h:47
virtual Mode mode() const
Definition: DataHandle.h:42
virtual ~DataHandle()=default
void updateKey(const std::string &key)
Definition: DataObjID.h:93
virtual void setKey(const DataObjID &key) const
Definition: DataHandle.h:44
STL class.
virtual const DataObjID & fullKey() const
Definition: DataHandle.h:48
DataObjID m_key
The key of the object behind this DataHandle Although it may look strange to have it mutable...
Definition: DataHandle.h:65
const std::string & key() const
Definition: DataObjID.h:48
IDataHandleHolder * m_owner
Definition: DataHandle.h:66
virtual bool isCondition() const
Definition: DataHandle.h:56
DataHandle(const DataObjID &k, Mode a=Reader, IDataHandleHolder *owner=nullptr)
Definition: DataHandle.h:31
virtual std::string pythonRepr() const
Definition: DataHandle.cpp:9
virtual bool init()
Definition: DataHandle.h:53
virtual void updateKey(const std::string &key) const
Definition: DataHandle.h:45
Helper functions to set/get the application return code.
Definition: __init__.py:1
virtual IDataHandleHolder * owner() const
Definition: DataHandle.h:40