DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
Nljs.hpp
Go to the documentation of this file.
1/*
2 * This file is 100% generated. Any manual edits will likely be lost.
3 *
4 * This contains functions struct and other type definitions for shema in
5 * namespace dunedaq::cmdlib::cmd to be serialized via nlohmann::json.
6 */
7#ifndef DUNEDAQ_CMDLIB_CMD_NLJS_HPP
8#define DUNEDAQ_CMDLIB_CMD_NLJS_HPP
9
10// My structs
12
13#include <nlohmann/json.hpp>
14
16
17using data_t = nlohmann::json;
18
19inline void
21{
22 j["id"] = obj.id;
23 j["data"] = obj.data;
24}
25
26inline void
28{
29 if (j.contains("id"))
30 j.at("id").get_to(obj.id);
31 obj.data = j.at("data");
32}
33
34inline void
36{
37 j["success"] = obj.success;
38 j["result"] = obj.result;
39 j["appname"] = obj.appname;
40 j["data"] = obj.data;
41}
42
43inline void
45{
46 if (j.contains("success"))
47 j.at("success").get_to(obj.success);
48 if (j.contains("result"))
49 j.at("result").get_to(obj.result);
50 if (j.contains("appname"))
51 j.at("appname").get_to(obj.appname);
52 obj.data = j.at("data");
53}
54
55} // namespace dunedaq::cmdlib::cmd
56
57#endif // DUNEDAQ_CMDLIB_CMD_NLJS_HPP
nlohmann::json data_t
Definition Nljs.hpp:17
void to_json(data_t &j, const Command &obj)
Definition Nljs.hpp:20
void from_json(const data_t &j, Command &obj)
Definition Nljs.hpp:27
msgpack::object obj