The Gaudi Framework  v33r1 (b1225454)
IAlgContextSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIKERNEL_IALGCONTEXTSVC_H
12 #define GAUDIKERNEL_IALGCONTEXTSVC_H
13 // ============================================================================
14 // Include files:
15 // ============================================================================
16 // STD & STL
17 // ============================================================================
18 #include <vector>
19 // ============================================================================
20 // GaudiKernel
21 // ============================================================================
23 #include "GaudiKernel/IAlgorithm.h"
24 #include "GaudiKernel/IInterface.h"
25 #include "GaudiKernel/SmartIF.h"
26 // ============================================================================
33 class GAUDI_API IAlgContextSvc : virtual public IInterface {
34 public:
39 
40 public:
42  virtual StatusCode setCurrentAlg( IAlgorithm* a, const EventContext& context ) = 0;
44  virtual StatusCode unSetCurrentAlg( IAlgorithm* a, const EventContext& context ) = 0;
46  virtual IAlgorithm* currentAlg() const = 0;
48  virtual const Algorithms& algorithms() const = 0;
49 };
50 // ============================================================================
51 namespace Gaudi {
52  namespace Utils {
84  class GAUDI_API AlgContext final {
85  public:
94  AlgContext( IAlgorithm* alg, IAlgContextSvc* svc, const EventContext& context );
95 
104 
107  AlgContext( IAlgorithm* alg, IAlgContextSvc* svc, EventContext&& context ) = delete;
108 
114  ~AlgContext();
115 
116  private:
117  // copy constructor is disabled
118  AlgContext( const AlgContext& right ) = delete;
119  // assignement operator is disabled
120  AlgContext& operator=( const AlgContext& right ) = delete;
121 
122  private:
126  };
127  } // namespace Utils
128 } // end of namespace Gaudi
129 
130 #endif
Helper "sentry" class to automatize the safe register/unregister the algorithm's context.
const EventContext & m_context
This class represents an entry point to all the event specific data.
Definition: EventContext.h:34
std::vector< IAlgorithm * > Algorithms
the actual type of algorithm' stack
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
Definition of the basic interface.
Definition: IInterface.h:254
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:38
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Definition: IInterface.h:23
SmartIF< IAlgContextSvc > m_svc
An abstract interface for Algorithm Context Service.
#define GAUDI_API
Definition: Kernel.h:81
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
SmartIF< IAlgorithm > m_alg