![]() |
The Gaudi Framework
v27r0
|
This service manages tools. More...
#include <src/ApplicationMgr/ToolSvc.h>
Public Member Functions | |
StatusCode | initialize () override |
Initialize the service. More... | |
StatusCode | finalize () override |
Finalize the service. More... | |
StatusCode | start () override |
StatusCode | stop () override |
StatusCode | retrieve (const std::string &type, const InterfaceID &iid, IAlgTool *&tool, const IInterface *parent, bool createIf) override |
Retrieve tool, create it by default as common tool if it does not already exist. More... | |
StatusCode | retrieve (const std::string &tooltype, const std::string &toolname, const InterfaceID &iid, IAlgTool *&tool, const IInterface *parent, bool createIf) override |
Retrieve tool, create it by default as common tool if it does not already exist. More... | |
std::vector< std::string > | getInstances (const std::string &toolType) override |
Get names of all tool instances of a given type. More... | |
std::vector< std::string > | getInstances () const override |
Get names of all tool instances. More... | |
std::vector< IAlgTool * > | getTools () const override |
Get pointers to all tool instances. More... | |
StatusCode | releaseTool (IAlgTool *tool) override |
Release tool. More... | |
StatusCode | create (const std::string &type, const IInterface *parent, IAlgTool *&tool) |
Create Tool standard way with automatically assigned name. More... | |
StatusCode | create (const std::string &type, const std::string &name, const IInterface *parent, IAlgTool *&tool) |
Create Tool standard way with specified name. More... | |
bool | existsTool (const std::string &toolname) const |
Check if the tool instance exists. More... | |
std::string | nameTool (const std::string &nameByUser, const IInterface *parent) |
Get Tool full name by combining nameByUser and "parent" part. More... | |
ToolSvc (const std::string &name, ISvcLocator *svc) | |
Standard Constructor. More... | |
~ToolSvc () override=default | |
Destructor. More... | |
void | registerObserver (IToolSvc::Observer *obs) override |
void | unRegisterObserver (IToolSvc::Observer *obs) override |
![]() | |
void * | i_cast (const InterfaceID &tid) const override |
Implementation of IInterface::i_cast. More... | |
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override |
Implementation of IInterface::queryInterface. More... | |
std::vector< std::string > | getInterfaceNames () const override |
Implementation of IInterface::getInterfaceNames. More... | |
~extends () override=default | |
Virtual destructor. More... | |
void * | i_cast (const InterfaceID &tid) const override |
Implementation of IInterface::i_cast. More... | |
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override |
Implementation of IInterface::queryInterface. More... | |
std::vector< std::string > | getInterfaceNames () const override |
Implementation of IInterface::getInterfaceNames. More... | |
~extends () override=default | |
Virtual destructor. More... | |
![]() | |
~extend_interfaces () override=default | |
Virtual destructor. More... | |
~extend_interfaces () override=default | |
Virtual destructor. More... | |
Private Member Functions | |
unsigned long | totalToolRefCount () const |
The total number of refCounts on all tools in the instancesTools list. More... | |
unsigned long | minimumToolRefCount () const |
The minimum number of refCounts of all tools. More... | |
StatusCode | finalizeTool (IAlgTool *itool) const |
Finalize the given tool, with exception handling. More... | |
Private Attributes | |
std::vector< IAlgTool * > | m_instancesTools |
Common Tools. More... | |
IHistorySvc * | m_pHistorySvc = nullptr |
Pointer to HistorySvc. More... | |
std::vector< IToolSvc::Observer * > | m_observers |
Additional Inherited Members | |
![]() | |
using | base_class = extends |
Typedef to this class. More... | |
using | extend_interfaces_base = extend_interfaces< Interfaces...> |
Typedef to the base of this class. More... | |
using | base_class = extends |
Typedef to this class. More... | |
using | extend_interfaces_base = extend_interfaces< Interfaces...> |
Typedef to the base of this class. More... | |
![]() | |
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type |
take union of the ext_iids of all Interfaces... More... | |
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type |
take union of the ext_iids of all Interfaces... More... | |
This service manages tools.
Tools can be common, in which case a single instance can be shared by different algorithms, or private in which case it is necessary to specify the parent when requesting it. The parent of a tool can be an algortihm or a Service The environment of a tool is set by using that of the parent. A common tool is considered to belong to the ToolSvc itself.
ToolSvc::ToolSvc | ( | const std::string & | name, |
ISvcLocator * | svc | ||
) |
Standard Constructor.
name | String with service name |
svc | Pointer to service locator interface |
Definition at line 47 of file ToolSvc.cpp.
|
overridedefault |
Destructor.
StatusCode ToolSvc::create | ( | const std::string & | type, |
const IInterface * | parent, | ||
IAlgTool *& | tool | ||
) |
Create Tool standard way with automatically assigned name.
Definition at line 407 of file ToolSvc.cpp.
StatusCode ToolSvc::create | ( | const std::string & | tooltype, |
const std::string & | toolname, | ||
const IInterface * | parent, | ||
IAlgTool *& | tool | ||
) |
Create Tool standard way with specified name.
Now able to handle clones.
The test of tool existence is performed according to three criteria: name, type and parent. If a tool is private, i.e. the parent is not the tool Svc, and it exist but the parent is not the specified one, a clone is handed over. No clones of public tools are allowed since they would be undistinguishable.
invoke create callbacks...
Definition at line 472 of file ToolSvc.cpp.
bool ToolSvc::existsTool | ( | const std::string & | toolname | ) | const |
Check if the tool instance exists.
Definition at line 647 of file ToolSvc.cpp.
|
override |
Finalize the service.
Algorithm: 2 passes. First pass:
Inner loop: full loop over all left-over tools
Definition at line 74 of file ToolSvc.cpp.
|
private |
Finalize the given tool, with exception handling.
Definition at line 656 of file ToolSvc.cpp.
|
override |
Get names of all tool instances of a given type.
Definition at line 349 of file ToolSvc.cpp.
|
override |
Get names of all tool instances.
Definition at line 359 of file ToolSvc.cpp.
|
override |
Get pointers to all tool instances.
Definition at line 368 of file ToolSvc.cpp.
|
override |
Initialize the service.
Definition at line 52 of file ToolSvc.cpp.
|
private |
The minimum number of refCounts of all tools.
Definition at line 703 of file ToolSvc.cpp.
std::string ToolSvc::nameTool | ( | const std::string & | nameByUser, |
const IInterface * | parent | ||
) |
Get Tool full name by combining nameByUser and "parent" part.
Definition at line 623 of file ToolSvc.cpp.
|
override |
Definition at line 713 of file ToolSvc.cpp.
|
override |
Release tool.
Definition at line 374 of file ToolSvc.cpp.
|
override |
Retrieve tool, create it by default as common tool if it does not already exist.
Definition at line 247 of file ToolSvc.cpp.
|
override |
Retrieve tool, create it by default as common tool if it does not already exist.
invoke retrieve callbacks...
Definition at line 278 of file ToolSvc.cpp.
|
override |
Definition at line 726 of file ToolSvc.cpp.
|
override |
Definition at line 752 of file ToolSvc.cpp.
|
private |
The total number of refCounts on all tools in the instancesTools list.
Definition at line 697 of file ToolSvc.cpp.
|
override |
Definition at line 719 of file ToolSvc.cpp.
|
private |
|
private |
|
private |
Pointer to HistorySvc.