31 #ifndef DW_FRAMEWORK_JSONPARAMETERPROVIDER_HPP_ 32 #define DW_FRAMEWORK_JSONPARAMETERPROVIDER_HPP_ 36 #include <modern-json/json.hpp> 63 void setJson(nlohmann::json
const*
const data) noexcept;
66 nlohmann::json
data()
const noexcept;
73 nlohmann::json
const*
getJson(dw::core::StringView
const& key)
const;
76 bool getBool(dw::core::StringView
const& key,
void*
const out)
const;
78 bool getInt8(dw::core::StringView
const& key,
void*
const out)
const;
80 bool getInt16(dw::core::StringView
const& key,
void*
const out)
const;
82 bool getInt32(dw::core::StringView
const& key,
void*
const out)
const;
84 bool getInt64(dw::core::StringView
const& key,
void*
const out)
const;
86 bool getUint8(dw::core::StringView
const& key,
void*
const out)
const;
88 bool getUint16(dw::core::StringView
const& key,
void*
const out)
const;
90 bool getUint32(dw::core::StringView
const& key,
void*
const out)
const;
92 bool getUint64(dw::core::StringView
const& key,
void*
const out)
const;
94 bool getFloat32(dw::core::StringView
const& key,
void*
const out)
const;
96 bool getFloat64(dw::core::StringView
const& key,
void*
const out)
const;
98 bool getString(dw::core::StringView
const& key,
void*
const out)
const;
100 bool getStringView(dw::core::StringView
const& key,
void*
const out)
const;
103 bool getVectorBool(dw::core::StringView
const& key,
void*
const out)
const;
105 bool getVectorInt8(dw::core::StringView
const& key,
void*
const out)
const;
107 bool getVectorInt16(dw::core::StringView
const& key,
void*
const out)
const;
109 bool getVectorInt32(dw::core::StringView
const& key,
void*
const out)
const;
111 bool getVectorInt64(dw::core::StringView
const& key,
void*
const out)
const;
113 bool getVectorUint8(dw::core::StringView
const& key,
void*
const out)
const;
115 bool getVectorUint16(dw::core::StringView
const& key,
void*
const out)
const;
117 bool getVectorUint32(dw::core::StringView
const& key,
void*
const out)
const;
119 bool getVectorUint64(dw::core::StringView
const& key,
void*
const out)
const;
121 bool getVectorFloat32(dw::core::StringView
const& key,
void*
const out)
const;
123 bool getVectorFloat64(dw::core::StringView
const& key,
void*
const out)
const;
125 bool getVectorString(dw::core::StringView
const& key,
void*
const out)
const;
130 bool getBoolByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
132 bool getInt8ByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
134 bool getInt16ByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
136 bool getInt32ByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
138 bool getInt64ByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
140 bool getUint8ByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
142 bool getUint16ByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
144 bool getUint32ByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
146 bool getUint64ByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
148 bool getFloat32ByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
150 bool getFloat64ByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
152 bool getStringByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
154 bool getStringViewByIndex(dw::core::StringView
const& key,
size_t const index,
void*
const out)
const;
158 nlohmann::json
const* m_data;
164 #endif // DW_FRAMEWORK_JSONPARAMETERPROVIDER_HPP_ bool getFloat64(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a float64_t value.
JsonParameterProvider(JsonParameterProvider const &)=default
Copy constructor.
bool getVectorInt16(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of int16_t value.
bool getBool(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a bool value.
bool getUint32ByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a uint32_t value from an array by index.
void setJson(nlohmann::json const *const data) noexcept
Set the JSON data.
bool getUint64(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a uint64_t value.
bool getInt64ByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a int64_t value from an array by index.
bool getVectorFloat32(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of float32_t value.
bool getVectorUint32(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of uint32_t value.
nlohmann::json data() const noexcept
Get the JSON data.
bool getFloat32ByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a float32_t value from an array by index.
A parameter provider which dispatches the retrieval of the parameter value to registered handlers whi...
bool getVectorUint64(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of uint64_t value.
bool getVectorFloat64(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of float64_t value.
bool getUint16ByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a uint16_t value from an array by index.
A parameter provider which retrieves parameter values from JSON data.
bool getUint8(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a uint8_t value.
bool getVectorStringView(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of dw::core::StringView value.
bool getVectorUint8(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of uint8_t value.
bool getFloat32(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a float32_t value.
~JsonParameterProvider() override=default
Destructor.
JsonParameterProvider & operator=(JsonParameterProvider const &)=default
Copy assignment operator.
bool getInt32(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a int32_t value.
bool getVectorInt8(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of int8_t value.
bool getStringView(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a dw::core::StringView value.
bool getInt16(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a int16_t value.
bool getFloat64ByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a float64_t value from an array by index.
nlohmann::json const * getJson(dw::core::StringView const &key) const
Get JSON value for the passed key.
bool getUint32(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a uint32_t value.
bool getUint16(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a uint16_t value.
bool getInt32ByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a int32_t value from an array by index.
void registerAt(TypeBasedParameterProvider &provider) const override
bool getInt64(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a int64_t value.
bool getInt8(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a int8_t value.
bool getStringViewByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a dw::core::StringView value from an array by index. ...
bool getVectorInt32(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of int32_t value.
bool getVectorBool(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of bool value.
bool getStringByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a std::string value from an array by index.
bool getVectorString(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of std::string value.
bool getInt16ByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a int16_t value from an array by index.
bool getBoolByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a bool value from an array by index.
bool getVectorInt64(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of int64_t value.
bool getInt8ByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a int8_t value from an array by index.
bool getUint64ByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a uint64_t value from an array by index.
bool getString(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a std::string value.
bool getVectorUint16(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of uint16_t value.
bool getUint8ByIndex(dw::core::StringView const &key, size_t const index, void *const out) const
Handler function to retrieve a uint8_t value from an array by index.
The additional interface a ParameterProvider can implement so it can be registered at a TypeBasedPara...