ATLAS Offline Software
Loading...
Searching...
No Matches
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
22namespace 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:
120 template<typename T> StatusCode
121 setProperty (const std::string& name, const T& value);
122 template<typename T> StatusCode
123 setProperty (const std::string& name, const Gaudi::Property<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
240 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
263 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
308 struct AccessSubtoolData final
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
328
329 } // namespace details
330} // namespace asg
331
332#include "AsgComponentConfig.icc"
333
334#endif
Support class for PropertyMgr.
Definition Property.h:23
an object that stores the configuration for an AsgComponent and is able to create one from it
std::string addPrivateToolInArray(const std::string &name, AsgComponentConfig toolConfig)
the array version of addPrivateTool
std::string typeAndName() const
get type and name at the same time
std::string m_type
the value of type
StatusCode setProperty(const std::string &name, const T &value)
set the given property
std::string createPrivateToolInArray(const std::string &name, const std::string &toolType)
the array version of createPrivateTool
std::map< std::string, std::string > m_propertyValues
the map of property values
StatusCode createPrivateTool(const std::string &name, const std::string &toolType)
create a private tool of the given name and type
bool empty() const noexcept
whether all properties are unset
std::map< std::string, details::AsgComponentPrivateToolConfig > m_privateTools
the map of (private) tools to create
const std::string & name() const noexcept
the name of the component
void setType(const std::string &val_type)
set the value of type
const std::string & type() const noexcept
the type of the component
void setTypeAndName(const std::string &val_typeAndName)
set type and name at the same time
StatusCode configureComponentExpert(const std::string &prefix, bool nestedNames) const
add component configuration to configuration service (expert only)
AsgComponentConfig()=default
standard constructor
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)
void setPropertyFromString(const std::string &name, const std::string &value)
set a given property from a string value
StatusCode addPrivateTool(const std::string &name, AsgComponentConfig toolConfig)
add a private tool from the given configuration
std::string m_name
the value of name
void setName(const std::string &val_name)
set the value of name
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::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177
=============================================================================
STL namespace.
access the configuration for the given subtool
Helper type with all necessary details about private tools.
AsgComponentConfig m_config
The configuration of the private tool.
std::string m_propName
The property name (?) of the private tool.