armarx::viz::json Namespace Reference

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)
 

Typedef Documentation

◆ FromJsonFn

using FromJsonFn = std::function<void(const nlohmann::json& j, ValueT& v)>

A std::function pointer to a function with signature:

void from_json(const nlohmann::json& j, Value& v);

Definition at line 85 of file ElementJsonSerializers.h.

◆ RawFromJsonFn

using RawFromJsonFn = void (*)(const nlohmann::json& j, ValueT& v)

A raw function pointer to a function with signature:

void from_json(const nlohmann::json& j, Value& v);

Definition at line 67 of file ElementJsonSerializers.h.

◆ RawToJsonFn

using RawToJsonFn = void (*)(nlohmann::json& j, const ValueT& v)

A raw function pointer to a function with signature:

void to_json(nlohmann::json& j, const Value& v);

Definition at line 59 of file ElementJsonSerializers.h.

◆ ToJsonFn

using ToJsonFn = std::function<void(nlohmann::json& j, const ValueT& v)>

A std::function pointer to a function with signature:

void to_json(nlohmann::json& j, const Value& v);

Definition at line 77 of file ElementJsonSerializers.h.

Function Documentation

◆ from_json_base()

void from_json_base ( const nlohmann::json &  j,
data::Element &  value 
)

Definition at line 98 of file json_base.cpp.

+ Here is the caller graph for this function:

◆ getTypeName()

std::string getTypeName ( const nlohmann::json &  j,
const std::string &  key 
)

Get the type name stored in j.

Parameters
keyThe key of the type name entry.
Exceptions
<tt>error::NoTypeNameEntryInJsonObject</tt>If j is not an object or does not contain key.

Definition at line 6 of file ElementJsonSerializers.cpp.

+ Here is the caller graph for this function:

◆ setTypeName()

void setTypeName ( nlohmann::json &  j,
const std::string &  key,
const std::string &  typeName 
)

Store the type name in j.

Parameters
keyThe key where the type name shall be stored.
typeNameThe type name.
Exceptions
<tt>error::TypeNameEntryAlreadyInJsonObject</tt>If j already contains key.

Definition at line 22 of file ElementJsonSerializers.cpp.

+ Here is the caller graph for this function:

◆ to_json_base()

void to_json_base ( nlohmann::json &  j,
const data::Element &  element 
)

Definition at line 86 of file json_base.cpp.

+ Here is the caller graph for this function:
ColorMap::Value
Value
Color maps that associate a color to every float from [0..1].
Definition: color.h:16
armarx::to_json
void to_json(nlohmann::json &j, const Vector2f &value)
armarx::from_json
void from_json(const nlohmann::json &j, Vector2f &value)
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39