Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
IAlgManager.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_IALGMANAGER_H
2 #define GAUDIKERNEL_IALGMANAGER_H
3 
4 // Include files
6 #include "GaudiKernel/SmartIF.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 public:
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
45  // be created
46  ) = 0;
47 #if !defined( GAUDI_V22_API ) || defined( G22_NEW_SVCLOCATOR )
48  virtual StatusCode getAlgorithm( const std::string& name, // Algorithm name to be searched
50  IAlgorithm*& alg // Returned algorithm
51  ) const {
52  SmartIF<IAlgorithm>& si = const_cast<IAlgManager*>( this )->algorithm( name, false );
53  alg = si.get();
55  }
56 #endif
57  virtual bool existsAlgorithm( const std::string& name // Algorithm name to be searched
59  ) const = 0;
61  virtual const std::vector<IAlgorithm*>& getAlgorithms() const = 0;
62 
65  const bool createIf = true ) = 0;
66 
68  template <typename T>
69  inline SmartIF<T> algorithm( const Gaudi::Utils::TypeNameString& typeName, const bool createIf = true ) {
70  return SmartIF<T>( algorithm( typeName, createIf ) );
71  }
72 };
73 
74 #endif // GAUDI_IALGMANAGER_H
DeclareInterfaceID(IComponentManager, 1, 0)
InterfaceID.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
STL class.
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
Helper class to parse a string of format "type/name".
GAUDI_API IAlgorithm * getAlgorithm(const IAlgContextSvc *svc, const AlgSelector &sel)
simple function to get the algorithm from Context Service
Definition: GetAlg.cpp:24
General service interface definition.
Definition: IService.h:18
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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:69
std::string typeName(const std::type_info &typ)
Definition: Dictionary.cpp:21
#define GAUDI_API
Definition: Kernel.h:71