|
Namespaces | |
meta | |
Classes | |
class | ElementJsonSerializers |
Handles serialization and deserialization of dynamic data::Element objects to and from JSON. More... | |
Typedefs | |
template<class ValueT > | |
using | FromJsonFn = std::function< void(const nlohmann::json &j, ValueT &v)> |
A std::function pointer to a function with signature: More... | |
template<class ValueT > | |
using | RawFromJsonFn = void(*)(const nlohmann::json &j, ValueT &v) |
A raw function pointer to a function with signature: More... | |
template<class ValueT > | |
using | RawToJsonFn = void(*)(nlohmann::json &j, const ValueT &v) |
A raw function pointer to a function with signature: More... | |
template<class ValueT > | |
using | ToJsonFn = std::function< void(nlohmann::json &j, const ValueT &v)> |
A std::function pointer to a function with signature: More... | |
Functions | |
void | from_json_base (const nlohmann::json &j, data::Element &value) |
std::string | getTypeName (const nlohmann::json &j, const std::string &key) |
Get the type name stored in j . More... | |
void | setTypeName (nlohmann::json &j, const std::string &key, const std::string &typeName) |
Store the type name in j . More... | |
void | to_json_base (nlohmann::json &j, const data::Element &element) |
using FromJsonFn = std::function<void(const nlohmann::json& j, ValueT& v)> |
A std::function
pointer to a function with signature:
Definition at line 85 of file ElementJsonSerializers.h.
using RawFromJsonFn = void (*)(const nlohmann::json& j, ValueT& v) |
A raw function pointer to a function with signature:
Definition at line 67 of file ElementJsonSerializers.h.
using RawToJsonFn = void (*)(nlohmann::json& j, const ValueT& v) |
A raw function pointer to a function with signature:
Definition at line 59 of file ElementJsonSerializers.h.
using ToJsonFn = std::function<void(nlohmann::json& j, const ValueT& v)> |
A std::function
pointer to a function with signature:
Definition at line 77 of file ElementJsonSerializers.h.
void from_json_base | ( | const nlohmann::json & | j, |
data::Element & | value | ||
) |
std::string getTypeName | ( | const nlohmann::json & | j, |
const std::string & | key | ||
) |
Get the type name stored in j
.
key | The key of the type name entry. |
<tt>error::NoTypeNameEntryInJsonObject</tt> | If j is not an object or does not contain key . |
Definition at line 6 of file ElementJsonSerializers.cpp.
void setTypeName | ( | nlohmann::json & | j, |
const std::string & | key, | ||
const std::string & | typeName | ||
) |
Store the type name in j
.
key | The key where the type name shall be stored. |
typeName | The type name. |
<tt>error::TypeNameEntryAlreadyInJsonObject</tt> | If j already contains key . |
Definition at line 22 of file ElementJsonSerializers.cpp.
void to_json_base | ( | nlohmann::json & | j, |
const data::Element & | element | ||
) |