The Gaudi Framework
v33r0 (d5ea422b)
AlgExecStateSvc.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#ifndef GAUDICORESVC_ALGEXECSTATESVC_H
12
#define GAUDICORESVC_ALGEXECSTATESVC_H 1
13
14
#include "
GaudiKernel/IAlgExecStateSvc.h
"
15
#include "
GaudiKernel/IAlgorithm.h
"
16
#include "
GaudiKernel/Service.h
"
17
18
#include <map>
19
#include <mutex>
20
#include <vector>
21
26
class
AlgExecStateSvc
:
public
extends
<Service, IAlgExecStateSvc> {
27
public
:
28
using
extends::extends;
29
30
typedef
IAlgExecStateSvc::AlgStateMap_t
AlgStateMap_t
;
31
32
using
IAlgExecStateSvc::algExecState
;
33
const
AlgExecState
&
algExecState
(
const
Gaudi::StringKey
& algName,
const
EventContext
&
ctx
)
const override
;
34
AlgExecState
&
algExecState
(
IAlgorithm
* iAlg,
const
EventContext
&
ctx
)
override
;
35
const
AlgStateMap_t
&
algExecStates
(
const
EventContext
&
ctx
)
const override
;
36
37
void
reset
(
const
EventContext
&
ctx
)
override
;
38
39
using
IAlgExecStateSvc::addAlg
;
40
void
addAlg
(
const
Gaudi::StringKey
& algName )
override
;
41
42
const
EventStatus::Status
&
eventStatus
(
const
EventContext
&
ctx
)
const override
;
43
44
void
setEventStatus
(
const
EventStatus::Status
& sc,
const
EventContext
&
ctx
)
override
;
45
46
void
updateEventStatus
(
const
bool
& b,
const
EventContext
&
ctx
)
override
;
47
48
unsigned
int
algErrorCount
(
const
IAlgorithm
* iAlg )
const override
;
49
void
resetErrorCount
(
const
IAlgorithm
* iAlg )
override
;
50
unsigned
int
incrementErrorCount
(
const
IAlgorithm
* iAlg )
override
;
51
52
void
dump
(
std::ostringstream
& ost,
const
EventContext
&
ctx
)
const override
;
53
54
private
:
55
// one vector entry per event slot
56
std::vector<AlgStateMap_t>
m_algStates
;
57
58
std::vector<EventStatus::Status>
m_eventStatus
;
59
std::vector<Gaudi::StringKey>
m_preInitAlgs
;
60
61
std::map<Gaudi::StringKey, std::atomic<unsigned int>
>
m_errorCount
;
62
63
void
init
();
64
void
checkInit
()
const
;
65
std::once_flag
m_initFlag
;
66
bool
m_isInit
=
false
;
67
68
std::mutex
m_mut
;
69
};
70
71
#endif
AlgExecStateSvc::resetErrorCount
void resetErrorCount(const IAlgorithm *iAlg) override
Definition:
AlgExecStateSvc.cpp:207
AlgExecStateSvc
A service that keeps track of the execution state of Algorithm.
Definition:
AlgExecStateSvc.h:26
AlgExecStateSvc::AlgStateMap_t
IAlgExecStateSvc::AlgStateMap_t AlgStateMap_t
Definition:
AlgExecStateSvc.h:30
AlgExecStateSvc::m_algStates
std::vector< AlgStateMap_t > m_algStates
Definition:
AlgExecStateSvc.h:56
IAlgExecStateSvc.h
AlgExecStateSvc::algErrorCount
unsigned int algErrorCount(const IAlgorithm *iAlg) const override
Definition:
AlgExecStateSvc.cpp:194
AlgExecStateSvc::init
void init()
Definition:
AlgExecStateSvc.cpp:22
IAlgorithm.h
AlgExecStateSvc::m_errorCount
std::map< Gaudi::StringKey, std::atomic< unsigned int > > m_errorCount
Definition:
AlgExecStateSvc.h:61
GaudiPython.Pythonizations.ctx
ctx
Definition:
Pythonizations.py:566
AlgExecStateSvc::addAlg
void addAlg(const Gaudi::StringKey &algName) override
Definition:
AlgExecStateSvc.cpp:93
AlgExecStateSvc::updateEventStatus
void updateEventStatus(const bool &b, const EventContext &ctx) override
Definition:
AlgExecStateSvc.cpp:171
AlgExecStateSvc::m_initFlag
std::once_flag m_initFlag
Definition:
AlgExecStateSvc.h:65
AlgExecStateSvc::dump
void dump(std::ostringstream &ost, const EventContext &ctx) const override
Definition:
AlgExecStateSvc.cpp:79
std::once_flag
EventContext
This class represents an entry point to all the event specific data.
Definition:
EventContext.h:34
std::map
STL class.
AlgExecStateSvc::checkInit
void checkInit() const
Definition:
AlgExecStateSvc.cpp:69
Gaudi::StringKey
The helper class to represent the efficient "key" for access.
Definition:
StringKey.h:44
std::mutex
IAlgExecStateSvc::algExecState
virtual const AlgExecState & algExecState(const Gaudi::StringKey &algName, const EventContext &ctx) const =0
Service.h
AlgExecStateSvc::algExecState
const AlgExecState & algExecState(const Gaudi::StringKey &algName, const EventContext &ctx) const override
Definition:
AlgExecStateSvc.cpp:121
std::ostringstream
STL class.
AlgExecStateSvc::algExecStates
const AlgStateMap_t & algExecStates(const EventContext &ctx) const override
Definition:
AlgExecStateSvc.cpp:150
AlgExecStateSvc::incrementErrorCount
unsigned int incrementErrorCount(const IAlgorithm *iAlg) override
Definition:
AlgExecStateSvc.cpp:219
AlgExecStateSvc::m_preInitAlgs
std::vector< Gaudi::StringKey > m_preInitAlgs
Definition:
AlgExecStateSvc.h:59
EventStatus::Status
Status
Definition:
IAlgExecStateSvc.h:73
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition:
IAlgorithm.h:38
AlgExecStateSvc::m_isInit
bool m_isInit
Definition:
AlgExecStateSvc.h:66
AlgExecStateSvc::m_mut
std::mutex m_mut
Definition:
AlgExecStateSvc.h:68
AlgExecStateSvc::reset
void reset(const EventContext &ctx) override
Definition:
AlgExecStateSvc.cpp:183
std::vector
STL class.
extends
Base class used to extend a class implementing other interfaces.
Definition:
extends.h:20
AlgExecStateSvc::eventStatus
const EventStatus::Status & eventStatus(const EventContext &ctx) const override
Definition:
AlgExecStateSvc.cpp:157
AlgExecStateSvc::m_eventStatus
std::vector< EventStatus::Status > m_eventStatus
Definition:
AlgExecStateSvc.h:58
AlgExecStateSvc::setEventStatus
void setEventStatus(const EventStatus::Status &sc, const EventContext &ctx) override
Definition:
AlgExecStateSvc.cpp:164
AlgExecState
Definition:
IAlgExecStateSvc.h:37
IAlgExecStateSvc::addAlg
virtual void addAlg(const Gaudi::StringKey &algName)=0
GaudiCoreSvc
src
AlgExecStateSvc
AlgExecStateSvc.h
Generated on Mon Dec 16 2019 23:26:31 for The Gaudi Framework by
1.8.15