The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
IAlgorithm.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
15#include <string>
16
17class IAlgTool;
18class AlgResourcePool;
19class AlgExecStateRef;
20class EventContext;
21
22namespace Gaudi {
23 class StringKey;
24}
25
36class GAUDI_API IAlgorithm : virtual public extend_interfaces<INamedInterface, IStateful> {
37public:
39
42
45 virtual const std::string& version() const = 0;
46
49 virtual const std::string& type() const = 0;
50 virtual void setType( std::string ) = 0;
51
54 virtual const Gaudi::StringKey& nameKey() const = 0;
55
58 virtual unsigned int index() const = 0;
59
62 virtual bool isClonable() const { return false; }
63
67 virtual unsigned int cardinality() const = 0;
68
71 virtual const std::vector<std::string>& neededResources() const = 0;
72
76 virtual StatusCode execute( const EventContext& ) const = 0;
77
79 virtual bool isInitialized() const = 0;
81 virtual bool isFinalized() const = 0;
82
89
95 virtual StatusCode sysStart() = 0;
96
103
109 virtual StatusCode sysRestart() = 0;
110
112#define GAUDI_SYSEXECUTE_WITHCONTEXT 1
113
115 virtual StatusCode sysExecute( const EventContext& ) = 0;
116
120 virtual StatusCode sysStop() = 0;
121
125 virtual StatusCode sysFinalize() = 0;
126
130 virtual AlgExecStateRef execState( const EventContext& ctx ) const = 0;
131
133 virtual bool isEnabled() const = 0;
134
136 virtual bool isSequence() const = 0;
137
139 virtual std::ostream& toControlFlowExpression( std::ostream& os ) const = 0;
140
142 virtual void setIndex( const unsigned int& idx ) = 0;
143
144 virtual bool isReEntrant() const = 0;
145};
#define GAUDI_API
Definition Kernel.h:49
wrapper on an Algorithm state.
The AlgResourcePool is a concrete implementation of the IAlgResourcePool interface.
This class represents an entry point to all the event specific data.
Helper class for efficient "key" access for strings.
Definition StringKey.h:66
The interface implemented by the AlgTool base class.
Definition IAlgTool.h:29
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition IAlgorithm.h:36
virtual unsigned int index() const =0
The index of the algorithm.
virtual void setType(std::string)=0
virtual bool isClonable() const
Specify if the algorithm is clonable.
Definition IAlgorithm.h:62
virtual StatusCode sysStart()=0
Startup method invoked by the framework.
virtual StatusCode sysReinitialize()=0
Re-initialization method invoked by the framework.
virtual AlgExecStateRef execState(const EventContext &ctx) const =0
get the AlgExecStateRef of current algorithm Actually a small wrapper around it, thus the plain objec...
virtual bool isFinalized() const =0
check if the algorithm is finalized properly
virtual const std::string & version() const =0
The version of the algorithm.
virtual StatusCode execute(const EventContext &) const =0
The action to be performed by the algorithm on an event.
friend AlgResourcePool
Definition IAlgorithm.h:38
virtual std::ostream & toControlFlowExpression(std::ostream &os) const =0
Produce string represention of the control flow expression.
virtual const std::vector< std::string > & neededResources() const =0
Named, non thread-safe resources used during event processing.
virtual StatusCode sysStop()=0
System stop.
virtual bool isEnabled() const =0
Is this algorithm enabled or disabled?
virtual StatusCode sysRestart()=0
Re-start method invoked by the framework.
virtual bool isInitialized() const =0
check if the algorithm is initialized properly
virtual StatusCode sysExecute(const EventContext &)=0
System execution. This method invokes the execute() method of a concrete algorithm.
virtual unsigned int cardinality() const =0
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentra...
virtual const std::string & type() const =0
The type of the algorithm.
DeclareInterfaceID(IAlgorithm, 7, 0)
InterfaceID.
virtual StatusCode sysFinalize()=0
System finalization.
virtual StatusCode sysInitialize()=0
Initialization method invoked by the framework.
virtual bool isSequence() const =0
Are we a Sequence?
virtual const Gaudi::StringKey & nameKey() const =0
StringKey rep of name.
virtual void setIndex(const unsigned int &idx)=0
Set instantiation index of Alg.
virtual bool isReEntrant() const =0
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1
Base class to be used to extend an interface.