63 std::list<std::uint32_t>
69 std::list<std::int32_t>
84 "Configuration element " + i.first +
85 " was not expected by the Device code but defined in HardwareConfig.",
93 template <
class... Ts>
96 using Ts::operator()...;
99 template <
class... Ts>
112 if (i != list.size())
117 s <<
"}" << std::endl;
125 for (
int i = 0; i < indention; i++)
129 s <<
c.first <<
" (";
134 s << arg << std::endl;
139 s << arg << std::endl;
141 [&s](std::uint32_t arg)
144 s << arg << std::endl;
146 [&s](std::int32_t arg)
149 s << arg << std::endl;
154 s << arg << std::endl;
158 s <<
"LinearConvertedValue): factor=" << arg.getFactor()
159 <<
" offset=" << arg.getOffset() << std::endl;
163 s <<
"ModularConvertedValueConfig): "
164 <<
"zeroOffset=" << arg.getZeroOffset() << std::endl;
166 [&s](std::string arg)
169 s << arg << std::endl;
171 [&s](std::list<bool> arg)
176 [&s](std::list<float> arg)
181 [&s](std::list<std::uint32_t> arg)
186 [&s](std::list<std::int32_t> arg)
192 s <<
"Matrix<Float>):" << std::endl << arg << std::endl;
195 s <<
"Matrix<UInt>):" << std::endl << arg << std::endl;
198 s <<
"Matrix<Int>):" << std::endl << arg << std::endl;
285 std::shared_ptr<Config> controllerConfig)
318 for (
auto& i :
items)
320 i.second.isRead =
false;
327 std::stringstream ss;
328 ss << message << std::endl <<
"Context:" << std::endl;
329 context.
print(ss, 0);
The ConfigElementNotFoundError class represents an error that is thrown when trying to get a config v...
The Config class is the base class of all specialized configurations that have a direct key -> value ...
void setModularConvertedValueConfig(const std::string name, types::ModularConvertedValueConfig &&value, ConfigTag tag)
std::list< std::int32_t > getIntList(const std::string name)
Get a IntList (std::list<std::int32_t>) typed Config attribute by name.
std::string getString(const std::string name)
Get a String typed Config attribute by name.
void setInt(const std::string name, std::int32_t value, ConfigTag tag)
virtual void print(std::stringstream &s, int indention) const
Print this configuration.
types::LinearConfig getLinearConfig(const std::string name)
Get a LinearConvertedValue typed Config attribute by name.
void setBool(const std::string name, bool value, ConfigTag tag)
float getFloat(const std::string name)
Get a Float typed Config attribute by name.
T get(const std::string name)
virtual void onParsingFinished()
This method is called when the config is completely read form the HardwareConfig file.
void setFloatList(const std::string name, std::list< float > value, ConfigTag tag)
void set(const std::string name, T value, ConfigTag tag)
std::list< bool > getBoolList(const std::string name)
Get a BoolList (std::list<bool>) typed Config attribute by name.
types::ModularConvertedValueConfig getModularConvertedValueConfig(const std::string &name)
Get a ModularConvertedValue typed Config attribute by name.
std::uint32_t getUint(const std::string name)
Get a Uint (std::uint32_t) typed Config attribute by name.
virtual bool checkAllItemsRead(std::vector< std::string > &errors) const
This method is called once the device has read the configuration data it needs.
bool getBool(const std::string name)
Get a Bool typed Config attribute by name.
std::list< std::uint32_t > getUintList(const std::string name)
Get a UIntList (std::list<std::uint32_t>) typed Config attribute by name.
void setString(const std::string name, std::string value, ConfigTag tag)
std::map< std::string, ConfigItemWithMetadata > items
void setUint(const std::string name, std::uint32_t value, ConfigTag tag)
void setLinearConfig(const std::string name, types::LinearConfig &&value, ConfigTag tag)
std::list< float > getFloatList(const std::string name)
Get a FloatList (std::list<float>) typed Config attribute by name.
void setUintList(const std::string name, std::list< std::uint32_t > value, ConfigTag tag)
void setBoolList(const std::string name, std::list< bool > value, ConfigTag tag)
void setIntList(const std::string name, std::list< std::int32_t > value, ConfigTag tag)
void setFloat(const std::string name, float value, ConfigTag tag)
std::int32_t getInt(const std::string name)
Get a Int (std::int32_t) typed Config attribute by name.
void addControllerConfig(const std::string controllerName, std::shared_ptr< Config > controllerConfig)
Add a Config for a controller with name.
std::map< std::string, std::shared_ptr< Config > > controllerConfigs
Config & getControllerConfig(const std::string controllerName)
The LinearConfig class represents a linear conversion and has a factor and offset.
overloaded(Ts...) -> overloaded< Ts... >
std::string createErrorMessageWithContext(std::string message, const Config &context)
Create an error message that prints part of the current Config object to make it easiier to find the ...
void printList(std::stringstream &s, std::list< T > list)
ConfigTag
The ConfigTag is used when setting a config value.
std::string tagName(ConfigTag tag)
std::string Variant::get< std::string >() const
void Variant::set< std::uint32_t >(const std::uint32_t &value)
std::int32_t Variant::get< std::int32_t >() const
void Variant::set< std::string >(const std::string &value)
void Variant::set< std::int32_t >(const std::int32_t &value)
std::uint32_t Variant::get< std::uint32_t >() const