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 } ;
40 // ============================================================================
41 namespace Gaudi
42 {
43  namespace Utils
44  {
76  class GAUDI_API AlgContext final
77  {
78  public:
87  ( IAlgContextSvc* svc ,
88  IAlgorithm* alg ) ;
97  ( IAlgorithm* alg ,
98  IAlgContextSvc* svc ) ;
104  ~AlgContext() ;
105  private:
106  // default constructor is disabled
107  AlgContext() = delete;
108  // copy constructor is disabled
109  AlgContext ( const AlgContext& right ) = delete;
110  // assignement operator is disabled
111  AlgContext& operator=( const AlgContext& right ) = delete;
112  private:
115  };
116  } // end of namespace Gaudi::Utils
117 } // end of namespace Gaudi
118 // ============================================================================
119 // The END
120 // ============================================================================
121 #endif // GAUDIKERNEL_IALGCONTEXTSVC_H
122 // ============================================================================
Helper "sentry" class to automatize the safe register/unregister the algorithm&#39;s context.
#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
PropertyMgr & operator=(const PropertyMgr &)=delete
std::vector< IAlgorithm * > Algorithms
the actual type of algorithm&#39; 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:27
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