The Gaudi Framework  master (d98a2936)
IAlgContextSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 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 #pragma once
12 
14 #include <GaudiKernel/IAlgorithm.h>
15 #include <GaudiKernel/IInterface.h>
16 #include <GaudiKernel/SmartIF.h>
17 #include <vector>
18 
25 class GAUDI_API IAlgContextSvc : virtual public IInterface {
26 public:
30  typedef std::vector<IAlgorithm*> Algorithms;
31 
32 public:
34  virtual StatusCode setCurrentAlg( IAlgorithm* a, const EventContext& context ) = 0;
36  virtual StatusCode unSetCurrentAlg( IAlgorithm* a, const EventContext& context ) = 0;
38  virtual IAlgorithm* currentAlg() const = 0;
40  virtual const Algorithms& algorithms() const = 0;
41 };
42 
43 namespace Gaudi {
44  namespace Utils {
76  class GAUDI_API AlgContext final {
77  public:
86  AlgContext( IAlgorithm* alg, IAlgContextSvc* svc, const EventContext& context );
87 
96 
99  AlgContext( IAlgorithm* alg, IAlgContextSvc* svc, EventContext&& context ) = delete;
100 
106  ~AlgContext();
107 
108  private:
109  // copy constructor is disabled
110  AlgContext( const AlgContext& right ) = delete;
111  // assignement operator is disabled
112  AlgContext& operator=( const AlgContext& right ) = delete;
113 
114  private:
118  };
119  } // namespace Utils
120 } // namespace Gaudi
Gaudi::Utils::AlgContext::m_alg
SmartIF< IAlgorithm > m_alg
Definition: IAlgContextSvc.h:116
IAlgContextSvc::currentAlg
virtual IAlgorithm * currentAlg() const =0
accessor to current algorithm:
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:64
IInterface.h
IAlgorithm
Definition: IAlgorithm.h:36
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:76
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:30
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:115
EventContext.h
IInterface
Definition: IInterface.h:225
EventContext
Definition: EventContext.h:34
IAlgContextSvc
Definition: IAlgContextSvc.h:25
IAlgorithm.h
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:49
Gaudi::Utils::AlgContext::AlgContext
AlgContext(const AlgContext &right)=delete
Gaudi::Utils::AlgContext::m_context
const EventContext & m_context
Definition: IAlgContextSvc.h:117