#include <GaudiKernel/IToolSvc.h>
Inheritance diagram for IToolSvc:
Public Types | |
SUCCESS = 1 | |
Normal successful completion. | |
NO_INTERFACE | |
Requested interface is not available. | |
VERSMISMATCH | |
Requested interface version is incompatible. | |
LAST_ERROR | |
Last error. | |
enum | Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR } |
Return status. More... | |
Public Member Functions | |
virtual StatusCode | retrieve (const std::string &type, const InterfaceID &iid, IAlgTool *&tool, const IInterface *parent=0, bool createIf=true)=0 |
Retrieve tool with tool dependent part of the name automatically assigned. | |
virtual StatusCode | retrieve (const std::string &type, const std::string &name, const InterfaceID &iid, IAlgTool *&tool, const IInterface *parent=0, bool createIf=true)=0 |
Retrieve tool with tool dependent part of the name specified by the requester. | |
virtual std::vector< std::string > | getInstances (const std::string &toolType)=0 |
Get all instance of tool by type. | |
virtual StatusCode | releaseTool (IAlgTool *tool)=0 |
Release the tool. | |
template<class T> | |
StatusCode | retrieveTool (const std::string &type, T *&tool, const IInterface *parent=0, bool createIf=true) |
Retrieve specified tool sub-type with tool dependent part of the name automatically assigned. | |
template<class T> | |
StatusCode | retrieveTool (const std::string &type, const std::string &name, T *&tool, const IInterface *parent=0, bool createIf=true) |
Retrieve specified tool sub-type with tool dependent part of the name tool dependent part of the name specified by the requester. | |
virtual void | registerObserver (Observer *obs)=0 |
virtual void | unRegisterObserver (Observer *obs)=0 |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface)=0 |
Query interfaces of Interface. | |
virtual unsigned long | addRef ()=0 |
Increment the reference count of Interface instance. | |
virtual unsigned long | release ()=0 |
Release Interface instance. | |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. | |
Classes | |
class | Observer |
allow call-backs when a tool is a created or retrieved More... |
Definition at line 20 of file IToolSvc.h.
enum IInterface::Status [inherited] |
Return status.
SUCCESS | Normal successful completion. |
NO_INTERFACE | Requested interface is not available. |
VERSMISMATCH | Requested interface version is incompatible. |
LAST_ERROR | Last error. |
Reimplemented in IConversionSvc, IConverter, and IDataProviderSvc.
Definition at line 113 of file IInterface.h.
00113 { 00115 SUCCESS = 1, 00117 NO_INTERFACE, 00119 VERSMISMATCH, 00121 LAST_ERROR 00122 };
static const InterfaceID& IToolSvc::interfaceID | ( | ) | [inline, static] |
Retrieve interface ID.
Reimplemented from IInterface.
Definition at line 24 of file IToolSvc.h.
00024 { return IID_IToolSvc; }
virtual StatusCode IToolSvc::retrieve | ( | const std::string & | type, | |
const InterfaceID & | iid, | |||
IAlgTool *& | tool, | |||
const IInterface * | parent = 0 , |
|||
bool | createIf = true | |||
) | [pure virtual] |
Retrieve tool with tool dependent part of the name automatically assigned.
By default a tool will be created if it does not exist, unless otherwise specified. By default it will be a common tool unless a parent is specified. The parent of a common tool is automatically taken as the ToolSvc itself.
type | AlgTool type name | |
iid | the unique interface identifier | |
tool | returned tool | |
parent | constant reference to the parent (def=none) | |
createIf | creation flag (def=create if not existing) |
virtual StatusCode IToolSvc::retrieve | ( | const std::string & | type, | |
const std::string & | name, | |||
const InterfaceID & | iid, | |||
IAlgTool *& | tool, | |||
const IInterface * | parent = 0 , |
|||
bool | createIf = true | |||
) | [pure virtual] |
Retrieve tool with tool dependent part of the name specified by the requester.
By default a tool will be created if it does not exist, unless otherwise specified. By default it will be a common tool unless a parent is specified. The parent of a common tool is automatically taken as the ToolSvc itself.
type | AlgTool type name | |
name | name to be assigned to tool dependent part of the name | |
iid | the unique interface identifier | |
tool | returned tool | |
parent | constant reference to parent (def=none) | |
createIf | creation flag (def=create if not existing) |
virtual std::vector<std::string> IToolSvc::getInstances | ( | const std::string & | toolType | ) | [pure virtual] |
Get all instance of tool by type.
toolType | type of tool |
virtual StatusCode IToolSvc::releaseTool | ( | IAlgTool * | tool | ) | [pure virtual] |
Release the tool.
tool | to be released |
StatusCode IToolSvc::retrieveTool | ( | const std::string & | type, | |
T *& | tool, | |||
const IInterface * | parent = 0 , |
|||
bool | createIf = true | |||
) | [inline] |
Retrieve specified tool sub-type with tool dependent part of the name automatically assigned.
Internally it uses the corresponding IToolSvc::retrieve and does the dynamic casting.
IToolSvc* svc = ... ; IMyTool* tool = 0 ; StatusCode sc = svc->retrieveTool ( "MyToolType" , tool ) ;
'MyToolType'
will be retrieved from Tool Service (created on demand). The full name of the tool instance is set to be ToolSvc.MyToolType
IToolSvc* svc = ... ; IAlgorithm* alg = ... ; IMyTool* tool = 0 ; StatusCode sc = svc->retrieveTool ( "MyToolType" , tool , alg ) ;
'MyToolType'
will be retrieved from Tool Service (created on demand). The full name of the tool instance is set to be <AlgName>.MyToolType
, where <AlgName>
is a name of the algorithm.
IToolSvc* svc = ... ; IMyTool* tool = 0 ; StatusCode sc = svc->retrieveTool ( "MyToolType/MyToolName" , tool ) ;
'MyToolType'
will be retrieved from Tool Service (created on demand). The full name of the tool instance is set to be ToolSvc.MyToolName
IToolSvc* svc = ... ; IAlgorithm* alg = ... ; IMyTool* tool = 0 ; StatusCode sc = svc -> retrieveTool ( "MyToolType/MyToolName" , tool , alg ) ;
'MyToolType'
will be retrieved from Tool Service (created on demand). The full name of the tool instance is set to be <AlgName>.MyToolName
, where <AlgName>
is a name of the algorithm.
tool | returned tool | |
parent | constant reference to parent (def=none) | |
createIf | creation flag (def=create if not existing) |
Definition at line 137 of file IToolSvc.h.
00141 { 00142 return retrieve( type, 00143 T::interfaceID(), 00144 (IAlgTool*&)tool, 00145 parent, 00146 createIf ); 00147 }
StatusCode IToolSvc::retrieveTool | ( | const std::string & | type, | |
const std::string & | name, | |||
T *& | tool, | |||
const IInterface * | parent = 0 , |
|||
bool | createIf = true | |||
) | [inline] |
Retrieve specified tool sub-type with tool dependent part of the name tool dependent part of the name specified by the requester.
Internally it uses the corresponding IToolSvc::retrieve and does the dynamic casting.
IToolSvc* svc = ... ; IMyTool* tool = 0 ; StatusCode sc = svc->retrieveTool ( "MyToolType" , "MyToolName" , tool ) ;
'MyToolType'
will be retrieved from Tool Service (created on demand). The full name of the tool instance is set to be ToolSvc.MyToolName
IToolSvc* svc = ... ; IAlgorithm* alg = ... ; IMyTool* tool = 0 ; StatusCode sc = svc->retrieveTool ( "MyToolType" , "MyToolName" , tool , alg ) ;
'MyToolType'
will be retrieved from Tool Service (created on demand). The full name of the tool instance is set to be <AlgName>.MyToolName
, where <AlgName>
is a name of the algorithm.
If name
is empty (""
) it is assumed to be equal to the type
type | AlgTool type name | |
name | name to be assigned to tool dependent part of the name | |
tool | returned tool | |
parent | constant reference to parent (def=none) | |
createIf | creation flag (def=create if not existing) |
Definition at line 193 of file IToolSvc.h.
00198 { 00199 return retrieve ( type, 00200 name, 00201 T::interfaceID(), 00202 (IAlgTool*&)tool, 00203 parent, 00204 createIf ); 00205 }
virtual void IToolSvc::registerObserver | ( | Observer * | obs | ) | [pure virtual] |
virtual void IToolSvc::unRegisterObserver | ( | Observer * | obs | ) | [pure virtual] |
virtual StatusCode IInterface::queryInterface | ( | const InterfaceID & | riid, | |
void ** | ppvInterface | |||
) | [pure virtual, inherited] |
Query interfaces of Interface.
riid | ID of Interface to be retrieved | |
ppvInterface | Pointer to Location for interface pointer |
Implemented in Algorithm, AlgTool, Auditor, ConversionSvc, Converter, DataSvc, EventSelectorDataStream, MinimalEventLoopMgr, PropertyMgr, SelectStatement, and Service.
virtual unsigned long IInterface::addRef | ( | ) | [pure virtual, inherited] |
Increment the reference count of Interface instance.
Implemented in Algorithm, AlgTool, Auditor, Converter, EventSelectorDataStream, IFactory, PropertyMgr, SelectStatement, and Service.
virtual unsigned long IInterface::release | ( | ) | [pure virtual, inherited] |
Release Interface instance.
Implemented in Algorithm, AlgTool, Auditor, Converter, EventSelectorDataStream, IFactory, PropertyMgr, SelectStatement, and Service.