| The Gaudi Framework v32r1 (f65d50dc)

IAlgContextSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_IALGCONTEXTSVC_H
2 #define GAUDIKERNEL_IALGCONTEXTSVC_H
3 // ============================================================================
4 // Include files:
5 // ============================================================================
6 // STD & STL
7 // ============================================================================
8 #include <vector>
9 // ============================================================================
10 // GaudiKernel
11 // ============================================================================
12 #include "GaudiKernel/EventContext.h"
13 #include "GaudiKernel/IAlgorithm.h"
14 #include "GaudiKernel/IInterface.h"
15 #include "GaudiKernel/SmartIF.h"
16 // ============================================================================
23 class GAUDI_API IAlgContextSvc : virtual public IInterface {
24 public:
26 DeclareInterfaceID( IAlgContextSvc, 4, 0 );
28 typedef std::vector<IAlgorithm*> Algorithms;
29
30 public:
32 virtual StatusCode setCurrentAlg( IAlgorithm* a, const EventContext& context ) = 0;
34 virtual StatusCode unSetCurrentAlg( IAlgorithm* a, const EventContext& context ) = 0;
36 virtual IAlgorithm* currentAlg() const = 0;
38 virtual const Algorithms& algorithms() const = 0;
39 };
40 // ============================================================================
41 namespace Gaudi {
42 namespace Utils {
74 class GAUDI_API AlgContext final {
75 public:
84 AlgContext( IAlgorithm* alg, IAlgContextSvc* svc, const EventContext& context );
85
93 AlgContext( IAlgorithm* alg, IAlgContextSvc* svc );
94
97 AlgContext( IAlgorithm* alg, IAlgContextSvc* svc, EventContext&& context ) = delete;
98
104 ~AlgContext();
105
106 private:
107 // copy constructor is disabled
108 AlgContext( const AlgContext& right ) = delete;
109 // assignement operator is disabled
110 AlgContext& operator=( const AlgContext& right ) = delete;
111
112 private:
113 SmartIF<IAlgContextSvc> m_svc;
114 SmartIF<IAlgorithm> m_alg;
115 const EventContext& m_context;
116 };
117 } // namespace Utils
118 } // end of namespace Gaudi
119
120 #endif
SmartIF< IAlgContextSvc >
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
Gaudi::Utils::AlgContext
Helper "sentry" class to automatize the safe register/unregister the algorithm's context.
Definition: IAlgContextSvc.h:74
IAlgorithm.h
EventContext.h
Gaudi::Utils::AlgContext::m_context
const EventContext & m_context
Definition: IAlgContextSvc.h:115
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:24
IAlgContextSvc::Algorithms
std::vector< IAlgorithm * > Algorithms
the actual type of algorithm' stack
Definition: IAlgContextSvc.h:28
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
IInterface
Definition of the basic interface.
Definition: IInterface.h:244
SmartIF.h
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
DeclareInterfaceID
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Definition: IInterface.h:13
std::vector< IAlgorithm * >
Gaudi::Utils::AlgContext::m_svc
SmartIF< IAlgContextSvc > m_svc
Definition: IAlgContextSvc.h:113
IAlgContextSvc
An abstract interface for Algorithm Context Service.
Definition: IAlgContextSvc.h:23
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
IInterface.h
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
Gaudi::Utils::AlgContext::m_alg
SmartIF< IAlgorithm > m_alg
Definition: IAlgContextSvc.h:114