Skip to content
Snippets Groups Projects
Commit aa932d1c authored by Fabian Reister's avatar Fabian Reister
Browse files

json conversion

parent e025bcb7
No related branches found
No related tags found
1 merge request!25RT controller and simplification
......@@ -20,28 +20,3 @@
*/
#include "json_conversions.h"
#include <RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReader.h>
#include <RobotAPI/libraries/aron/core/data/rw/writer/nlohmannJSON/NlohmannJSONWriter.h>
namespace armarx::navigation::core
{
void
arondto::to_json(nlohmann::json& j, const Edge& bo)
{
armarx::aron::data::writer::NlohmannJSONWriter writer;
j = bo.write(writer);
}
void
arondto::from_json(const nlohmann::json& j, Edge& bo)
{
armarx::aron::data::reader::NlohmannJSONReader reader;
bo.read(reader, j);
}
} // namespace armarx::navigation::core
......@@ -23,14 +23,33 @@
#include <SimoxUtility/json/json.hpp>
#include <armarx/navigation/core/aron/Graph.aron.generated.h>
#include "RobotAPI/libraries/aron/core/codegenerator/codewriter/cpp/AronGeneratedClass.h"
#include "RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReader.h"
#include "RobotAPI/libraries/aron/core/data/rw/writer/nlohmannJSON/NlohmannJSONWriter.h"
namespace armarx::navigation::core::arondto
namespace armarx
{
void to_json(nlohmann::json& j, const arondto::Edge& bo);
void from_json(const nlohmann::json& j, arondto::Edge& bo);
} // namespace armarx::navigation::core::arondto
template <typename AronDTO>
void
from_json(const nlohmann::json& j, AronDTO& dto)
{
static_assert(
std::is_base_of<armarx::aron::codegenerator::cpp::AronGeneratedClass, AronDTO>::value);
armarx::aron::data::reader::NlohmannJSONReader reader;
dto.read(reader, j);
}
template <typename AronDTO>
void
to_json(nlohmann::json& j, const AronDTO& bo)
{
static_assert(
std::is_base_of<armarx::aron::codegenerator::cpp::AronGeneratedClass, AronDTO>::value);
armarx::aron::data::writer::NlohmannJSONWriter writer;
j = bo.write(writer);
}
} // namespace armarx
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment