1 #ifndef ABLATELIBRARY_MAPPARAMETERS_HPP
2 #define ABLATELIBRARY_MAPPARAMETERS_HPP
4 #include <initializer_list>
9 #include "parameters.hpp"
11 namespace ablate::parameters {
14 std::map<std::string, std::string> values;
22 Parameter(std::string_view key, T value) : key{key} {
41 explicit MapParameters(std::map<std::string, std::string> values = {});
48 [[nodiscard]] std::optional<std::string>
GetString(std::string paramName)
const override;
54 [[nodiscard]] std::unordered_set<std::string>
GetKeys()
const override;
60 [[nodiscard]]
const std::map<std::string, std::string>&
GetMap()
const {
return values; }
69 void Insert(std::string key, T value) {
73 values[key] = ss.str();
81 static std::shared_ptr<MapParameters>
Create(std::initializer_list<Parameter>);
87 static std::shared_ptr<MapParameters>
Create(
const std::map<std::string, std::string>& values);
Definition: mapParameters.hpp:12
static std::shared_ptr< MapParameters > Create(std::initializer_list< Parameter >)
Definition: mapParameters.cpp:28
const std::map< std::string, std::string > & GetMap() const
Definition: mapParameters.hpp:60
MapParameters(std::initializer_list< Parameter >)
Definition: mapParameters.cpp:22
void Insert(std::string key, T value)
Definition: mapParameters.hpp:69
std::unordered_set< std::string > GetKeys() const override
Definition: mapParameters.cpp:14
std::optional< std::string > GetString(std::string paramName) const override
Definition: mapParameters.cpp:6
Definition: parameters.hpp:15
Definition: mapParameters.hpp:20