| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

AlgContextSvc.h
Go to the documentation of this file.
1 // ============================================================================
2 #ifndef GAUDISVC_ALGCONTEXTSVC_H
3 #define GAUDISVC_ALGCONTEXTSVC_H 1
4 // ============================================================================
5 // Include files
6 // ============================================================================
7 #include <vector>
8 // ============================================================================
9 // GaudiKernel
10 // ============================================================================
11 #include "GaudiKernel/IAlgContextSvc.h"
12 #include "GaudiKernel/IAlgorithm.h"
13 #include "GaudiKernel/IIncidentListener.h"
14 #include "GaudiKernel/Service.h"
15 #include "GaudiKernel/StatusCode.h"
16 #include <boost/thread.hpp>
17
18 // ============================================================================
19 // Forward declarations
20 // ============================================================================
21 class IIncidentSvc;
22 // ============================================================================
33 class AlgContextSvc : public extends<Service, IAlgContextSvc, IIncidentListener>
34 {
35 public:
37 StatusCode setCurrentAlg( IAlgorithm* a ) override;
39 StatusCode unSetCurrentAlg( IAlgorithm* a ) override;
41 IAlgorithm* currentAlg() const override;
43 const IAlgContextSvc::Algorithms& algorithms() const override { return *m_algorithms; }
44
45 public:
47 void handle( const Incident& ) override;
48
49 public:
51 StatusCode initialize() override;
52 StatusCode start() override;
54 StatusCode finalize() override;
55
56 public:
57 using extends::extends;
59 ~AlgContextSvc() override = default;
60
61 private:
62 // default/copy constructor & asignment are deleted
63 AlgContextSvc() = delete;
64 AlgContextSvc( const AlgContextSvc& ) = delete;
65 AlgContextSvc& operator=( const AlgContextSvc& ) = delete;
66
67 private:
68 // the stack of current algorithms
69 boost::thread_specific_ptr<IAlgContextSvc::Algorithms> m_algorithms;
70 // pointer to Incident Service
71 SmartIF<IIncidentSvc> m_inc = nullptr;
72
73 Gaudi::Property<bool> m_check{this, "Check", true, "Flag to perform more checks"};
74 Gaudi::Property<bool> m_bypassInc{this, "BypassIncidents", false,
75 "Flag to bypass begin/endevent incident requirement"};
76 std::vector<int> m_inEvtLoop;
77 };
78
79 // ============================================================================
80 // The END
81 // ============================================================================
82 #endif // GAUDISVC_ALGCONTEXTSVC_H
83 // ============================================================================
SmartIF< IIncidentSvc >
AlgContextSvc::m_inEvtLoop
std::vector< int > m_inEvtLoop
Definition: AlgContextSvc.h:76
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
AlgContextSvc::m_bypassInc
Gaudi::Property< bool > m_bypassInc
Definition: AlgContextSvc.h:74
AlgContextSvc::handle
void handle(const Incident &) override
handle incident
Definition: AlgContextSvc.cpp:170
IAlgorithm.h
AlgContextSvc::start
StatusCode start() override
Definition: AlgContextSvc.cpp:72
AlgContextSvc::m_inc
SmartIF< IIncidentSvc > m_inc
pointer to Incident Service
Definition: AlgContextSvc.h:71
AlgContextSvc::AlgContextSvc
AlgContextSvc()=delete
AlgContextSvc::unSetCurrentAlg
StatusCode unSetCurrentAlg(IAlgorithm *a) override
remove the algorithm ("pop_back")
Definition: AlgContextSvc.cpp:128
AlgContextSvc::algorithms
const IAlgContextSvc::Algorithms & algorithms() const override
get the stack of executed algorithms
Definition: AlgContextSvc.h:43
AlgContextSvc
Definition: AlgContextSvc.h:33
AlgContextSvc::m_algorithms
boost::thread_specific_ptr< IAlgContextSvc::Algorithms > m_algorithms
the stack of current algorithms
Definition: AlgContextSvc.h:69
Service.h
AlgContextSvc::currentAlg
IAlgorithm * currentAlg() const override
accessor to current algorithm:
Definition: AlgContextSvc.cpp:163
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
AlgContextSvc::~AlgContextSvc
~AlgContextSvc() override=default
Standard Destructor.
IAlgContextSvc.h
std::vector< IAlgorithm * >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Incident
Base class for all Incidents (computing events).
Definition: Incident.h:17
IIncidentListener.h
AlgContextSvc::initialize
StatusCode initialize() override
standard initialization of the service
Definition: AlgContextSvc.cpp:31
AlgContextSvc::finalize
StatusCode finalize() override
standard finalization of the service
Definition: AlgContextSvc.cpp:89
AlgContextSvc::operator=
AlgContextSvc & operator=(const AlgContextSvc &)=delete
StatusCode.h
AlgContextSvc::setCurrentAlg
StatusCode setCurrentAlg(IAlgorithm *a) override
set the currently executing algorithm ("push_back")
Definition: AlgContextSvc.cpp:105
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23
AlgContextSvc::m_check
Gaudi::Property< bool > m_check
Definition: AlgContextSvc.h:73