![]() |
The Gaudi Framework
v25r3
|
Handle to be used in lieu of naked pointers to tools. More...
#include <GaudiKernel/ToolHandle.h>
Public Member Functions | |
ToolHandle (const IInterface *parent=0, bool createIf=true) | |
Constructor for a tool with default tool type and name. More... | |
ToolHandle (const std::string &toolTypeAndName, const IInterface *parent=0, bool createIf=true) | |
Create a handle ('smart pointer') to a tool. More... | |
StatusCode | retrieve () const |
Retrieve the AlgTool. More... | |
StatusCode | release () const |
Release the AlgTool. More... | |
virtual StatusCode | retrieve (T *&algTool) const |
Do the real retrieval of the AlgTool. More... | |
virtual StatusCode | release (T *algTool) const |
Do the real release of the AlgTool. More... | |
![]() | |
virtual | ~ToolHandleInfo () |
bool | isPublic () const |
bool | createIf () const |
const IInterface * | parent () const |
const std::string | toolComponentType (const IInterface *parent) const |
const std::string | toolParentName (const IInterface *parent) const |
![]() | |
GaudiHandle (const GaudiHandle &other) | |
Copy constructor needed for correct ref-counting. More... | |
GaudiHandle & | operator= (const GaudiHandle &other) |
Assignment operator for correct ref-counting. More... | |
StatusCode | retrieve () const |
Retrieve the component. More... | |
StatusCode | release () const |
Release the component. More... | |
operator bool () const | |
For testing if handle has component. More... | |
T & | operator* () |
T * | operator-> () |
T & | operator* () const |
T * | operator-> () const |
std::string | getDefaultType () |
Helper function to get default type string from the class type. More... | |
std::string | getDefaultName () |
![]() | |
std::string | typeAndName () const |
The full type and name: "type/name". More... | |
std::string | type () const |
The concrete component class name: the part before the '/'. More... | |
std::string | name () const |
The instance name: the part after the '/'. More... | |
bool | empty () const |
Check if the handle has been set to empty string (i.e. More... | |
void | setTypeAndName (const std::string &myTypeAndName) |
The component "type/name" string. More... | |
void | setName (const std::string &myName) |
Set the instance name (part after the '/') without changing the class type. More... | |
const std::string | pythonPropertyClassName () const |
Name of the componentType with "Handle" appended. More... | |
const std::string | messageName () const |
name used for printing messages More... | |
virtual const std::string | pythonRepr () const |
Python representation of handle, i.e. More... | |
![]() | |
virtual | ~GaudiHandleInfo () |
virtual destructor so that derived class destructor is called. More... | |
const std::string & | componentType () const |
const std::string & | propertyName () const |
name as used in declareProperty(name,gaudiHandle) More... | |
void | setPropertyName (const std::string &propName) |
set name as used in declareProperty(name,gaudiHandle). More... | |
const std::string & | parentName () const |
The name of the parent. More... | |
Private Attributes | |
ServiceHandle< IToolSvc > | m_pToolSvc |
Additional Inherited Members | |
![]() | |
ToolHandleInfo (const IInterface *parent=0, bool createIf=true) | |
![]() | |
GaudiHandle (const std::string &myTypeAndName, const std::string &myComponentType, const std::string &myParentName) | |
![]() | |
GaudiHandleBase (const std::string &myTypeAndName, const std::string &myComponentType, const std::string &myParentName) | |
Create a handle ('smart pointer') to a gaudi component. More... | |
![]() | |
GaudiHandleInfo (const std::string &myComponentType, const std::string &myParentName) | |
Some basic information and helper functions shared between various handles/arrays. More... | |
Handle to be used in lieu of naked pointers to tools.
This allows better control through the framework of tool loading and usage. T is the AlgTool interface class (or concrete class) of the tool to use, and must derive from IAlgTool.
Definition at line 24 of file PropertyMgr.h.
|
inline |
Constructor for a tool with default tool type and name.
Can be called only if the type T is a concrete tool type (not an interface), and you want to use the default name.
Definition at line 88 of file ToolHandle.h.
|
inline |
Create a handle ('smart pointer') to a tool.
The arguments are passed on to ToolSvc, and have the same meaning:
toolType | "MyToolType/MyToolName" "MyToolType" is short for "MyToolType/MyToolType" 'MyToolType' is the name of the class of the concrete tool 'MyToolName' is to distinguish several tool instances of the same class |
parent | the parent Algorithm,Tool or Service of which this tool is a member. If non-zero, the the tool is a private tool of the parent, otherwise it is a public (shared) tool. |
createIf | if true, create tool if not yet existing. |
Definition at line 113 of file ToolHandle.h.
|
inline |
Release the AlgTool.
Function must be repeated here to avoid hiding the function release( T*& )
Definition at line 129 of file ToolHandle.h.
|
inlinevirtual |
Do the real release of the AlgTool.
Reimplemented from GaudiHandle< T >.
Definition at line 141 of file ToolHandle.h.
|
inline |
Retrieve the AlgTool.
Release existing tool if needed. Function must be repeated here to avoid hiding the function retrieve( T*& )
Definition at line 123 of file ToolHandle.h.
|
inlinevirtual |
Do the real retrieval of the AlgTool.
Implements GaudiHandle< T >.
Definition at line 134 of file ToolHandle.h.
|
mutableprivate |
Definition at line 149 of file ToolHandle.h.