| The Gaudi Framework v27r1

- 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() : m_key("NONE"), m_owner(0), m_mode(Reader) {};
38 DataHandle(const DataObjID& k, Mode a=Reader,
39 IDataHandleHolder* owner=0):
40 m_key(k), m_owner(owner), m_mode(a){};
41
42 virtual ~DataHandle(){}
43
44 virtual void setOwner(IDataHandleHolder* o) { m_owner = o; }
45 virtual IDataHandleHolder* owner() const { return m_owner; }
46
47 virtual Mode mode() const { return m_mode; }
48
49 virtual void setKey(const DataObjID& key) { m_key = key; }
50 virtual void updateKey(const std::string& key) { m_key.updateKey(key); }
51
52 virtual const std::string& objKey() const { return m_key.key(); }
53 virtual const DataObjID& fullKey() const { return m_key; }
54
55 virtual void reset(bool) {};
56 virtual StatusCode commit() { return StatusCode::SUCCESS; }
57
58 virtual const std::string pythonRepr() const;
59
60 protected:
61 virtual void setMode(const Mode& mode) { m_mode = mode; }
62
63 DataObjID m_key;
64 IDataHandleHolder* m_owner;
65
66 private:
67 Mode m_mode;
68
69 };
70
71 }
72
73 #endif
Gaudi::DataHandle::setKey
virtual void setKey(const DataObjID &key)
Definition: DataHandle.h:49
Gaudi::DataHandle::reset
virtual void reset(bool)
Definition: DataHandle.h:55
Gaudi::DataHandle::setOwner
virtual void setOwner(IDataHandleHolder *o)
Definition: DataHandle.h:44
DataObjID
Definition: DataObjID.h:38
Gaudi::DataHandle::objKey
virtual const std::string & objKey() const
Definition: DataHandle.h:52
Gaudi::DataHandle::mode
virtual Mode mode() const
Definition: DataHandle.h:47
Gaudi::DataHandle::DataHandle
DataHandle()
Definition: DataHandle.h:37
DataObjID::updateKey
void updateKey(const std::string &key)
Definition: DataObjID.h:109
Gaudi::DataHandle::m_mode
Mode m_mode
Definition: DataHandle.h:67
Gaudi::DataHandle::Reader
Definition: DataHandle.h:31
Gaudi::DataHandle::~DataHandle
virtual ~DataHandle()
Definition: DataHandle.h:42
std::string
STL class.
Gaudi::DataHandle::fullKey
virtual const DataObjID & fullKey() const
Definition: DataHandle.h:53
IDataHandleHolder
Definition: IDataHandleHolder.h:17
Gaudi::DataHandle::m_key
DataObjID m_key
Definition: DataHandle.h:63
Gaudi::DataHandle::DataHandle
DataHandle(const DataObjID &k, Mode a=Reader, IDataHandleHolder *owner=0)
Definition: DataHandle.h:38
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:64
Gaudi::DataHandle
Definition: DataHandle.h:27
Gaudi::DataHandle::updateKey
virtual void updateKey(const std::string &key)
Definition: DataHandle.h:50
DataObjID.h
Gaudi::DataHandle::setMode
virtual void setMode(const Mode &mode)
Definition: DataHandle.h:61
Gaudi::DataHandle::commit
virtual StatusCode commit()
Definition: DataHandle.h:56
Gaudi::DataHandle::Writer
Definition: DataHandle.h:32
Gaudi::DataHandle::Updater
Definition: DataHandle.h:33
Gaudi::DataHandle::Mode
Mode
Definition: DataHandle.h:30
Gaudi::DataHandle::pythonRepr
virtual const std::string pythonRepr() const
Definition: DataHandle.cpp:10
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1
Gaudi::DataHandle::owner
virtual IDataHandleHolder * owner() const
Definition: DataHandle.h:45