NLohmannJSONConverter.cpp
Go to the documentation of this file.
2
4
6
8{
9 nlohmann::json
11 {
12 nlohmann::json j;
14 return j;
15 }
16
17 void
23
26 const armarx::aron::Path& p)
27 {
28 // TODO Switch case over json type and add other methods, e.g. for float, array, ...
29 // TODO add check if json is object_t
30 data::VariantPtr aron = std::make_shared<aron::data::Dict>(p);
33 }
34
35 void
38 const nlohmann::json& e,
39 const aron::type::VariantPtr& expectedStructure)
40 {
42 ARMARX_CHECK_EXPRESSION(a->fullfillsType(expectedStructure));
43 }
44
45} // namespace armarx::aron::data::converter
46
48{
49
50 nlohmann::json
52 {
53 nlohmann::json j;
55 return j;
56 }
57
58 void
64
67 const armarx::aron::Path& p)
68 {
69 type::VariantPtr aron = std::make_shared<aron::type::Object>(p);
72 }
73
74 void
80} // namespace armarx::aron::type::converter
The Path class.
Definition Path.h:36
static data::DictPtr ConvertFromNlohmannJSONObject(const nlohmann::json &, const armarx::aron::Path &p={})
static void ConvertFromNlohmannJSON(data::VariantPtr &, const nlohmann::json &, const aron::type::VariantPtr &=nullptr)
static nlohmann::json ConvertToNlohmannJSON(const data::VariantPtr &)
static type::ObjectPtr ConvertFromNlohmannJSONTypeObject(const nlohmann::json &j, const armarx::aron::Path &p={})
static void ConvertFromNlohmannJSON(aron::type::VariantPtr &a, const nlohmann::json &e)
static nlohmann::json ConvertToNlohmannJSON(const type::VariantPtr &)
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
std::shared_ptr< Dict > DictPtr
Definition Dict.h:42
std::shared_ptr< Variant > VariantPtr
ConverterImplementation::WriterReturnType readAndWrite(typename ConverterImplementation::ReaderInputType &o)
the function to read from a variant and write to a writer T returns the returntype of T
Definition Converter.h:185
std::shared_ptr< Object > ObjectPtr
Definition Object.h:36
std::shared_ptr< Variant > VariantPtr
ConverterImplementation::WriterReturnType readAndWrite(typename ConverterImplementation::ReaderInputType &o)
the function to read from a variant and write to a writer T returns the returntype of T
Definition Converter.h:337