IAlgContextSvc.h
Go to the documentation of this file.
1 // ============================================================================
2 #ifndef GAUDIKERNEL_IALGCONTEXTSVC_H
3 #define GAUDIKERNEL_IALGCONTEXTSVC_H
4 // ============================================================================
5 // Include files:
6 // ============================================================================
7 // STD & STL
8 // ============================================================================
9 #include <vector>
10 // ============================================================================
11 // GaudiKernel
12 // ============================================================================
13 #include "GaudiKernel/IInterface.h"
14 #include "GaudiKernel/SmartIF.h"
15 #include "GaudiKernel/IAlgorithm.h"
16 // ============================================================================
23 class GAUDI_API IAlgContextSvc: virtual public IInterface
24 {
25 public:
30 public:
32  virtual StatusCode setCurrentAlg ( IAlgorithm* a ) = 0 ;
34  virtual StatusCode unSetCurrentAlg ( IAlgorithm* a ) = 0 ;
36  virtual IAlgorithm* currentAlg () const = 0 ;
38  virtual const Algorithms& algorithms () const = 0 ;
39 protected:
41  ~IAlgContextSvc() override = default;
42 } ;
43 // ============================================================================
44 namespace Gaudi
45 {
46  namespace Utils
47  {
79  class GAUDI_API AlgContext final
80  {
81  public:
90  ( IAlgContextSvc* svc ,
91  IAlgorithm* alg ) ;
100  ( IAlgorithm* alg ,
101  IAlgContextSvc* svc ) ;
107  ~AlgContext() ;
108  private:
109  // default constructor is disabled
110  AlgContext() = delete;
111  // copy constructor is disabled
112  AlgContext ( const AlgContext& right ) = delete;
113  // assignement operator is disabled
114  AlgContext& operator=( const AlgContext& right ) = delete;
115  private:
118  };
119  } // end of namespace Gaudi::Utils
120 } // end of namespace Gaudi
121 // ============================================================================
122 // The END
123 // ============================================================================
124 #endif // GAUDIKERNEL_IALGCONTEXTSVC_H
125 // ============================================================================
Helper "sentry" class to automatize the safe register/unregister the algorithm's context.
std::vector< IAlgorithm * > Algorithms
the actual type of algorithm' stack
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Definition of the basic interface.
Definition: IInterface.h:234
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:25
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Definition: IInterface.h:14
SmartIF< IAlgContextSvc > m_svc
An abstract interface for Algorithm Context Service.
#define GAUDI_API
Definition: Kernel.h:107
Helper functions to set/get the application return code.
Definition: __init__.py:1
SmartIF< IAlgorithm > m_alg