DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq
sourcecode
appfwk
include
appfwk
cmd
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
11
#include "
appfwk/cmd/Structs.hpp
"
12
13
// Nljs for externally referenced schema
14
#include "
cmdlib/cmd/Nljs.hpp
"
15
16
#include <nlohmann/json.hpp>
17
18
namespace
dunedaq::appfwk::cmd
{
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
Structs.hpp
Nljs.hpp
dunedaq::appfwk::cmd
Definition
Nljs.hpp:18
dunedaq::appfwk::cmd::to_json
void to_json(data_t &j, const AddressedCmd &obj)
Definition
Nljs.hpp:22
dunedaq::appfwk::cmd::from_json
void from_json(const data_t &j, AddressedCmd &obj)
Definition
Nljs.hpp:27
dunedaq::appfwk::cmd::data_t
nlohmann::json data_t
Definition
Nljs.hpp:20
dunedaq::obj
msgpack::object obj
Definition
Serialization.hpp:257
dunedaq::appfwk::cmd::AddressedCmd
Definition
Structs.hpp:23
dunedaq::appfwk::cmd::CmdObj
Definition
Structs.hpp:37
Generated on
for DUNE-DAQ by
1.16.1