| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

IAlgManager.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_IALGMANAGER_H
2 #define GAUDIKERNEL_IALGMANAGER_H
3
4 // Include files
5 #include "GaudiKernel/IComponentManager.h"
6 #include "GaudiKernel/SmartIF.h"
7 #include "GaudiKernel/TypeNameString.h"
8 #include <string>
9 #include <list>
10
11 // Forward class declaration
12 class IService;
13 class IAlgorithm;
14 class ISvcLocator;
15
27 class GAUDI_API IAlgManager: virtual public IComponentManager {
28 public:
30 DeclareInterfaceID(IAlgManager, 6, 0);
31
33 virtual StatusCode addAlgorithm( IAlgorithm* alg // Pointer to the Algorithm
34 ) = 0;
36 virtual StatusCode removeAlgorithm( IAlgorithm* alg // Pointer to the Algorithm
37 ) = 0;
40 virtual StatusCode createAlgorithm( const std::string& algtype, // Algorithm type name
41 const std::string& algname, // Algorithm name to be assigned
42 IAlgorithm*& alg, // Returned algorithm
43 bool managed = false, // Flag to indicate if the algorithm is managed
44 bool checkIfExists = true // Flag to indicate if clones of existing algorithms can be created
45 ) = 0;
46 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
47 virtual StatusCode getAlgorithm( const std::string& name, // Algorithm name to be searched
49 IAlgorithm*& alg // Returned algorithm
50 ) const {
51 SmartIF<IAlgorithm> &si = const_cast<IAlgManager*>(this)->algorithm(name, false);
52 alg = si.get();
53 return si ? StatusCode::SUCCESS : StatusCode::FAILURE;
54 }
55 #endif
56 virtual bool existsAlgorithm( const std::string& name // Algorithm name to be searched
58 ) const = 0;
60 virtual const std::vector<IAlgorithm*>& getAlgorithms() const = 0;
61
62 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
63 virtual StatusCode initializeAlgorithms() { return initialize(); }
65
67 virtual StatusCode startAlgorithms() { return start(); }
68
70 virtual StatusCode stopAlgorithms() { return stop(); }
71
73 virtual StatusCode finalizeAlgorithms() { return finalize(); }
74
76 virtual StatusCode reinitializeAlgorithms() { return reinitialize(); }
77
79 virtual StatusCode restartAlgorithms() { return restart(); }
80 #endif
81
83 virtual SmartIF<IAlgorithm> &algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf = true) = 0;
84
86 template <typename T>
87 inline SmartIF<T> algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf = true) {
88 return SmartIF<T>(algorithm(typeName, createIf));
89 }
90
91 };
92
93
94 #endif // GAUDI_IALGMANAGER_H
IComponentManager::DeclareInterfaceID
DeclareInterfaceID(IComponentManager, 1, 0)
InterfaceID.
SmartIF< IAlgorithm >
IAlgManager::stopAlgorithms
virtual StatusCode stopAlgorithms()
Stops the list of "managed" algorithms.
Definition: IAlgManager.h:70
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
IComponentManager
Definition: IComponentManager.h:11
IAlgManager
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
IStateful::start
virtual StatusCode start()=0
Start (from INITIALIZED to RUNNING).
std::string
STL class.
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
IAlgManager::startAlgorithms
virtual StatusCode startAlgorithms()
Starts the list of "managed" algorithms.
Definition: IAlgManager.h:67
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
Gaudi::Utils::getAlgorithm
GAUDI_API IAlgorithm * getAlgorithm(const IAlgContextSvc *svc, const AlgSelector &sel)
simple function to get the algorithm from Context Service
Definition: GetAlg.cpp:26
StatusCode::FAILURE
Definition: StatusCode.h:29
IStateful::stop
virtual StatusCode stop()=0
Stop (from RUNNING to INITIALIZED).
IStateful::reinitialize
virtual StatusCode reinitialize()=0
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
IAlgManager::finalizeAlgorithms
virtual StatusCode finalizeAlgorithms()
Finalizes the list of "managed" algorithms.
Definition: IAlgManager.h:73
IService
General service interface definition.
Definition: IService.h:18
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
SmartIF.h
IStateful::initialize
virtual StatusCode initialize()=0
Initialization (from CONFIGURED to INITIALIZED).
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:25
std::vector< IAlgorithm * >
IComponentManager.h
IStateful::restart
virtual StatusCode restart()=0
Initialization (from RUNNING to RUNNING, via INITIALIZED).
IStateful::finalize
virtual StatusCode finalize()=0
Finalize (from INITIALIZED to CONFIGURED).
IAlgManager::reinitializeAlgorithms
virtual StatusCode reinitializeAlgorithms()
Initializes the list of "managed" algorithms.
Definition: IAlgManager.h:76
TypeNameString.h
IAlgManager::algorithm
SmartIF< T > algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)
Returns a smart pointer to the requested interface of a service.
Definition: IAlgManager.h:87
GaudiDict::typeName
std::string typeName(const std::type_info &typ)
Definition: Dictionary.cpp:21
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
IAlgManager::restartAlgorithms
virtual StatusCode restartAlgorithms()
Starts the list of "managed" algorithms.
Definition: IAlgManager.h:79