Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
AsgComponentConfig.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 
9 #ifndef ASG_TOOLS__ASG_COMPONENT_CONFIG_H
10 #define ASG_TOOLS__ASG_COMPONENT_CONFIG_H
11 
12 // Athena include(s).
15 
16 // System include(s).
17 #include <map>
18 #include <memory>
19 #include <string>
20 #include <vector>
21 
22 namespace asg
23 {
25  namespace details
26  {
27  // Forward declaration of the private tool configuration type
29  }
30 
33 
35  {
36  //
37  // public interface
38  //
39 
45  public:
46  AsgComponentConfig () = default;
47 
48 
54  public:
55  explicit AsgComponentConfig (const std::string& val_typeAndName);
56 
57 
61  public:
62  bool empty () const noexcept;
63 
64 
68  public:
69  const std::string& type () const noexcept;
70 
76  public:
77  void setType (const std::string& val_type);
78 
79 
83  public:
84  const std::string& name () const noexcept;
85 
91  public:
92  void setName (const std::string& val_name);
93 
94 
100  public:
101  std::string typeAndName () const;
102 
103 
109  public:
110  void setTypeAndName (const std::string& val_typeAndName);
111 
112 
119  public:
121  setProperty (const std::string& name, const T& value);
124 
125 
131  public:
132  void setPropertyFromString (const std::string& name,
133  const std::string& value);
134 
135 
163  public:
164  StatusCode createPrivateTool (const std::string& name,
165  const std::string& toolType);
166 
167 
177  public:
178  StatusCode addPrivateTool (const std::string& name,
179  AsgComponentConfig toolConfig);
180 
181 
191  public:
192  std::string createPrivateToolInArray (const std::string& name,
193  const std::string& toolType);
194 
195 
205  public:
206  std::string addPrivateToolInArray (const std::string& name,
207  AsgComponentConfig toolConfig);
208 
209 
210 
211 #ifdef XAOD_STANDALONE
212  public:
241  template<typename T> StatusCode
242  makeComponentExpert (std::unique_ptr<T>& component,
243  const std::string& newCommand,
244  bool nestedNames, std::string prefix) const;
245 #endif
246 
247 
248 #ifndef XAOD_STANDALONE
249  public:
264  StatusCode
265  configureComponentExpert (const std::string& prefix,
266  bool nestedNames) const;
267 #endif
268 
269 
270 
271  //
272  // private interface
273  //
274 
275  private:
276 
278  std::string m_type;
279 
281  std::string m_name;
282 
284  std::map<std::string, details::AsgComponentPrivateToolConfig> m_privateTools;
285 
288  std::map<std::string,std::vector<std::string>> m_toolArrays;
289 
291  std::map<std::string,std::string> m_propertyValues;
292 
293 
299  StatusCode checkTypeName (bool nestedNames) const;
300 
301 
309  {
311  std::string prefix;
312  std::string name;
313  };
314  AccessSubtoolData accessSubtool (const std::string& name,
315  std::size_t split);
317  };
318 
319  namespace details {
320 
326  std::string m_propName;
327  };
328 
329  } // namespace details
330 } // namespace asg
331 
332 #include "AsgComponentConfig.icc"
333 
334 #endif
asg::AsgComponentConfig
an object that stores the configuration for an AsgComponent and is able to create one from it
Definition: AsgComponentConfig.h:35
PropertyWrapper.h
asg::AsgComponentConfig::setType
void setType(const std::string &val_type)
set the value of type
Definition: AsgComponentConfig.cxx:82
asg::AsgComponentConfig::empty
bool empty() const noexcept
whether all properties are unset
Definition: AsgComponentConfig.cxx:64
asg::AsgComponentConfig::m_propertyValues
std::map< std::string, std::string > m_propertyValues
the map of property values
Definition: AsgComponentConfig.h:291
taskman.template
dictionary template
Definition: taskman.py:317
asg
Definition: DataHandleTestTool.h:28
asg::AsgComponentConfig::m_name
std::string m_name
the value of name
Definition: AsgComponentConfig.h:281
athena.value
value
Definition: athena.py:124
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
asg::AsgComponentConfig::m_toolArrays
std::map< std::string, std::vector< std::string > > m_toolArrays
the map of (private) tool handle arrays to manage, and the tools they contain
Definition: AsgComponentConfig.h:288
Property
Support class for PropertyMgr.
Definition: Property.h:23
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
asg::details::AsgComponentPrivateToolConfig::m_propName
std::string m_propName
The property name (?) of the private tool.
Definition: AsgComponentConfig.h:326
asg::AsgComponentConfig::AsgComponentConfig
AsgComponentConfig()=default
standard constructor
asg::AsgComponentConfig::m_type
std::string m_type
the value of type
Definition: AsgComponentConfig.h:278
asg::AsgComponentConfig::checkTypeName
StatusCode checkTypeName(bool nestedNames) const
check that the type and name members have the correct format
Definition: AsgComponentConfig.cxx:214
AsgComponentConfig.icc
details
Definition: IParticleWriter.h:21
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
asg::details::AsgComponentPrivateToolConfig::m_config
AsgComponentConfig m_config
The configuration of the private tool.
Definition: AsgComponentConfig.h:324
asg::AsgComponentConfig::AccessSubtoolData::name
std::string name
Definition: AsgComponentConfig.h:312
asg::AsgComponentConfig::addPrivateToolInArray
std::string addPrivateToolInArray(const std::string &name, AsgComponentConfig toolConfig)
the array version of addPrivateTool
Definition: AsgComponentConfig.cxx:189
asg::AsgComponentConfig::type
const std::string & type() const noexcept
the type of the component
Definition: AsgComponentConfig.cxx:74
StatusCode.h
asg::AsgComponentConfig::createPrivateToolInArray
std::string createPrivateToolInArray(const std::string &name, const std::string &toolType)
the array version of createPrivateTool
Definition: AsgComponentConfig.cxx:159
asg::AsgComponentConfig::setTypeAndName
void setTypeAndName(const std::string &val_typeAndName)
set type and name at the same time
Definition: AsgComponentConfig.cxx:116
columnar::final
CM final
Definition: ColumnAccessor.h:106
python.Dumpers.typename
def typename(t)
Definition: Dumpers.py:194
asg::AsgComponentConfig::configureComponentExpert
StatusCode configureComponentExpert(const std::string &prefix, bool nestedNames) const
add component configuration to configuration service (expert only)
Definition: AsgComponentConfig.cxx:365
asg::AsgComponentConfig::AccessSubtoolData
access the configuration for the given subtool
Definition: AsgComponentConfig.h:309
asg::AsgComponentConfig::AccessSubtoolData::prefix
std::string prefix
Definition: AsgComponentConfig.h:311
asg::AsgComponentConfig::setName
void setName(const std::string &val_name)
set the value of name
Definition: AsgComponentConfig.cxx:98
asg::AsgComponentConfig::setProperty
StatusCode setProperty(const std::string &name, const T &value)
set the given property
asg::AsgComponentConfig::typeAndName
std::string typeAndName() const
get type and name at the same time
Definition: AsgComponentConfig.cxx:106
asg::AsgComponentConfig::setPropertyFromString
void setPropertyFromString(const std::string &name, const std::string &value)
set a given property from a string value
Definition: AsgComponentConfig.cxx:133
Gaudi
=============================================================================
Definition: CaloGPUClusterAndCellDataMonitorOptions.h:273
asg::details::AsgComponentPrivateToolConfig
Helper type with all necessary details about private tools.
Definition: AsgComponentConfig.h:322
asg::AsgComponentConfig::name
const std::string & name() const noexcept
the name of the component
Definition: AsgComponentConfig.cxx:90
asg::AsgComponentConfig::addPrivateTool
StatusCode addPrivateTool(const std::string &name, AsgComponentConfig toolConfig)
add a private tool from the given configuration
Definition: AsgComponentConfig.cxx:168
asg::AsgComponentConfig::accessSubtool
AccessSubtoolData accessSubtool(const std::string &name, std::size_t split)
Definition: AsgComponentConfig.cxx:240
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
asg::AsgComponentConfig::createPrivateTool
StatusCode createPrivateTool(const std::string &name, const std::string &toolType)
create a private tool of the given name and type
Definition: AsgComponentConfig.cxx:150
asg::AsgComponentConfig::m_privateTools
std::map< std::string, details::AsgComponentPrivateToolConfig > m_privateTools
the map of (private) tools to create
Definition: AsgComponentConfig.h:284