| The Gaudi Framework v27r1

- 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 // 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 #include <boost/thread.hpp>
15 // ============================================================================
16 // Forward declarations
17 // ============================================================================
18 class IIncidentSvc;
19 // ============================================================================
28 class AlgContextSvc: public extends<Service,
29 IAlgContextSvc,
30 IIncidentListener>
31 {
32 public:
34 StatusCode setCurrentAlg ( IAlgorithm* a ) override ;
36 StatusCode unSetCurrentAlg ( IAlgorithm* a ) override ;
38 IAlgorithm* currentAlg () const override ;
40 const IAlgContextSvc::Algorithms& algorithms () const override
41 { return *m_algorithms ; }
42 public:
44 void handle ( const Incident& ) override;
45 public:
47 StatusCode initialize () override;
49 StatusCode finalize () override;
50 public:
52 AlgContextSvc
53 ( const std::string& name ,
54 ISvcLocator* svc ) ;
56 ~AlgContextSvc() override = default;
57 private:
58 // default/copy constructor & asignment are deleted
59 AlgContextSvc () = delete ;
60 AlgContextSvc ( const AlgContextSvc& ) = delete ;
61 AlgContextSvc& operator=( const AlgContextSvc& ) = delete;
62 private:
63 // the stack of current algorithms
64 boost::thread_specific_ptr<IAlgContextSvc::Algorithms> m_algorithms;
65 // pointer to Incident Service
66 SmartIF<IIncidentSvc> m_inc = nullptr ;
67 // flag to perform more checking
68 bool m_check = true ;
69 } ;
70
71 // ============================================================================
72 // The END
73 // ============================================================================
74 #endif // GAUDISVC_ALGCONTEXTSVC_H
75 // ============================================================================
76
SmartIF< IIncidentSvc >
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
AlgContextSvc::handle
void handle(const Incident &) override
handle incident
Definition: AlgContextSvc.cpp:143
IAlgorithm.h
AlgContextSvc::m_inc
SmartIF< IIncidentSvc > m_inc
pointer to Incident Service
Definition: AlgContextSvc.h:66
AlgContextSvc::AlgContextSvc
AlgContextSvc()=delete
AlgContextSvc::unSetCurrentAlg
StatusCode unSetCurrentAlg(IAlgorithm *a) override
remove the algorithm ("pop_back")
Definition: AlgContextSvc.cpp:109
AlgContextSvc
Definition: AlgContextSvc.h:28
AlgContextSvc::m_algorithms
boost::thread_specific_ptr< IAlgContextSvc::Algorithms > m_algorithms
the stack of current algorithms
Definition: AlgContextSvc.h:64
std::string
STL class.
Service.h
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
AlgContextSvc::m_check
bool m_check
Definition: AlgContextSvc.h:68
AlgContextSvc::algorithms
const IAlgContextSvc::Algorithms & algorithms() const override
get the stack of executed algorithms
Definition: AlgContextSvc.h:40
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:25
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:38
AlgContextSvc::finalize
StatusCode finalize() override
standard finalization of the service
Definition: AlgContextSvc.cpp:71
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:90
AlgContextSvc::currentAlg
IAlgorithm * currentAlg() const override
accessor to current algorithm:
Definition: AlgContextSvc.cpp:134
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:21