![]() |
The Gaudi Framework
master (42b00024)
|
#include <GaudiKernel/ToolHandle.h>
Public Member Functions | |
ToolHandle (const IInterface *parent=nullptr, bool createIf=true) | |
Constructor for a tool with default tool type and name. More... | |
template<typename CT = T, typename NCT = std::remove_const_t<T>> | |
requires (std::is_const_v< CT > &&!std::is_same_v< CT, NCT >) ToolHandle(const ToolHandle< NCT > &other) | |
Copy constructor from a non const T to const T tool handle. More... | |
ToolHandle (const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true) | |
Create a handle ('smart pointer') to a tool. More... | |
template<std::derived_from< IProperty > OWNER> | |
ToolHandle (OWNER *owner, std::string propName, std::string toolType, std::string doc="") | |
Autodeclaring constructor with property propName, tool type/name and documentation. More... | |
template<typename... Args> | |
ToolHandle (std::tuple< Args... > &&args) | |
StatusCode | initialize (const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true) |
StatusCode | retrieve () const override |
Retrieve the AlgTool. More... | |
StatusCode | retrieve (DisableTool sd) override |
StatusCode | retrieve (EnableTool sd) override |
StatusCode | release () const |
Release the AlgTool. More... | |
StatusCode | retrieve (T *&algTool) const override |
Do the real retrieval of the AlgTool. More... | |
StatusCode | release (T *algTool) const override |
Do the real release of the AlgTool. More... | |
std::string | typeAndName () const override |
std::add_const_t< T > * | get () const |
T * | get () |
![]() | |
StatusCode | retrieve (IAlgTool *&tool) const |
const IAlgTool * | get () const |
IAlgTool * | get () |
bool | isEnabled () const |
Helper to check if the ToolHandle should be retrieved. More... | |
void | enable () |
void | disable () |
bool | setEnabled (bool flag) |
![]() | |
virtual | ~ToolHandleInfo ()=default |
bool | isPublic () const noexcept |
bool | createIf () const noexcept |
const IInterface * | parent () const noexcept |
![]() | |
template<typename CT = T, typename NCT = std::remove_const_t<T>> | |
GaudiHandle (const GaudiHandle< NCT > &other) requires(std | |
Copy constructor needed for correct ref-counting. More... | |
GaudiHandle (const GaudiHandle &other) | |
Copy constructor needed for correct ref-counting. More... | |
template<typename CT = T, typename NCT = std::remove_const_t<T>> | |
requires (std::is_const_v< CT > &&!std::is_same_v< CT, NCT >) GaudiHandle &operator | |
Assignment operator for correct ref-counting. More... | |
![]() | |
const 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 (std::string myTypeAndName) |
The component "type/name" string. More... | |
void | setName (std::string_view myName) |
Set the instance name (part after the '/') without changing the class type. More... | |
std::string | pythonPropertyClassName () const override |
Name of the componentType with "Handle" appended. More... | |
std::string | messageName () const |
name used for printing messages More... | |
std::string | pythonRepr () const override |
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 (std::string propName) |
set name as used in declareProperty(name,gaudiHandle). More... | |
const std::string & | parentName () const |
The name of the parent. More... | |
Protected Member Functions | |
const IAlgTool * | getAsIAlgTool () const override |
IAlgTool * | getAsIAlgTool () override |
StatusCode | i_retrieve (IAlgTool *&algTool) const override |
![]() | |
BaseToolHandle (const IInterface *parent=nullptr, bool createIf=true) | |
![]() | |
ToolHandleInfo (const IInterface *parent=nullptr, bool createIf=true) | |
![]() | |
GaudiHandle (std::string myTypeAndName, std::string myComponentType, std::string myParentName) | |
![]() | |
GaudiHandleBase (std::string myTypeAndName, std::string myComponentType, std::string myParentName) | |
Create a handle ('smart pointer') to a gaudi component. More... | |
![]() | |
GaudiHandleInfo (std::string myComponentType, std::string myParentName) | |
Some basic information and helper functions shared between various handles/arrays. More... | |
void | setComponentType (std::string componentType) |
The component type. More... | |
void | setParentName (std::string parent) |
The name of the parent. More... | |
Private Member Functions | |
template<typename... Args, std::size_t... Is> | |
ToolHandle (std::tuple< Args... > &&args, std::index_sequence< Is... >) | |
Private Attributes | |
ServiceHandle< IToolSvc > | m_pToolSvc |
Friends | |
class | Gaudi::Algorithm |
class | AlgTool |
class | Service |
std::ostream & | operator<< (std::ostream &os, const ToolHandle< T > &handle) |
Additional Inherited Members | |
![]() | |
using | PropertyType = GaudiHandleProperty |
![]() | |
static std::string | toolComponentType (const IInterface *parent) |
static std::string | toolParentName (const IInterface *parent) |
![]() | |
bool | m_enabled = true |
![]() | |
const IInterface * | m_parent = nullptr |
bool | m_createIf { true } |
Handle to be used in lieu of naked pointers to tools. This allows better control through the framework of tool loading and usage. @paramater T is the AlgTool interface class (or concrete class) of the tool to use, and must derive from IAlgTool.
Definition at line 136 of file ToolHandle.h.
|
inlineprivate |
Definition at line 143 of file ToolHandle.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 150 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:
owner | class owning the ToolHandle |
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 194 of file ToolHandle.h.
|
inline |
Autodeclaring constructor with property propName, tool type/name and documentation.
Definition at line 203 of file ToolHandle.h.
|
inline |
Definition at line 214 of file ToolHandle.h.
|
inline |
Definition at line 281 of file ToolHandle.h.
|
inline |
Definition at line 279 of file ToolHandle.h.
|
inlineoverrideprotectedvirtual |
Implements BaseToolHandle.
Definition at line 288 of file ToolHandle.h.
|
inlineoverrideprotectedvirtual |
|
inlineoverrideprotectedvirtual |
Implements BaseToolHandle.
Definition at line 298 of file ToolHandle.h.
|
inline |
Definition at line 217 of file ToolHandle.h.
|
inline |
Release the AlgTool.
Function must be repeated here to avoid hiding the function release( T*& )
Definition at line 256 of file ToolHandle.h.
|
inlineoverridevirtual |
Do the real release of the AlgTool.
Reimplemented from GaudiHandle< T >.
Definition at line 275 of file ToolHandle.h.
|
inline |
Copy constructor from a non const T to const T tool handle.
Definition at line 157 of file ToolHandle.h.
|
inlineoverridevirtual |
Retrieve the AlgTool.
Release existing tool if needed. Function must be repeated here to avoid hiding the function retrieve( T*& )
Implements BaseToolHandle.
Definition at line 232 of file ToolHandle.h.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverride |
|
inlineoverridevirtual |
Definition at line 139 of file ToolHandle.h.
|
friend |
Definition at line 138 of file ToolHandle.h.
|
friend |
Definition at line 283 of file ToolHandle.h.
Definition at line 140 of file ToolHandle.h.
|
mutableprivate |
Definition at line 307 of file ToolHandle.h.