json_layer.cpp
Go to the documentation of this file.
1 #include "json_layer.h"
2 
3 #include "json_base.h"
4 
6 
7 
8 namespace armarx::viz
9 {
10 
11  void data::to_json(nlohmann::json& j, const LayerUpdate& update)
12  {
13  j["component"] = update.component;
14  j["name"] = update.name;
15  j["action"] = update.action;
16  j["elements"] = update.elements;
17  }
18  void data::from_json(const nlohmann::json& j, LayerUpdate& update)
19  {
20  update.component = j.at("component");
21  update.name = j.at("name");
22  update.action = j.at("action");
23  update.elements = j.at("elements").get<ElementSeq>();
24  }
25 
26  void data::to_json(nlohmann::json& j, const LayerUpdates& updates)
27  {
28  j["updates"] = updates.updates;
29  j["revision"] = updates.revision;
30  }
31  void data::from_json(const nlohmann::json& j, LayerUpdates& updates)
32  {
33  updates.updates = j.at("updates").get<data::LayerUpdateSeq>();
34  updates.revision = j.at("revision").get<Ice::Long>();
35  }
36 
37 }
38 
armarx::viz::data::from_json
void from_json(nlohmann::json const &j, RecordingBatchHeader &batch)
Definition: ArVizStorage.cpp:382
ElementJsonSerializers.h
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:917
json_layer.h
json_base.h
armarx::armem::server::ltm::util::mongodb::detail::update
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition: mongodb.cpp:67
armarx::viz
This file is part of ArmarX.
Definition: ArVizStorage.cpp:370
armarx::viz::data::to_json
void to_json(nlohmann::json &j, RecordingBatchHeader const &batch)
Definition: ArVizStorage.cpp:373