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::timing::timingfirmware to be serialized via nlohmann::json.
6 */
7#ifndef DUNEDAQ_TIMING_TIMINGFIRMWARE_NLJS_HPP
8#define DUNEDAQ_TIMING_TIMINGFIRMWARE_NLJS_HPP
9
10// My structs
12
13
14#include <nlohmann/json.hpp>
15
17
18 using data_t = nlohmann::json;
19
20 inline void to_json(data_t& j, const EndpointCheckResult& obj) {
21 j["address"] = obj.address;
22 j["alive"] = obj.alive;
23 j["round_trip_time"] = obj.round_trip_time;
24 j["state"] = obj.state;
25 j["round_trip_time_after_delay_apply"] = obj.round_trip_time_after_delay_apply;
26 j["state_after_delay_apply"] = obj.state_after_delay_apply;
27 j["applied_delay"] = obj.applied_delay;
28 }
29
30 inline void from_json(const data_t& j, EndpointCheckResult& obj) {
31 if (j.contains("address"))
32 j.at("address").get_to(obj.address);
33 if (j.contains("alive"))
34 j.at("alive").get_to(obj.alive);
35 if (j.contains("round_trip_time"))
36 j.at("round_trip_time").get_to(obj.round_trip_time);
37 if (j.contains("state"))
38 j.at("state").get_to(obj.state);
39 if (j.contains("round_trip_time_after_delay_apply"))
40 j.at("round_trip_time_after_delay_apply").get_to(obj.round_trip_time_after_delay_apply);
41 if (j.contains("state_after_delay_apply"))
42 j.at("state_after_delay_apply").get_to(obj.state_after_delay_apply);
43 if (j.contains("applied_delay"))
44 j.at("applied_delay").get_to(obj.applied_delay);
45 }
46
47} // namespace dunedaq::timing::timingfirmware
48
49#endif // DUNEDAQ_TIMING_TIMINGFIRMWARE_NLJS_HPP
void to_json(data_t &j, const EndpointCheckResult &obj)
Definition Nljs.hpp:20
void from_json(const data_t &j, EndpointCheckResult &obj)
Definition Nljs.hpp:30