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  void reset(const EventContext& ctx) override;
41 
42  void addAlg(IAlgorithm* iAlg) override;
43  void addAlg(const Gaudi::StringKey& algName) override;
44 
45  const EventStatus::Status& eventStatus(const EventContext& ctx) const override;
46 
47  void setEventStatus(const EventStatus::Status& sc, const EventContext& ctx) override;
48 
49  void updateEventStatus(const bool& b, const EventContext& ctx) override;
50 
51  void dump(std::ostringstream& ost, const EventContext& ctx) const override;
52 
53 private:
54 
55  std::string trans(const EventStatus::Status& sc) const;
56 
57  // one vector entry per event slot
58  // typedef std::map<Gaudi::StringKey, AlgExecState> AlgStateMap_t;
60  AlgStates_t m_algStates;
61 
64 
65  void init();
66  void checkInit() const;
68  bool m_isInit;
69 
71 };
72 
73 #endif
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
void dump(std::ostringstream &ost, const EventContext &ctx) const override
std::vector< EventStatus::Status > m_eventStatus
void updateEventStatus(const bool &b, const EventContext &ctx) override
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
STL class.
void checkInit() const
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
const AlgStateMap_t & algExecStates(const EventContext &ctx) const override
std::mutex m_mut
void reset(const EventContext &ctx) override
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
const EventStatus::Status & eventStatus(const EventContext &ctx) const override
~AlgExecStateSvc()
Destructor.
AlgExecStateSvc(const std::string &name, ISvcLocator *svc)
Constructor.
virtual StatusCode initialize() override final
std::vector< AlgStateMap_t > AlgStates_t
void setEventStatus(const EventStatus::Status &sc, const EventContext &ctx) override
void addAlg(IAlgorithm *iAlg) override
std::vector< Gaudi::StringKey > m_preInitAlgs