| The Gaudi Framework v27r1

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

- File List
- File Members

DataObjectHandleBase.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_DATAOBJECTHANDLEBASE_H
2 #define GAUDIHIVE_DATAOBJECTHANDLEBASE_H
3
4 #include "GaudiKernel/DataHandle.h"
5 #include "GaudiKernel/SmartIF.h"
6 #include "GaudiKernel/IDataProviderSvc.h"
7 #include "GaudiKernel/IMessageSvc.h"
8
9 //---------------------------------------------------------------------------
10
22 //---------------------------------------------------------------------------
23
24 class DataObjectHandleBase : public Gaudi::DataHandle {
25
26 public:
27
28 DataObjectHandleBase();
29 DataObjectHandleBase(const DataObjID& k, Gaudi::DataHandle::Mode a,
30 IDataHandleHolder* o);
31 DataObjectHandleBase(const std::string& k, Gaudi::DataHandle::Mode a,
32 IDataHandleHolder* o);
33
34 virtual ~DataObjectHandleBase() {}
35
36
37 const std::string toString() const;
38 const std::string pythonRepr() const;
39 void fromString(const std::string& s);
40
41 friend std::ostream& operator<< (std::ostream& str, const DataObjectHandleBase& d);
42
43
45 bool isOptional() const {return m_optional;}
46 void setOptional(bool optional = true) { m_optional = optional; }
47
48 const std::vector<std::string> & alternativeDataProductNames() const {
49 return m_altNames; }
50 void setAlternativeDataProductNames(const std::vector<std::string> & alternativeAddresses) { m_altNames = alternativeAddresses; }
51
52 bool initialized() const { return m_init; }
53 bool wasRead() const { return m_wasRead; }
54 bool wasWritten() const { return m_wasWritten; }
55
56 bool isValid() const;
57
58 protected:
59 void setRead(bool wasRead=true) {m_wasRead = wasRead;}
60 void setWritten(bool wasWritten=true) {m_wasWritten = wasWritten;}
61
62 void init();
63
64 protected:
65
66 SmartIF<IDataProviderSvc> m_EDS;
67 SmartIF<IMessageSvc> m_MS;
68
69 bool m_init;
70 bool m_goodType;
71 bool m_optional;
72 bool m_wasRead, m_wasWritten;
73
74 std::vector<std::string> m_altNames;
75
76 };
77
78 //---------------------------------------------------------------------------
79 //---------------------------------------------------------------------------
80
81
82 namespace Gaudi {
83 namespace Parsers {
84 StatusCode parse(DataObjectHandleBase&, const std::string&);
85 }
86 namespace Utils {
87 GAUDI_API std::ostream& toStream(const DataObjectHandleBase& v, std::ostream& o);
88 }
89 }
90
91 #endif
DataObjectHandleBase::setWritten
void setWritten(bool wasWritten=true)
Definition: DataObjectHandleBase.h:60
SmartIF< IDataProviderSvc >
DataObjectHandleBase::pythonRepr
const std::string pythonRepr() const
Definition: DataObjectHandleBase.cpp:48
DataObjectHandleBase::m_wasRead
bool m_wasRead
Definition: DataObjectHandleBase.h:72
DataObjID
Definition: DataObjID.h:38
DataObjectHandleBase::wasRead
bool wasRead() const
Definition: DataObjectHandleBase.h:53
DataObjectHandleBase::m_EDS
SmartIF< IDataProviderSvc > m_EDS
Definition: DataObjectHandleBase.h:66
DataObjectHandleBase::m_init
bool m_init
Definition: DataObjectHandleBase.h:69
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:11
DataObjectHandleBase::wasWritten
bool wasWritten() const
Definition: DataObjectHandleBase.h:54
DataObjectHandleBase::setRead
void setRead(bool wasRead=true)
Definition: DataObjectHandleBase.h:59
DataObjectHandleBase::setOptional
void setOptional(bool optional=true)
Definition: DataObjectHandleBase.h:46
DataObjectHandleBase::m_optional
bool m_optional
Definition: DataObjectHandleBase.h:71
std::string
STL class.
IDataHandleHolder
Definition: IDataHandleHolder.h:17
Gaudi::Utils::toStream
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
Definition: ToStream.h:319
IDataProviderSvc.h
DataObjectHandleBase::m_goodType
bool m_goodType
Definition: DataObjectHandleBase.h:70
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
SmartIF.h
Gaudi::DataHandle
Definition: DataHandle.h:27
IMessageSvc.h
DataObjectHandleBase::fromString
void fromString(const std::string &s)
Definition: DataObjectHandleBase.cpp:54
DataObjectHandleBase::initialized
bool initialized() const
Definition: DataObjectHandleBase.h:52
DataObjectHandleBase::isValid
bool isValid() const
Definition: DataObjectHandleBase.cpp:93
std::vector< std::string >
DataObjectHandleBase
DataObjectHandleBase GaudiKernel/DataObjectHandleBase.h.
Definition: DataObjectHandleBase.h:24
DataObjectHandleBase::m_altNames
std::vector< std::string > m_altNames
Definition: DataObjectHandleBase.h:74
DataObjectHandleBase::toString
const std::string toString() const
Definition: DataObjectHandleBase.cpp:36
gaudirun.s
string s
Definition: gaudirun.py:245
DataObjectHandleBase::~DataObjectHandleBase
virtual ~DataObjectHandleBase()
Definition: DataObjectHandleBase.h:34
DataObjectHandleBase::m_MS
SmartIF< IMessageSvc > m_MS
Definition: DataObjectHandleBase.h:67
Gaudi::DataHandle::Mode
Mode
Definition: DataHandle.h:30
DataObjectHandleBase::isOptional
bool isOptional() const
Check if the data object declared is optional for the algorithm.
Definition: DataObjectHandleBase.h:45
DataHandle.h
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
std::ostream
STL class.
DataObjectHandleBase::operator<<
friend std::ostream & operator<<(std::ostream &str, const DataObjectHandleBase &d)
Definition: DataObjectHandleBase.cpp:102
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1
DataObjectHandleBase::alternativeDataProductNames
const std::vector< std::string > & alternativeDataProductNames() const
Definition: DataObjectHandleBase.h:48
DataObjectHandleBase::DataObjectHandleBase
DataObjectHandleBase()
Definition: DataObjectHandleBase.cpp:15
DataObjectHandleBase::init
void init()
Definition: DataObjectHandleBase.cpp:61
DataObjectHandleBase::m_wasWritten
bool m_wasWritten
Definition: DataObjectHandleBase.h:72
DataObjectHandleBase::setAlternativeDataProductNames
void setAlternativeDataProductNames(const std::vector< std::string > &alternativeAddresses)
Definition: DataObjectHandleBase.h:50