| The Gaudi Framework v28r2p1 (f1a77ff4)

- 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/IAlgContextSvc.h"
10 #include "GaudiKernel/IAlgorithm.h"
11 #include "GaudiKernel/IIncidentListener.h"
12 #include "GaudiKernel/Service.h"
13 #include "GaudiKernel/StatusCode.h"
14 #include <boost/thread.hpp>
15 // ============================================================================
16 // Forward declarations
17 // ============================================================================
18 class IIncidentSvc;
19 // ============================================================================
28 class AlgContextSvc : public extends<Service, IAlgContextSvc, IIncidentListener>
29 {
30 public:
32 StatusCode setCurrentAlg( IAlgorithm* a ) override;
34 StatusCode unSetCurrentAlg( IAlgorithm* a ) override;
36 IAlgorithm* currentAlg() const override;
38 const IAlgContextSvc::Algorithms& algorithms() const override { return *m_algorithms; }
39 public:
41 void handle( const Incident& ) override;
42
43 public:
45 StatusCode initialize() override;
47 StatusCode finalize() override;
48
49 public:
50 using extends::extends;
52 ~AlgContextSvc() override = default;
53
54 private:
55 // default/copy constructor & asignment are deleted
56 AlgContextSvc() = delete;
57 AlgContextSvc( const AlgContextSvc& ) = delete;
58 AlgContextSvc& operator=( const AlgContextSvc& ) = delete;
59
60 private:
61 // the stack of current algorithms
62 boost::thread_specific_ptr<IAlgContextSvc::Algorithms> m_algorithms;
63 // pointer to Incident Service
64 SmartIF<IIncidentSvc> m_inc = nullptr;
65
66 Gaudi::Property<bool> m_check{this, "Check", true, "Flag to perform more checks"};
67 };
68
69 // ============================================================================
70 // The END
71 // ============================================================================
72 #endif // GAUDISVC_ALGCONTEXTSVC_H
73 // ============================================================================
SmartIF< IIncidentSvc >
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:314
AlgContextSvc::handle
void handle(const Incident &) override
handle incident
Definition: AlgContextSvc.cpp:133
IAlgorithm.h
AlgContextSvc::m_inc
SmartIF< IIncidentSvc > m_inc
pointer to Incident Service
Definition: AlgContextSvc.h:64
AlgContextSvc::AlgContextSvc
AlgContextSvc()=delete
AlgContextSvc::unSetCurrentAlg
StatusCode unSetCurrentAlg(IAlgorithm *a) override
remove the algorithm ("pop_back")
Definition: AlgContextSvc.cpp:99
AlgContextSvc::algorithms
const IAlgContextSvc::Algorithms & algorithms() const override
get the stack of executed algorithms
Definition: AlgContextSvc.h:38
AlgContextSvc
Definition: AlgContextSvc.h:28
AlgContextSvc::m_algorithms
boost::thread_specific_ptr< IAlgContextSvc::Algorithms > m_algorithms
the stack of current algorithms
Definition: AlgContextSvc.h:62
Service.h
AlgContextSvc::currentAlg
IAlgorithm * currentAlg() const override
accessor to current algorithm:
Definition: AlgContextSvc.cpp:124
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:27
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:28
AlgContextSvc::finalize
StatusCode finalize() override
standard finalization of the service
Definition: AlgContextSvc.cpp:61
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:80
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23
AlgContextSvc::m_check
Gaudi::Property< bool > m_check
Definition: AlgContextSvc.h:66