The Gaudi Framework  v30r3 (a5ef0a68)
AlgExecStateSvc.h
Go to the documentation of this file.
1 #ifndef GAUDICORESVC_ALGEXECSTATESVC_H
2 #define GAUDICORESVC_ALGEXECSTATESVC_H 1
3 
6 #include "GaudiKernel/Service.h"
7 
8 #include <map>
9 #include <mutex>
10 #include <vector>
11 
16 class AlgExecStateSvc : public extends<Service, IAlgExecStateSvc>
17 {
18 public:
19  using extends::extends;
20 
22 
23  const AlgExecState& algExecState( const Gaudi::StringKey& algName, const EventContext& ctx ) const override;
24  const AlgExecState& algExecState( IAlgorithm* iAlg, const EventContext& ctx ) const override;
25  AlgExecState& algExecState( IAlgorithm* iAlg, const EventContext& ctx ) override;
26  const AlgStateMap_t& algExecStates( const EventContext& ctx ) const override;
27 
28  void reset( const EventContext& ctx ) override;
29 
30  void addAlg( IAlgorithm* iAlg ) override;
31  void addAlg( const Gaudi::StringKey& algName ) override;
32 
33  const EventStatus::Status& eventStatus( const EventContext& ctx ) const override;
34 
35  void setEventStatus( const EventStatus::Status& sc, const EventContext& ctx ) override;
36 
37  void updateEventStatus( const bool& b, const EventContext& ctx ) override;
38 
39  unsigned int algErrorCount( const IAlgorithm* iAlg ) const override;
40  void resetErrorCount( const IAlgorithm* iAlg ) override;
41  unsigned int incrementErrorCount( const IAlgorithm* iAlg ) override;
42 
43  void dump( std::ostringstream& ost, const EventContext& ctx ) const override;
44 
45 private:
46  // one vector entry per event slot
48 
51 
53 
54  void init();
55  void checkInit() const;
57  bool m_isInit = false;
58 
60 };
61 
62 #endif
void resetErrorCount(const IAlgorithm *iAlg) override
A service that keeps track of the execution state of Algorithm.
IAlgExecStateSvc::AlgStateMap_t AlgStateMap_t
std::vector< AlgStateMap_t > m_algStates
const AlgExecState & algExecState(const Gaudi::StringKey &algName, const EventContext &ctx) const override
std::map< Gaudi::StringKey, std::atomic< unsigned int > > m_errorCount
void dump(std::ostringstream &ost, const EventContext &ctx) const override
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:24
STL class.
The helper class to represent the efficient "key" for access.
Definition: StringKey.h:35
void checkInit() const
unsigned int incrementErrorCount(const IAlgorithm *iAlg) override
std::vector< Gaudi::StringKey > m_preInitAlgs
unsigned int algErrorCount(const IAlgorithm *iAlg) const override
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
const AlgStateMap_t & algExecStates(const EventContext &ctx) const override
std::mutex m_mut
void reset(const EventContext &ctx) override
STL class.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
const EventStatus::Status & eventStatus(const EventContext &ctx) const override
std::vector< EventStatus::Status > m_eventStatus
void setEventStatus(const EventStatus::Status &sc, const EventContext &ctx) override
void addAlg(IAlgorithm *iAlg) override