The Gaudi Framework  master (37c0b60a)
IAlgContextSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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
Gaudi::Utils::AlgContext::m_alg
SmartIF< IAlgorithm > m_alg
Definition: IAlgContextSvc.h:124
IAlgContextSvc::currentAlg
virtual IAlgorithm * currentAlg() const =0
accessor to current algorithm:
std::vector< IAlgorithm * >
IAlgContextSvc::algorithms
virtual const Algorithms & algorithms() const =0
get the stack of executed algorithms
Gaudi::Utils::AlgContext::operator=
AlgContext & operator=(const AlgContext &right)=delete
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:81
SmartIF.h
StatusCode
Definition: StatusCode.h:65
IInterface.h
IAlgorithm
Definition: IAlgorithm.h:38
Gaudi::Utils::AlgContext::AlgContext
AlgContext(IAlgorithm *alg, IAlgContextSvc *svc, EventContext &&context)=delete
Prevent use of temporary EventContext as current context.
Gaudi::Utils::AlgContext
Definition: IAlgContextSvc.h:84
IAlgContextSvc::unSetCurrentAlg
virtual StatusCode unSetCurrentAlg(IAlgorithm *a, const EventContext &context)=0
remove the algorithm ("pop_back")
IAlgContextSvc::DeclareInterfaceID
DeclareInterfaceID(IAlgContextSvc, 4, 0)
InterfaceID.
SmartIF< IAlgContextSvc >
IAlgContextSvc::Algorithms
std::vector< IAlgorithm * > Algorithms
the actual type of algorithm' stack
Definition: IAlgContextSvc.h:38
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition: __init__.py:1
IAlgContextSvc::setCurrentAlg
virtual StatusCode setCurrentAlg(IAlgorithm *a, const EventContext &context)=0
set the currently executing algorithm ("push_back")
Gaudi::Utils::AlgContext::m_svc
SmartIF< IAlgContextSvc > m_svc
Definition: IAlgContextSvc.h:123
EventContext.h
IInterface
Definition: IInterface.h:239
EventContext
Definition: EventContext.h:34
IAlgContextSvc
Definition: IAlgContextSvc.h:33
IAlgorithm.h
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
Gaudi::Utils::AlgContext::AlgContext
AlgContext(const AlgContext &right)=delete
Gaudi::Utils::AlgContext::m_context
const EventContext & m_context
Definition: IAlgContextSvc.h:125