AlgExecStateSvc.h
Go to the documentation of this file.
1 #ifndef GAUDICORESVC_ALGEXECSTATESVC_H
2 #define GAUDICORESVC_ALGEXECSTATESVC_H 1
3 
4 
5 #include "GaudiKernel/Service.h"
8 
9 
10 #include <vector>
11 #include <map>
12 #include <mutex>
13 
18 class AlgExecStateSvc: public extends<Service,
19  IAlgExecStateSvc> {
20 public:
23 
26 
27  virtual StatusCode initialize() override final;
28  virtual StatusCode finalize() override final;
29 
31 
32  const AlgExecState& algExecState(const Gaudi::StringKey& algName,
33  const EventContext& ctx) const override;
35  const EventContext& ctx) const override;
37  const EventContext& ctx) override;
38  const AlgStateMap_t& algExecStates(const EventContext& ctx) const override;
39 
40 
41  const AlgExecState& algExecState(const Gaudi::StringKey& algName) const override;
42  const AlgExecState& algExecState(IAlgorithm* iAlg) const override;
43  AlgExecState& algExecState(IAlgorithm* iAlg) override;
44  const AlgStateMap_t& algExecStates() const override;
45 
46 
47  void reset(const EventContext& ctx) override;
48  void reset() override;
49 
50  void addAlg(IAlgorithm* iAlg) override;
51  void addAlg(const Gaudi::StringKey& algName) override;
52 
53  const EventStatus::Status& eventStatus() const override;
54  const EventStatus::Status& eventStatus(const EventContext& ctx) const override;
55 
56  void setEventStatus(const EventStatus::Status& sc) override;
57  void setEventStatus(const EventStatus::Status& sc, const EventContext& ctx) override;
58 
59  void updateEventStatus(const bool& b) override;
60  void updateEventStatus(const bool& b, const EventContext& ctx) override;
61 
62  void dump(std::ostringstream& ost) const override;
63  void dump(std::ostringstream& ost, const EventContext& ctx) const override;
64 
65 private:
66 
67  std::string trans(const EventStatus::Status& sc) const;
68 
69  // one vector entry per event slot
70  // typedef std::map<Gaudi::StringKey, AlgExecState> AlgStateMap_t;
72  AlgStates_t m_algStates;
73 
76 
77  void init();
78  void checkInit() const;
80  bool m_isInit;
81 
83 };
84 
85 #endif
void reset() override
A service that keeps track of the execution state of Algorithm *.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
IAlgExecStateSvc::AlgStateMap_t AlgStateMap_t
virtual StatusCode finalize() override final
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
const AlgExecState & algExecState(const Gaudi::StringKey &algName, const EventContext &ctx) const override
AlgStates_t m_algStates
std::vector< EventStatus::Status > m_eventStatus
std::once_flag m_initFlag
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
void updateEventStatus(const bool &b) override
STL class.
void checkInit() const
void dump(std::ostringstream &ost) const override
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::string trans(const EventStatus::Status &sc) const
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:27
std::mutex m_mut
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
void setEventStatus(const EventStatus::Status &sc) override
~AlgExecStateSvc()
Destructor.
AlgExecStateSvc(const std::string &name, ISvcLocator *svc)
Constructor.
virtual StatusCode initialize() override final
std::vector< AlgStateMap_t > AlgStates_t
void addAlg(IAlgorithm *iAlg) override
std::vector< Gaudi::StringKey > m_preInitAlgs
const EventStatus::Status & eventStatus() const override
const AlgStateMap_t & algExecStates() const override