| The Gaudi Framework v28r2-patches (bc4ad17a)

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

- File List
- File Members

IAlgExecStateSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_IALGEXECSTATESVC_H
2 #define GAUDIKERNEL_IALGEXECSTATESVC_H 1
3
4 #include "GaudiKernel/IInterface.h"
5 #include "GaudiKernel/StatusCode.h"
6 #include "GaudiKernel/StringKey.h"
7 #include <string>
8 #include <sstream>
9 #include <map>
10
11 class IAlgorithm;
12 class EventContext;
13
14 //-----------------------------------------------------------------------------
15
25 //-----------------------------------------------------------------------------
26
27 class AlgExecState {
28 public:
29
30 AlgExecState() : m_filterPassed(true), m_isExecuted(false),
31 m_execStatus(StatusCode(StatusCode::FAILURE,true)) {}
32
33 bool filterPassed() const { return m_filterPassed; }
34 bool isExecuted() const { return m_isExecuted; }
35 const StatusCode& execStatus() const { return m_execStatus; }
36
37 void setFilterPassed(bool f = true) { m_filterPassed = f; }
38 void setExecuted(bool e = true) { m_isExecuted = e; }
39 void setExecStatus(const StatusCode& sc = StatusCode::SUCCESS) {
40 m_execStatus = sc; }
41
42 void reset() {
43 m_filterPassed = true;
44 m_isExecuted = false;
45 m_execStatus = StatusCode(StatusCode::FAILURE,true);
46 }
47
48 private:
49
50 bool m_filterPassed;
51 bool m_isExecuted;
52 StatusCode m_execStatus;
53
54 };
55
56 inline std::ostream& operator<< (std::ostream& ost, const AlgExecState& s) {
57 return ost << "e: " << s.isExecuted() << " f: " << s.filterPassed()
58 << " sc: " << s.execStatus();
59 }
60
61 namespace EventStatus {
62 enum Status {
63 Invalid = 0,
64 Success = 1,
65 AlgFail = 2,
66 AlgStall = 3,
67 Other = 4
68 };
69 }
70
71 class GAUDI_API IAlgExecStateSvc : virtual public IInterface {
72 public:
73
75 DeclareInterfaceID(IAlgExecStateSvc,1,0);
76
77 typedef std::map<Gaudi::StringKey, AlgExecState> AlgStateMap_t;
78
79 // get the Algorithm Execution State for a give Algorithm and EventContext
80 virtual const AlgExecState& algExecState(const Gaudi::StringKey& algName,
81 const EventContext& ctx) const = 0;
82 virtual const AlgExecState& algExecState(IAlgorithm* iAlg,
83 const EventContext& ctx) const = 0;
84 virtual AlgExecState& algExecState(IAlgorithm* iAlg,
85 const EventContext& ctx) = 0;
86
87 // get all the Algorithm Execution States for a given EventContext
88 virtual const AlgStateMap_t& algExecStates(const EventContext& ctx) const = 0;
89
90 virtual void reset(const EventContext& ctx) = 0;
91
92 virtual void addAlg(IAlgorithm* iAlg) = 0;
93 virtual void addAlg(const Gaudi::StringKey& algName) = 0;
94
95 virtual const EventStatus::Status& eventStatus(const EventContext& ctx) const = 0;
96
97 virtual void setEventStatus(const EventStatus::Status& sc, const EventContext& ctx) = 0;
98
99 virtual void updateEventStatus(const bool& b, const EventContext& ctx) = 0;
100
101 virtual unsigned int algErrorCount(const IAlgorithm* iAlg) const = 0;
102 virtual void resetErrorCount(const IAlgorithm* iAlg) = 0;
103 virtual unsigned int incrementErrorCount(const IAlgorithm* iAlg) = 0;
104
105 virtual void dump(std::ostringstream& ost, const EventContext& ctx) const = 0;
106
107 };
108
109 #endif
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29
AlgExecState::AlgExecState
AlgExecState()
Definition: IAlgExecStateSvc.h:30
EventStatus
Definition: IAlgExecStateSvc.h:61
AlgExecState::setExecStatus
void setExecStatus(const StatusCode &sc=StatusCode::SUCCESS)
Definition: IAlgExecStateSvc.h:39
DeclareInterfaceID
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Definition: IInterface.h:14
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
std::map
STL class.
EventStatus::Other
Definition: IAlgExecStateSvc.h:67
Gaudi::StringKey
The helper class to represent the efficient "key" for access.
Definition: StringKey.h:35
AlgExecState::m_filterPassed
bool m_filterPassed
Definition: IAlgExecStateSvc.h:50
GaudiPython.Bindings.FAILURE
FAILURE
Definition: Bindings.py:53
IAlgExecStateSvc
Abstract interface for a service that manages the Algorithm execution states.
Definition: IAlgExecStateSvc.h:71
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::ostringstream
STL class.
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
EventStatus::AlgStall
Definition: IAlgExecStateSvc.h:66
EventStatus::Invalid
Definition: IAlgExecStateSvc.h:63
AlgExecState::isExecuted
bool isExecuted() const
Definition: IAlgExecStateSvc.h:34
StringKey.h
EventStatus::Success
Definition: IAlgExecStateSvc.h:64
AlgExecState::setExecuted
void setExecuted(bool e=true)
Definition: IAlgExecStateSvc.h:38
EventStatus::AlgFail
Definition: IAlgExecStateSvc.h:65
EventStatus::Status
Status
Definition: IAlgExecStateSvc.h:62
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:27
AlgExecState::m_isExecuted
bool m_isExecuted
Definition: IAlgExecStateSvc.h:51
gaudirun.s
string s
Definition: gaudirun.py:245
AlgExecState::m_execStatus
StatusCode m_execStatus
Definition: IAlgExecStateSvc.h:52
StatusCode.h
AlgExecState::filterPassed
bool filterPassed() const
Definition: IAlgExecStateSvc.h:33
AlgExecState::setFilterPassed
void setFilterPassed(bool f=true)
Definition: IAlgExecStateSvc.h:37
operator<<
std::ostream & operator<<(std::ostream &ost, const AlgExecState &s)
Definition: IAlgExecStateSvc.h:56
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
IInterface.h
AlgExecState
Definition: IAlgExecStateSvc.h:27
std::ostream
STL class.
AlgExecState::reset
void reset()
Definition: IAlgExecStateSvc.h:42
IAlgExecStateSvc::AlgStateMap_t
std::map< Gaudi::StringKey, AlgExecState > AlgStateMap_t
Definition: IAlgExecStateSvc.h:77
AlgExecState::execStatus
const StatusCode & execStatus() const
Definition: IAlgExecStateSvc.h:35