| # 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
ToolSvc.h
Go to the documentation of this file.
1 // $Id: ToolSvc.h,v 1.12 2008/06/02 14:21:35 marcocle Exp $
2 #ifndef GAUDISVC_TOOLSVC_H
3 #define GAUDISVC_TOOLSVC_H
4
5 // Include Files
6 #include "GaudiKernel/Service.h"
7 #include "GaudiKernel/IToolSvc.h"
8 #include <vector>
9
23 class ToolSvc : public extends1<Service, IToolSvc> {
24
25 public:
26
27 // Typedefs
28 typedef std::list<IAlgTool*> ListTools;
29
31 virtual StatusCode initialize();
32
34 virtual StatusCode finalize();
35
36 // Start transition for tools
37 virtual StatusCode start();
38
39 // Stop transition for tools
40 virtual StatusCode stop();
41
43 virtual StatusCode retrieve(const std::string& type, const InterfaceID& iid,
44 IAlgTool*& tool, const IInterface* parent,
45 bool createIf);
46
48 virtual StatusCode retrieve(const std::string& tooltype, const std::string& toolname,
49 const InterfaceID& iid, IAlgTool*& tool,
50 const IInterface* parent, bool createIf);
51
53 virtual std::vector<std::string> getInstances( const std::string& toolType );
54
56 virtual StatusCode releaseTool( IAlgTool* tool );
57
59 StatusCode create(const std::string& type, const IInterface* parent,
60 IAlgTool*& tool);
61
63 StatusCode create(const std::string& type, const std::string& name,
64 const IInterface* parent, IAlgTool*& tool);
65
67 bool existsTool( const std::string& toolname) const;
68
70 std::string nameTool(const std::string& nameByUser, const IInterface* parent);
71
73 unsigned long refCountTool( IAlgTool* tool ) const { return tool->refCount(); }
74
79 ToolSvc( const std::string& name, ISvcLocator* svc );
80
82 virtual ~ToolSvc();
83
84 virtual void registerObserver(IToolSvc::Observer *obs) ;
85 virtual void unRegisterObserver(IToolSvc::Observer *obs) ;
86
87
88 private: // methods
89
90 // helper functions
91 //
93 unsigned long totalToolRefCount() const;
95 unsigned long totalToolRefCount( const ListTools& ) const;
97 unsigned long minimumToolRefCount() const;
98
100 StatusCode finalizeTool( IAlgTool* itool ) const;
101
102 private: // data
103
105 ListTools m_instancesTools; // List of all instances of tools
106
108 IHistorySvc* m_pHistorySvc;
109
110 std::vector<IToolSvc::Observer*> m_observers;
111 };
112
113 #endif
114
115