DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
dpdklibs
include
dpdklibs
nicsender
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::dpdklibs::nicsender to be serialized via nlohmann::json.
6
*/
7
#ifndef DUNEDAQ_DPDKLIBS_NICSENDER_NLJS_HPP
8
#define DUNEDAQ_DPDKLIBS_NICSENDER_NLJS_HPP
9
10
// My structs
11
#include "
dpdklibs/nicsender/Structs.hpp
"
12
13
#include <nlohmann/json.hpp>
14
15
namespace
dunedaq::dpdklibs::nicsender
{
16
17
using
data_t
= nlohmann::json;
18
19
inline
void
20
to_json
(
data_t
& j,
const
Core
&
obj
)
21
{
22
j[
"lcore_id"
] =
obj
.lcore_id;
23
j[
"src_ips"
] =
obj
.src_ips;
24
}
25
26
inline
void
27
from_json
(
const
data_t
& j,
Core
&
obj
)
28
{
29
if
(j.contains(
"lcore_id"
))
30
j.at(
"lcore_id"
).get_to(
obj
.lcore_id);
31
if
(j.contains(
"src_ips"
))
32
j.at(
"src_ips"
).get_to(
obj
.src_ips);
33
}
34
35
inline
void
36
to_json
(
data_t
& j,
const
Conf
&
obj
)
37
{
38
j[
"card_id"
] =
obj
.card_id;
39
j[
"eal_arg_list"
] =
obj
.eal_arg_list;
40
j[
"frontend_type"
] =
obj
.frontend_type;
41
j[
"number_of_cores"
] =
obj
.number_of_cores;
42
j[
"number_of_ips_per_core"
] =
obj
.number_of_ips_per_core;
43
j[
"burst_size"
] =
obj
.burst_size;
44
j[
"rate"
] =
obj
.rate;
45
j[
"core_list"
] =
obj
.core_list;
46
j[
"time_tick_difference"
] =
obj
.time_tick_difference;
47
}
48
49
inline
void
50
from_json
(
const
data_t
& j,
Conf
&
obj
)
51
{
52
if
(j.contains(
"card_id"
))
53
j.at(
"card_id"
).get_to(
obj
.card_id);
54
if
(j.contains(
"eal_arg_list"
))
55
j.at(
"eal_arg_list"
).get_to(
obj
.eal_arg_list);
56
if
(j.contains(
"frontend_type"
))
57
j.at(
"frontend_type"
).get_to(
obj
.frontend_type);
58
if
(j.contains(
"number_of_cores"
))
59
j.at(
"number_of_cores"
).get_to(
obj
.number_of_cores);
60
if
(j.contains(
"number_of_ips_per_core"
))
61
j.at(
"number_of_ips_per_core"
).get_to(
obj
.number_of_ips_per_core);
62
if
(j.contains(
"burst_size"
))
63
j.at(
"burst_size"
).get_to(
obj
.burst_size);
64
if
(j.contains(
"rate"
))
65
j.at(
"rate"
).get_to(
obj
.rate);
66
if
(j.contains(
"core_list"
))
67
j.at(
"core_list"
).get_to(
obj
.core_list);
68
if
(j.contains(
"time_tick_difference"
))
69
j.at(
"time_tick_difference"
).get_to(
obj
.time_tick_difference);
70
}
71
72
}
// namespace dunedaq::dpdklibs::nicsender
73
74
#endif
// DUNEDAQ_DPDKLIBS_NICSENDER_NLJS_HPP
Structs.hpp
dunedaq::dpdklibs::nicsender
Definition
Nljs.hpp:15
dunedaq::dpdklibs::nicsender::from_json
void from_json(const data_t &j, Core &obj)
Definition
Nljs.hpp:27
dunedaq::dpdklibs::nicsender::to_json
void to_json(data_t &j, const Core &obj)
Definition
Nljs.hpp:20
dunedaq::dpdklibs::nicsender::data_t
nlohmann::json data_t
Definition
Nljs.hpp:17
dunedaq::obj
msgpack::object obj
Definition
Serialization.hpp:252
dunedaq::dpdklibs::nicsender::Conf
Definition
Structs.hpp:54
dunedaq::dpdklibs::nicsender::Core
Definition
Structs.hpp:40
Generated on
for DUNE-DAQ by
1.18.0