IAlgExecStateSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_IALGEXECSTATESVC_H
2 #define GAUDIKERNEL_IALGEXECSTATESVC_H 1
3 
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 
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; }
40  m_execStatus = sc; }
41 
42  void reset() {
43  m_filterPassed = true;
44  m_isExecuted = false;
46  }
47 
48 private:
49 
53 
54 };
55 
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 
76 
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 void dump(std::ostringstream& ost, const EventContext& ctx) const = 0;
102 
103 };
104 
105 #endif
void setExecStatus(const StatusCode &sc=StatusCode::SUCCESS)
#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
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
STL class.
The helper class to represent the efficient "key" for access.
Definition: StringKey.h:35
Abstract interface for a service that manages the Algorithm execution states.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Definition of the basic interface.
Definition: IInterface.h:234
bool isExecuted() const
void setExecuted(bool e=true)
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:27
string s
Definition: gaudirun.py:245
StatusCode m_execStatus
bool filterPassed() const
void setFilterPassed(bool f=true)
std::ostream & operator<<(std::ostream &ost, const AlgExecState &s)
#define GAUDI_API
Definition: Kernel.h:107
STL class.
std::map< Gaudi::StringKey, AlgExecState > AlgStateMap_t
const StatusCode & execStatus() const