The Gaudi Framework  v30r3 (a5ef0a68)
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;
58 
59 private:
60  // default/copy constructor & asignment are deleted
61  AlgContextSvc() = delete;
62  AlgContextSvc( const AlgContextSvc& ) = delete;
63  AlgContextSvc& operator=( const AlgContextSvc& ) = delete;
64 
65 private:
66  // the stack of current algorithms
67  boost::thread_specific_ptr<IAlgContextSvc::Algorithms> m_algorithms;
68  // pointer to Incident Service
70 
71  Gaudi::Property<bool> m_check{this, "Check", true, "Flag to perform more checks"};
72  Gaudi::Property<bool> m_bypassInc{this, "BypassIncidents", false,
73  "Flag to bypass begin/endevent incident requirement"};
75 };
76 
77 // ============================================================================
78 // The END
79 // ============================================================================
80 #endif // GAUDISVC_ALGCONTEXTSVC_H
81 // ============================================================================
std::vector< int > m_inEvtLoop
Definition: AlgContextSvc.h:74
Implementation of property with value of concrete type.
Definition: Property.h:381
Gaudi::Property< bool > m_bypassInc
Definition: AlgContextSvc.h:72
void handle(const Incident &) override
handle incident
StatusCode start() override
SmartIF< IIncidentSvc > m_inc
pointer to Incident Service
Definition: AlgContextSvc.h:69
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:67
IAlgorithm * currentAlg() const override
accessor to current algorithm:
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
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
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:71