ATLAS Offline Software
|
an object that can create a AsgTool More...
#include <AsgToolConfig.h>
Public Member Functions | |
AsgToolConfig ()=default | |
standard constructor More... | |
AsgToolConfig (const std::string &val_typeAndName) | |
initializing constructor More... | |
AsgToolConfig (const AsgComponentConfig &val_config) | |
initializing constructor More... | |
template<typename T > | |
::StatusCode | makeTool (ToolHandle< T > &toolHandle, std::shared_ptr< void > &cleanup, bool allowNestedName=false) const |
make a tool with the given configuration More... | |
template<typename T > | |
::StatusCode | makePrivateTool (ToolHandle< T > &toolHandle) const |
make a private tool with the given configuration More... | |
template<typename T > | |
::StatusCode | makeTool (ToolHandle< T > &toolHandle, std::shared_ptr< void > &, bool allowNestedName) const |
template<typename T > | |
::StatusCode | makePrivateTool (ToolHandle< T > &toolHandle) const |
bool | empty () const noexcept |
whether all properties are unset More... | |
const std::string & | type () const noexcept |
the type of the component More... | |
void | setType (const std::string &val_type) |
set the value of type More... | |
const std::string & | name () const noexcept |
the name of the component More... | |
void | setName (const std::string &val_name) |
set the value of name More... | |
std::string | typeAndName () const |
get type and name at the same time More... | |
void | setTypeAndName (const std::string &val_typeAndName) |
set type and name at the same time More... | |
template<typename T > | |
StatusCode | setProperty (const std::string &name, const T &value) |
set the given property More... | |
void | setPropertyFromString (const std::string &name, const std::string &value) |
set a given property from a string value More... | |
StatusCode | createPrivateTool (const std::string &name, const std::string &toolType) |
create a private tool of the given name and type More... | |
StatusCode | addPrivateTool (const std::string &name, AsgComponentConfig toolConfig) |
add a private tool from the given configuration More... | |
std::string | createPrivateToolInArray (const std::string &name, const std::string &toolType) |
the array version of createPrivateTool More... | |
std::string | addPrivateToolInArray (const std::string &name, AsgComponentConfig toolConfig) |
the array version of addPrivateTool More... | |
StatusCode | configureComponentExpert (const std::string &prefix, bool nestedNames) const |
add component configuration to configuration service (expert only) More... | |
Private Member Functions | |
StatusCode | checkTypeName (bool nestedNames) const |
check that the type and name members have the correct format More... | |
Private Attributes | |
std::string | m_type |
the value of type More... | |
std::string | m_name |
the value of name More... | |
std::map< std::string, details::AsgComponentPrivateToolConfig > | m_privateTools |
the map of (private) tools to create More... | |
std::map< std::string, std::vector< std::string > > | m_toolArrays |
the map of (private) tool handle arrays to manage, and the tools they contain More... | |
std::map< std::string, std::string > | m_propertyValues |
the map of property values More... | |
an object that can create a AsgTool
Definition at line 21 of file AsgToolConfig.h.
|
default |
standard constructor
|
explicit |
initializing constructor
Definition at line 24 of file AsgToolConfig.cxx.
|
explicit |
initializing constructor
Definition at line 31 of file AsgToolConfig.cxx.
|
privateinherited |
Definition at line 239 of file AsgComponentConfig.cxx.
|
inherited |
add a private tool from the given configuration
This will ignore the name set in toolConfig
and use whatever name
is given instead.
Definition at line 167 of file AsgComponentConfig.cxx.
|
inherited |
the array version of addPrivateTool
This will ignore the name set in toolConfig
and use whatever name
is given instead.
Definition at line 188 of file AsgComponentConfig.cxx.
|
privateinherited |
check that the type and name members have the correct format
Definition at line 213 of file AsgComponentConfig.cxx.
|
inherited |
add component configuration to configuration service (expert only)
In Athena we are not creating components (we leave that to the proper Athena services), but instead we load the configuration values up first, then ask for the component to be created the normal way. This makes sure that if we dump the configuration it will include this component, and as a bonus it avoids the whole issue of having to deal with Athena factory functions.
Definition at line 364 of file AsgComponentConfig.cxx.
|
inherited |
create a private tool of the given name and type
This is the only way you can configure tool properties through AsgComponentConfig: You need to add it the tool to the component configuration and then you can set individual properties on the tool, using the property name "tool.property".
If you want to add a subtool for a tool, you can do this by calling it "tool.subtool". Note that you will have to create both the tool and the subtool this way, i.e. you can't configure a subtool without also configuring the tool that owns it.
You can apply this to tools held by either ToolHandle or asg::AnaToolHandle, but if you configure a tool held by an AnaToolHandle this way it will completely replace teh tool configuration done in the component itself.
The calling convention is somewhat inverted compared to setTypeAndName() calls, but otherwise they would be inverted compared to the setProperty() calls. :(
Definition at line 149 of file AsgComponentConfig.cxx.
|
inherited |
the array version of createPrivateTool
This returns the actual name of the tool to allow setting properties on it.
Definition at line 158 of file AsgComponentConfig.cxx.
|
noexceptinherited |
whether all properties are unset
Definition at line 63 of file AsgComponentConfig.cxx.
::StatusCode asg::AsgToolConfig::makePrivateTool | ( | ToolHandle< T > & | toolHandle | ) | const |
make a private tool with the given configuration
This requires a parent pointer to be set on the ToolHandle to work, and for the parent to derive from AsgComponent in AnalysisBase. That allows to attach the cleanup of the tool to the parent component.
For practical purposes, when using an AsgToolConfig to create a private tool owned by a parent tool/algorithm inside the initialize of the tool/algorithm, this is the preferred way of doing so.
::StatusCode asg::AsgToolConfig::makePrivateTool | ( | ToolHandle< T > & | toolHandle | ) | const |
Definition at line 188 of file AsgToolConfig.h.
::StatusCode asg::AsgToolConfig::makeTool | ( | ToolHandle< T > & | toolHandle, |
std::shared_ptr< void > & | , | ||
bool | allowNestedName | ||
) | const |
Definition at line 171 of file AsgToolConfig.h.
::StatusCode asg::AsgToolConfig::makeTool | ( | ToolHandle< T > & | toolHandle, |
std::shared_ptr< void > & | cleanup, | ||
bool | allowNestedName = false |
||
) | const |
make a tool with the given configuration
Note that the exact creational patterns are not determined yet (25 Mar 20), but presumably if you are using EventLoop you would rely on EventLoop to create your tool from this object. For use within unit tests we may use this method, but we may also change the signature.
We may also use this class as a replacement for AnaToolHandle in which case this would at least have to be updated to at the very least work on a ToolHandle, but so far this code isn't even dual-use.
The argument allowNestedName
should probably be omitted in most cases. I mostly added it to allow AnaToolHandle to create new tools via an AsgToolConfig (06 Jan 21), for which a number of existing users rely on making nested names. Usually when you want a nested name you ought to set the parent on the ToolHandle
and then use a non-nested name for the name of the config.
|
noexceptinherited |
|
inherited |
set the value of name
Definition at line 97 of file AsgComponentConfig.cxx.
|
inherited |
set the given property
|
inherited |
set a given property from a string value
Definition at line 132 of file AsgComponentConfig.cxx.
|
inherited |
set the value of type
Definition at line 81 of file AsgComponentConfig.cxx.
|
inherited |
set type and name at the same time
Definition at line 115 of file AsgComponentConfig.cxx.
|
noexceptinherited |
|
inherited |
|
privateinherited |
the value of name
Definition at line 278 of file AsgComponentConfig.h.
|
privateinherited |
the map of (private) tools to create
Definition at line 281 of file AsgComponentConfig.h.
|
privateinherited |
the map of property values
Definition at line 288 of file AsgComponentConfig.h.
|
privateinherited |
the map of (private) tool handle arrays to manage, and the tools they contain
Definition at line 285 of file AsgComponentConfig.h.
|
privateinherited |
the value of type
Definition at line 275 of file AsgComponentConfig.h.