![]() |
ATLAS Offline Software
|
an object that can create a AsgService More...
#include <AsgServiceConfig.h>
Public Member Functions | |
| AsgServiceConfig ()=default | |
| standard constructor | |
| AsgServiceConfig (const std::string &val_typeAndName) | |
| initializing constructor | |
| AsgServiceConfig (const AsgComponentConfig &val_config) | |
| initializing constructor | |
| virtual | ~AsgServiceConfig ()=default |
| Virtual destructor, to make PyROOT happy. | |
| template<typename T> | |
| ::StatusCode | makeService (std::shared_ptr< T > &service) const |
| template<typename T> | |
| ::StatusCode | makeService (ServiceHandle< T > &service) const |
| bool | empty () const noexcept |
| whether all properties are unset | |
| const std::string & | type () const noexcept |
| the type of the component | |
| void | setType (const std::string &val_type) |
| set the value of type | |
| const std::string & | name () const noexcept |
| the name of the component | |
| void | setName (const std::string &val_name) |
| set the value of name | |
| std::string | typeAndName () const |
| get type and name at the same time | |
| void | setTypeAndName (const std::string &val_typeAndName) |
| set type and name at the same time | |
| template<typename T> | |
| StatusCode | setProperty (const std::string &name, const T &value) |
| set the given property | |
| template<typename T> | |
| StatusCode | setProperty (const std::string &name, const Gaudi::Property< T > &value) |
| void | setPropertyFromString (const std::string &name, const std::string &value) |
| set a given property from a string value | |
| StatusCode | createPrivateTool (const std::string &name, const std::string &toolType) |
| create a private tool of the given name and type | |
| StatusCode | addPrivateTool (const std::string &name, AsgComponentConfig toolConfig) |
| add a private tool from the given configuration | |
| std::string | createPrivateToolInArray (const std::string &name, const std::string &toolType) |
| the array version of createPrivateTool | |
| std::string | addPrivateToolInArray (const std::string &name, AsgComponentConfig toolConfig) |
| the array version of addPrivateTool | |
| StatusCode | configureComponentExpert (const std::string &prefix, bool nestedNames) const |
| add component configuration to configuration service (expert only) | |
| template<typename T> | |
| ::StatusCode | makeService (std::shared_ptr< T > &service) const |
| make a service with the given configuration | |
| template<typename T> | |
| ::StatusCode | makeService (ServiceHandle< T > &service) const |
Private Member Functions | |
| StatusCode | checkTypeName (bool nestedNames) const |
| check that the type and name members have the correct format | |
| AccessSubtoolData | accessSubtool (const std::string &name, std::size_t split) |
Private Attributes | |
| std::string | m_type |
| the value of type | |
| std::string | m_name |
| the value of name | |
| std::map< std::string, details::AsgComponentPrivateToolConfig > | m_privateTools |
| the map of (private) tools to create | |
| std::map< std::string, std::vector< std::string > > | m_toolArrays |
| the map of (private) tool handle arrays to manage, and the tools they contain | |
| std::map< std::string, std::string > | m_propertyValues |
| the map of property values | |
an object that can create a AsgService
Definition at line 24 of file AsgServiceConfig.h.
|
default |
standard constructor
|
explicit |
initializing constructor
Definition at line 24 of file AsgServiceConfig.cxx.
|
explicit |
initializing constructor
Definition at line 31 of file AsgServiceConfig.cxx.
|
virtualdefault |
|
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 385 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::AsgServiceConfig::makeService | ( | ServiceHandle< T > & | service | ) | const |
| ::StatusCode asg::AsgServiceConfig::makeService | ( | ServiceHandle< T > & | service | ) | const |
Definition at line 166 of file AsgServiceConfig.h.
| ::StatusCode asg::AsgServiceConfig::makeService | ( | std::shared_ptr< T > & | service | ) | const |
make a service with the given configuration
\warn This is mostly meant as a low level interface to be used in unit tests and internally by framework functions that manage services. As a user you should mostly rely on the python configuration or on passing the AsgServiceConfig object to your framework, which will then create and manage the service for you.
\warn Regardless of which function you use, the memory management and cleanup of services differs between stand-alone use and Athena. In EventLoop you receive an owning pointer/handle that can be shared with other users and will release the service when the last reference is deleted. In Athena the framework itself will hold on to the service (or at least its configuration) and release it at the end of the job, even if no user code references it. As a user you should not rely on the service still being around after you destroy the last reference, or on the service being around after framework teardown has started.
| ::StatusCode asg::AsgServiceConfig::makeService | ( | std::shared_ptr< T > & | service | ) | const |
Definition at line 145 of file AsgServiceConfig.h.
|
noexceptinherited |
|
inherited |
set the value of name
Definition at line 97 of file AsgComponentConfig.cxx.
|
inherited |
|
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 281 of file AsgComponentConfig.h.
|
privateinherited |
the map of (private) tools to create
Definition at line 284 of file AsgComponentConfig.h.
|
privateinherited |
the map of property values
Definition at line 291 of file AsgComponentConfig.h.
|
privateinherited |
the map of (private) tool handle arrays to manage, and the tools they contain
Definition at line 288 of file AsgComponentConfig.h.
|
privateinherited |
the value of type
Definition at line 278 of file AsgComponentConfig.h.