12#include <nlohmann/json.hpp>
21namespace Experimental {
31 fJson = std::make_unique<Internal::RDF::RMetaDataJson>(*other.
fJson);
41 fJson->payload[key] = val;
46 fJson->payload[key] = val;
51 fJson->payload[key] = val;
56 return fJson->payload[key].dump();
61 if (!
fJson->payload.contains(key))
62 throw std::logic_error(
"No key with name " + key +
" in the metadata object.");
63 if (!
fJson->payload[key].is_number_integer())
64 throw std::logic_error(
"Key " + key +
" is not of type int.");
65 return fJson->payload[key].get<
int>();
70 if (!
fJson->payload.contains(key))
71 throw std::logic_error(
"No key with name " + key +
" in the metadata object.");
72 if (!
fJson->payload[key].is_number_float())
73 throw std::logic_error(
"Key " + key +
" is not of type double.");
74 return fJson->payload[key].get<
double>();
79 if (!
fJson->payload.contains(key))
80 throw std::logic_error(
"No key with name " + key +
" in the metadata object.");
81 if (!
fJson->payload[key].is_string())
82 throw std::logic_error(
"Key " + key +
" is not of type string.");
83 return fJson->payload[key].get<std::string>();
88 if (!
fJson->payload.contains(key))
90 if (!
fJson->payload[key].is_number_integer())
91 throw std::logic_error(
"Key " + key +
" is not of type int.");
92 return fJson->payload[key].get<
int>();
97 if (!
fJson->payload.contains(key))
99 if (!
fJson->payload[key].is_number_float())
100 throw std::logic_error(
"Key " + key +
" is not of type double.");
101 return fJson->payload[key].get<
double>();
104const std::string
RMetaData::GetS(
const std::string &key,
const std::string &defaultVal)
const
106 if (!
fJson->payload.contains(key))
108 if (!
fJson->payload[key].is_string())
109 throw std::logic_error(
"Key " + key +
" is not of type string.");
110 return fJson->payload[key].get<std::string>();
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.