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::appfwk::cmd to be serialized via nlohmann::json.
6 */
7#ifndef DUNEDAQ_APPFWK_CMD_NLJS_HPP
8#define DUNEDAQ_APPFWK_CMD_NLJS_HPP
9
10// My structs
12
13// Nljs for externally referenced schema
14#include "cmdlib/cmd/Nljs.hpp"
15
16#include <nlohmann/json.hpp>
17
19
20 using data_t = nlohmann::json;
21
22 inline void to_json(data_t& j, const AddressedCmd& obj) {
23 j["match"] = obj.match;
24 j["data"] = obj.data;
25 }
26
27 inline void from_json(const data_t& j, AddressedCmd& obj) {
28 if (j.contains("match"))
29 j.at("match").get_to(obj.match);
30 if (j.contains("data"))
31 j.at("data").get_to(obj.data);
32 }
33
34 inline void to_json(data_t& j, const CmdObj& obj) {
35 j["modules"] = obj.modules;
36 }
37
38 inline void from_json(const data_t& j, CmdObj& obj) {
39 if (j.contains("modules"))
40 j.at("modules").get_to(obj.modules);
41 }
42
43} // namespace dunedaq::appfwk::cmd
44
45#endif // DUNEDAQ_APPFWK_CMD_NLJS_HPP
void to_json(data_t &j, const AddressedCmd &obj)
Definition Nljs.hpp:22
void from_json(const data_t &j, AddressedCmd &obj)
Definition Nljs.hpp:27