json_layer.cpp
Go to the documentation of this file.
1 #include "json_layer.h"
2 
4 #include "json_base.h"
5 
6 namespace 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
armarx::viz::data::from_json
void from_json(nlohmann::json const &j, RecordingBatchHeader &batch)
Definition: ArVizStorage.cpp:432
ElementJsonSerializers.h
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:918
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:68
armarx::viz
This file is part of ArmarX.
Definition: ArVizStorage.cpp:418
armarx::viz::data::to_json
void to_json(nlohmann::json &j, RecordingBatchHeader const &batch)
Definition: ArVizStorage.cpp:422