31#ifndef DW_FRAMEWORK_JSONPARAMETERPROVIDER_HPP_
32#define DW_FRAMEWORK_JSONPARAMETERPROVIDER_HPP_
36#include <modern-json/json.hpp>
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;
128 bool getBoolByIndex(
dw::core::StringView const& key,
size_t const index,
void* const out) const;
130 bool getInt8ByIndex(
dw::core::StringView const& key,
size_t const index,
void* const out) const;
132 bool getInt16ByIndex(
dw::core::StringView const& key,
size_t const index,
void* const out) const;
134 bool getInt32ByIndex(
dw::core::StringView const& key,
size_t const index,
void* const out) const;
136 bool getInt64ByIndex(
dw::core::StringView const& key,
size_t const index,
void* const out) const;
138 bool getUint8ByIndex(
dw::core::StringView const& key,
size_t const index,
void* const out) const;
154 nlohmann::json const* m_data;
The additional interface a ParameterProvider can implement so it can be registered at a TypeBasedPara...
A parameter provider which retrieves parameter values from JSON data.
bool getInt8(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a int8_t value.
nlohmann::json data() const noexcept
Get the JSON data.
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 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 getUint8(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a uint8_t value.
~JsonParameterProvider() override=default
Destructor.
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.
bool getVectorStringView(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of dw::core::StringView value.
bool getUint64(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a uint64_t value.
bool getFloat64(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a float64_t value.
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.
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 getVectorUint64(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of uint64_t value.
bool getVectorInt8(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of int8_t value.
bool getVectorUint32(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of uint32_t value.
bool getBool(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a bool value.
bool getInt32(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a int32_t value.
JsonParameterProvider(JsonParameterProvider const &)=default
Copy constructor.
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.
bool getInt64(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a int64_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 getStringView(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a dw::core::StringView value.
bool getVectorBool(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of bool value.
JsonParameterProvider(nlohmann::json const *const data) noexcept
Constructor.
bool getUint16(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a uint16_t value.
bool getVectorInt64(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of int64_t value.
bool getVectorFloat64(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of float64_t value.
bool getVectorInt32(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of int32_t value.
bool getVectorUint8(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of uint8_t value.
bool getVectorInt16(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of int16_t value.
bool getInt16(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a int16_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.
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 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.
JsonParameterProvider & operator=(JsonParameterProvider const &) &=default
Copy assignment operator.
bool getString(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a std::string value.
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.
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.
JsonParameterProvider(JsonParameterProvider &&)=default
Move constructor.
void setJson(nlohmann::json const *const data) noexcept
Set the JSON data.
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.
bool getFloat32(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a float32_t value.
void registerAt(TypeBasedParameterProvider &provider) const override
bool getVectorFloat32(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of float32_t value.
JsonParameterProvider & operator=(JsonParameterProvider &&) &=default
Move assignment operator.
bool getVectorUint16(dw::core::StringView const &key, void *const out) const
Handler function to retrieve a vector of uint16_t value.
A parameter provider which dispatches the retrieval of the parameter value to registered handlers whi...