json_layer.cpp
Go to the documentation of this file.
1#include "json_layer.h"
2
4#include "json_base.h"
5
6namespace armarx::viz
7{
8
9 void
10 data::to_json(nlohmann::json& j, const LayerUpdate& update)
11 {
12 j["component"] = update.component;
13 j["name"] = update.name;
14 j["action"] = update.action;
15 j["elements"] = update.elements;
16 }
17
18 void
19 data::from_json(const nlohmann::json& j, LayerUpdate& update)
20 {
21 update.component = j.at("component");
22 update.name = j.at("name");
23 update.action = j.at("action");
24 update.elements = j.at("elements").get<ElementSeq>();
25 }
26
27 void
28 data::to_json(nlohmann::json& j, const LayerUpdates& updates)
29 {
30 j["updates"] = updates.updates;
31 j["revision"] = updates.revision;
32 }
33
34 void
35 data::from_json(const nlohmann::json& j, LayerUpdates& updates)
36 {
37 updates.updates = j.at("updates").get<data::LayerUpdateSeq>();
38 updates.revision = j.at("revision").get<Ice::Long>();
39 }
40
41} // namespace armarx::viz
void to_json(nlohmann::json &j, RecordingBatchHeader const &batch)
void from_json(nlohmann::json const &j, RecordingBatchHeader &batch)
This file is part of ArmarX.