The Gaudi Framework  v33r0 (d5ea422b)
IAlgorithm.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_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( const 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 
104  virtual StatusCode sysReinitialize() = 0;
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 
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 };
146 
147 #endif // GAUDIKERNEL_IALGORITHM_H
The AlgResourcePool is a concrete implementation of the IAlgResourcePool interface.
This class represents an entry point to all the event specific data.
Definition: EventContext.h:34
The helper class to represent the efficient "key" for access.
Definition: StringKey.h:44
STL class.
friend AlgResourcePool
Definition: IAlgorithm.h:40
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
Base class to be used to extend an interface.
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
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:33
virtual bool isClonable() const
Specify if the algorithm is clonable.
Definition: IAlgorithm.h:64
#define GAUDI_API
Definition: Kernel.h:81
STL class.
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1