The Gaudi Framework  v29r0 (ff2e7097)
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 {
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
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"};
77 };
78 
79 // ============================================================================
80 // The END
81 // ============================================================================
82 #endif // GAUDISVC_ALGCONTEXTSVC_H
83 // ============================================================================
std::vector< int > m_inEvtLoop
Definition: AlgContextSvc.h:76
Implementation of property with value of concrete type.
Definition: Property.h:319
Gaudi::Property< bool > m_bypassInc
Definition: AlgContextSvc.h:74
void handle(const Incident &) override
handle incident
StatusCode start() override
SmartIF< IIncidentSvc > m_inc
pointer to Incident Service
Definition: AlgContextSvc.h:71
AlgContextSvc()=delete
StatusCode unSetCurrentAlg(IAlgorithm *a) override
remove the algorithm ("pop_back")
const IAlgContextSvc::Algorithms & algorithms() const override
get the stack of executed algorithms
Definition: AlgContextSvc.h:43
boost::thread_specific_ptr< IAlgContextSvc::Algorithms > m_algorithms
the stack of current algorithms
Definition: AlgContextSvc.h:69
IAlgorithm * currentAlg() const override
accessor to current algorithm:
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
~AlgContextSvc() override=default
Standard Destructor.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
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
StatusCode setCurrentAlg(IAlgorithm *a) override
set the currently executing algorithm ("push_back")
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23
Gaudi::Property< bool > m_check
Definition: AlgContextSvc.h:73