| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AlgorithmManager.h
Go to the documentation of this file.
1 #ifndef GAUDISVC_ALGORITHMMANAGER_H
2 #define GAUDISVC_ALGORITHMMANAGER_H
3
4 // Include files
5 #include "GaudiKernel/Kernel.h"
6 #include "GaudiKernel/IAlgManager.h"
7 #include "GaudiKernel/IStateful.h"
8 #include "GaudiKernel/ComponentManager.h"
9 #include "GaudiKernel/SmartIF.h"
10 #include "GaudiKernel/IAlgorithm.h"
11 #include <string>
12 #include <list>
13 #include <map>
14
15 // Forward declarations
16 class ISvcLocator;
17 class IMessageSvc;
18
31 class AlgorithmManager : public extends1<ComponentManager, IAlgManager>{
32 public:
33
34 struct AlgorithmItem {
35 AlgorithmItem(IAlgorithm *s, bool managed = false):
36 algorithm(s), managed(managed) {}
37 SmartIF<IAlgorithm> algorithm;
38 bool managed;
39 inline bool operator==(const std::string &name) const {
40 return algorithm->name() == name;
41 }
42 inline bool operator==(const IAlgorithm *ptr) const {
43 return algorithm.get() == ptr;
44 }
45 };
46
48 typedef std::list<AlgorithmItem> ListAlg;
49 typedef std::map<std::string, std::string> AlgTypeAliasesMap;
50
52 AlgorithmManager( IInterface* iface );
54 virtual ~AlgorithmManager();
55
57 virtual StatusCode addAlgorithm(IAlgorithm* alg);
59 virtual StatusCode removeAlgorithm(IAlgorithm* alg);
61 virtual StatusCode createAlgorithm(const std::string& algtype, const std::string& algname,
62 IAlgorithm*& algorithm, bool managed = false);
63
65 virtual bool existsAlgorithm(const std::string& name) const;
67 virtual const std::list<IAlgorithm*>& getAlgorithms() const;
68
70 virtual StatusCode initialize();
72 virtual StatusCode start();
74 virtual StatusCode stop();
76 virtual StatusCode finalize();
77
79 virtual StatusCode reinitialize();
81 virtual StatusCode restart();
82
84 const std::string &name() const {
85 static std::string _name = "AlgorithmManager";
86 return _name;
87 }
88
89 virtual SmartIF<IAlgorithm> &algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf = true);
90
91 AlgTypeAliasesMap& typeAliases() { return m_algTypeAliases; }
92 const AlgTypeAliasesMap& typeAliases() const { return m_algTypeAliases; }
93
94 private:
95 ListAlg m_listalg;
96
98 mutable std::list<IAlgorithm*> m_listOfPtrs;
99
100 AlgTypeAliasesMap m_algTypeAliases;
101
102 };
103 #endif // GAUDISVC_ALGORITHMFACTORY_H
104