The Gaudi Framework  master (37c0b60a)
IAlgorithm.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_IALGORITHM_H
12 #define GAUDIKERNEL_IALGORITHM_H
13 
14 // Include files
16 #include <GaudiKernel/IStateful.h>
17 #include <string>
18 
19 class IAlgTool;
20 class AlgResourcePool;
21 class AlgExecState;
22 class EventContext;
23 
24 namespace Gaudi {
25  class StringKey;
26 }
27 
38 class GAUDI_API IAlgorithm : virtual public extend_interfaces<INamedInterface, IStateful> {
39 public:
41 
44 
47  virtual const std::string& version() const = 0;
48 
51  virtual const std::string& type() const = 0;
52  virtual void setType( std::string ) = 0;
53 
56  virtual const Gaudi::StringKey& nameKey() const = 0;
57 
60  virtual unsigned int index() const = 0;
61 
64  virtual bool isClonable() const { return false; }
65 
69  virtual unsigned int cardinality() const = 0;
70 
73  virtual const std::vector<std::string>& neededResources() const = 0;
74 
78  virtual StatusCode execute( const EventContext& ) const = 0;
79 
81  virtual bool isInitialized() const = 0;
83  virtual bool isFinalized() const = 0;
84 
90  virtual StatusCode sysInitialize() = 0;
91 
97  virtual StatusCode sysStart() = 0;
98 
105 
111  virtual StatusCode sysRestart() = 0;
112 
114 #define GAUDI_SYSEXECUTE_WITHCONTEXT 1
115 
117  virtual StatusCode sysExecute( const EventContext& ) = 0;
118 
122  virtual StatusCode sysStop() = 0;
123 
127  virtual StatusCode sysFinalize() = 0;
128 
130  virtual AlgExecState& execState( const EventContext& ctx ) const = 0;
131 
133  virtual bool isEnabled() const = 0;
134 
136  virtual bool isSequence() const = 0;
137 
140 
142  virtual void setIndex( const unsigned int& idx ) = 0;
143 
144  virtual bool isReEntrant() const = 0;
145 };
146 
147 #endif // GAUDIKERNEL_IALGORITHM_H
IAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &)=0
System execution. This method invokes the execute() method of a concrete algorithm.
IAlgorithm::isFinalized
virtual bool isFinalized() const =0
check if the algorithm is finalized properly
std::string
STL class.
IAlgTool
Definition: IAlgTool.h:33
IAlgorithm::setIndex
virtual void setIndex(const unsigned int &idx)=0
Set instantiation index of Alg.
std::vector< std::string >
IAlgorithm::execute
virtual StatusCode execute(const EventContext &) const =0
The action to be performed by the algorithm on an event.
IAlgorithm::sysFinalize
virtual StatusCode sysFinalize()=0
System finalization.
IAlgorithm::isEnabled
virtual bool isEnabled() const =0
Is this algorithm enabled or disabled?
IAlgorithm::DeclareInterfaceID
DeclareInterfaceID(IAlgorithm, 7, 0)
InterfaceID.
IAlgorithm::cardinality
virtual unsigned int cardinality() const =0
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentra...
IAlgorithm::type
virtual const std::string & type() const =0
The type of the algorithm.
IAlgorithm::index
virtual unsigned int index() const =0
The index of the algorithm.
extend_interfaces
Base class to be used to extend an interface.
Definition: extend_interfaces.h:15
IAlgorithm::neededResources
virtual const std::vector< std::string > & neededResources() const =0
Named, non thread-safe resources used during event processing.
IAlgorithm::isInitialized
virtual bool isInitialized() const =0
check if the algorithm is initialized properly
IAlgorithm::isClonable
virtual bool isClonable() const
Specify if the algorithm is clonable.
Definition: IAlgorithm.h:64
IAlgorithm::isReEntrant
virtual bool isReEntrant() const =0
AlgResourcePool
Definition: AlgResourcePool.h:38
Gaudi::StringKey
Definition: StringKey.h:44
INamedInterface.h
GaudiPython.Pythonizations.ctx
ctx
Definition: Pythonizations.py:578
StatusCode
Definition: StatusCode.h:65
IAlgorithm::sysReinitialize
virtual StatusCode sysReinitialize()=0
Re-initialization method invoked by the framework.
IAlgorithm
Definition: IAlgorithm.h:38
std::ostream
STL class.
IAlgorithm::execState
virtual AlgExecState & execState(const EventContext &ctx) const =0
reference to AlgExecState of Alg
IStateful.h
IAlgorithm::nameKey
virtual const Gaudi::StringKey & nameKey() const =0
StringKey rep of name.
IAlgorithm::sysStart
virtual StatusCode sysStart()=0
Startup method invoked by the framework.
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition: __init__.py:1
IAlgorithm::toControlFlowExpression
virtual std::ostream & toControlFlowExpression(std::ostream &os) const =0
Produce string represention of the control flow expression.
IAlgorithm::setType
virtual void setType(std::string)=0
IAlgorithm::version
virtual const std::string & version() const =0
The version of the algorithm.
IAlgorithm::sysStop
virtual StatusCode sysStop()=0
System stop.
EventContext
Definition: EventContext.h:34
AlgExecState
Definition: IAlgExecStateSvc.h:36
IAlgorithm::sysInitialize
virtual StatusCode sysInitialize()=0
Initialization method invoked by the framework.
IAlgorithm::isSequence
virtual bool isSequence() const =0
Are we a Sequence?
IAlgorithm::AlgResourcePool
friend AlgResourcePool
Definition: IAlgorithm.h:40
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
IAlgorithm::sysRestart
virtual StatusCode sysRestart()=0
Re-start method invoked by the framework.