16 if (ts !=
_json.end() && ts.value().is_number())
26 std::function<void(
const std::string&,
const nlohmann::json&)> flatten;
28 flatten = [&](
const std::string& prefix,
const nlohmann::json& value) {
36 case nlohmann::detail::value_t::array: {
40 flatten(
fmt::format(
"{}[{}]", prefix, i), value[i]);
45 case nlohmann::detail::value_t::object: {
47 for (
const auto& element : value.items())
49 flatten(
fmt::format(
"{}/{}", prefix, element.key()), element.value());
55 double numeric_value = 0;
56 if (value.is_boolean())
58 numeric_value = value.get<
bool>();
60 else if (value.is_number())
62 numeric_value = value.get<
double>();
70 plot_data->pushBack({
timestamp, numeric_value });
83 _json = nlohmann::json::from_msgpack(
msg.data(),
msg.data() +
msg.size());
89 _json = nlohmann::json::parse(
msg.data(),
msg.data() +
msg.size());
95 _json = nlohmann::json::from_cbor(
msg.data(),
msg.data() +
msg.size());
101 _json = nlohmann::json::from_bson(
msg.data(),
msg.data() +
msg.size());