| The Gaudi Framework v30r0 (c919700c)

- 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 <list>
9 #include <string>
10
11 // Forward class declaration
12 class IService;
13 class IAlgorithm;
14 class ISvcLocator;
15
27 class GAUDI_API IAlgManager : virtual public IComponentManager
28 {
29 public:
31 DeclareInterfaceID( IAlgManager, 6, 0 );
32
34 virtual StatusCode addAlgorithm( IAlgorithm* alg // Pointer to the Algorithm
35 ) = 0;
37 virtual StatusCode removeAlgorithm( IAlgorithm* alg // Pointer to the Algorithm
38 ) = 0;
41 virtual StatusCode
42 createAlgorithm( const std::string& algtype, // Algorithm type name
43 const std::string& algname, // Algorithm name to be assigned
44 IAlgorithm*& alg, // Returned algorithm
45 bool managed = false, // Flag to indicate if the algorithm is managed
46 bool checkIfExists = true // Flag to indicate if clones of existing algorithms can be created
47 ) = 0;
48 #if !defined( GAUDI_V22_API ) || defined( G22_NEW_SVCLOCATOR )
49 virtual StatusCode getAlgorithm( const std::string& name, // Algorithm name to be searched
51 IAlgorithm*& alg // Returned algorithm
52 ) const
53 {
54 SmartIF<IAlgorithm>& si = const_cast<IAlgManager*>( this )->algorithm( name, false );
55 alg = si.get();
56 return si ? StatusCode::SUCCESS : StatusCode::FAILURE;
57 }
58 #endif
59 virtual bool existsAlgorithm( const std::string& name // Algorithm name to be searched
61 ) const = 0;
63 virtual const std::vector<IAlgorithm*>& getAlgorithms() const = 0;
64
66 virtual SmartIF<IAlgorithm>& algorithm( const Gaudi::Utils::TypeNameString& typeName,
67 const bool createIf = true ) = 0;
68
70 template <typename T>
71 inline SmartIF<T> algorithm( const Gaudi::Utils::TypeNameString& typeName, const bool createIf = true )
72 {
73 return SmartIF<T>( algorithm( typeName, createIf ) );
74 }
75 };
76
77 #endif // GAUDI_IALGMANAGER_H
StatusCode::SUCCESS
Definition: StatusCode.h:29
IComponentManager::DeclareInterfaceID
DeclareInterfaceID(IComponentManager, 1, 0)
InterfaceID.
SmartIF< IAlgorithm >
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:32
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
std::string
STL class.
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
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:24
IService
General service interface definition.
Definition: IService.h:18
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
SmartIF.h
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
std::vector< IAlgorithm * >
IComponentManager.h
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:71
StatusCode::FAILURE
Definition: StatusCode.h:29
GaudiDict::typeName
std::string typeName(const std::type_info &typ)
Definition: Dictionary.cpp:23
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110