Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 // ============================================================================
12 #include "GaudiKernel/IAlgorithm.h"
14 #include "GaudiKernel/Service.h"
15 #include "GaudiKernel/StatusCode.h"
16 #include <boost/thread.hpp>
17 
18 // ============================================================================
19 // Forward declarations
20 // ============================================================================
22 // ============================================================================
33 class AlgContextSvc : public extends<Service, IAlgContextSvc, IIncidentListener> {
34 public:
36  StatusCode setCurrentAlg( IAlgorithm* a, const EventContext& context ) override;
38  StatusCode unSetCurrentAlg( IAlgorithm* a, const EventContext& context ) override;
40  IAlgorithm* currentAlg() const override;
42  const IAlgContextSvc::Algorithms& algorithms() const override { return *m_algorithms; }
43 
44 public:
46  void handle( const Incident& ) override;
47 
48 public:
50  StatusCode initialize() override;
51  StatusCode start() override;
53  StatusCode finalize() override;
54 
55 public:
56  using extends::extends;
57 
58 private:
59  // default/copy constructor & asignment are deleted
60  AlgContextSvc() = delete;
61  AlgContextSvc( const AlgContextSvc& ) = delete;
62  AlgContextSvc& operator=( const AlgContextSvc& ) = delete;
63 
64 private:
65  // the stack of current algorithms
66  boost::thread_specific_ptr<IAlgContextSvc::Algorithms> m_algorithms;
67  // pointer to Incident Service
69 
70  Gaudi::Property<bool> m_check{this, "Check", true, "Flag to perform more checks"};
71  Gaudi::Property<bool> m_bypassInc{this, "BypassIncidents", false,
72  "Flag to bypass begin/endevent incident requirement"};
74 };
75 
76 // ============================================================================
77 // The END
78 // ============================================================================
79 #endif // GAUDISVC_ALGCONTEXTSVC_H
std::vector< int > m_inEvtLoop
Definition: AlgContextSvc.h:73
Implementation of property with value of concrete type.
Definition: Property.h:352
Gaudi::Property< bool > m_bypassInc
Definition: AlgContextSvc.h:71
void handle(const Incident &) override
handle incident
StatusCode start() override
SmartIF< IIncidentSvc > m_inc
pointer to Incident Service
Definition: AlgContextSvc.h:68
AlgContextSvc()=delete
StatusCode setCurrentAlg(IAlgorithm *a, const EventContext &context) override
set the currently executing algorithm ("push_back")
const IAlgContextSvc::Algorithms & algorithms() const override
get the stack of executed algorithms
Definition: AlgContextSvc.h:42
This class represents an entry point to all the event specific data.
Definition: EventContext.h:31
boost::thread_specific_ptr< IAlgContextSvc::Algorithms > m_algorithms
the stack of current algorithms
Definition: AlgContextSvc.h:66
IAlgorithm * currentAlg() const override
accessor to current algorithm:
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
StatusCode unSetCurrentAlg(IAlgorithm *a, const EventContext &context) override
remove the algorithm ("pop_back")
Base class for all Incidents (computing events).
Definition: Incident.h:17
StatusCode initialize() override
standard initialization of the service
StatusCode finalize() override
standard finalization of the service
AlgContextSvc & operator=(const AlgContextSvc &)=delete
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23
Gaudi::Property< bool > m_check
Definition: AlgContextSvc.h:70