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 // GaudiKernel
8 // ============================================================================
9 #include "GaudiKernel/StatusCode.h"
10 #include "GaudiKernel/IAlgContextSvc.h"
11 #include "GaudiKernel/IAlgorithm.h"
12 #include "GaudiKernel/IIncidentListener.h"
13 #include "GaudiKernel/Service.h"
14 // ============================================================================
15 // Forward declarations
16 // ============================================================================
17 class IIncidentSvc ;
18 // ============================================================================
26 class AlgContextSvc: public extends2<Service, IAlgContextSvc, IIncidentListener>
27 {
28 public:
30  StatusCode setCurrentAlg ( IAlgorithm* a ) override ;
32  StatusCode unSetCurrentAlg ( IAlgorithm* a ) override ;
34  IAlgorithm* currentAlg () const override ;
36  const IAlgContextSvc::Algorithms& algorithms () const override
37  { return m_algorithms ; }
38 public:
40  void handle ( const Incident& ) override;
41 public:
43  StatusCode initialize () override;
45  StatusCode finalize () override;
46 public:
49  ( const std::string& name ,
50  ISvcLocator* svc ) ;
52  ~AlgContextSvc() override = default;
53 private:
54  // default/copy constructor & asignment are deleted
55  AlgContextSvc () = delete ;
56  AlgContextSvc ( const AlgContextSvc& ) = delete ;
57  AlgContextSvc& operator=( const AlgContextSvc& ) = delete;
58 private:
59  // the stack of current algorithms
61  // pointer to Incident Service
63  // flag to perform more checking
64  bool m_check = true ;
65 } ;
66 
67 // ============================================================================
68 // The END
69 // ============================================================================
70 #endif // GAUDISVC_ALGCONTEXTSVC_H
71 // ============================================================================
72 
IAlgContextSvc::Algorithms m_algorithms
the stack of current algorithms
Definition: AlgContextSvc.h:60
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
void handle(const Incident &) override
handle incident
SmartIF< IIncidentSvc > m_inc
pointer to Incident Service
Definition: AlgContextSvc.h:62
AlgContextSvc()=delete
StatusCode unSetCurrentAlg(IAlgorithm *a) override
remove the algorithm ("pop_back")
std::vector< IAlgorithm * > Algorithms
the actual type of algorithm' stack
const IAlgContextSvc::Algorithms & algorithms() const override
get the stack of executed algorithms
Definition: AlgContextSvc.h:36
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:19
~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:16
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")
IAlgorithm * currentAlg() const override
accessor to current algorithm:
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:21