15#include <nlohmann/json.hpp>
20using json = nlohmann::json;
37void to_json(
json &j,
const HierarchicalLevelInfo &p);
59void to_json(
json &j,
const IncomeStratumFactorsMeanStratumEntry &p);
60void to_json(
json &j,
const IncomeStratumFactorsMeanConfig &p);
70void to_json(
json &j,
const FactorDynamicEquationInfo &p);
80void to_json(
json &j,
const PolicyAdjustmentInfo &p);
87void to_json(
json &j,
const IndividualIdTrackingConfig &p);
97using json = nlohmann::json;
100 j = json::array({interval.
lower(), interval.
upper()});
104 const auto vec = j.get<std::vector<T>>();
105 if (vec.size() != 2) {
106 throw json::type_error::create(302,
"Interval arrays must have only two elements",
nullptr);
116template <
typename T>
void to_json(nlohmann::json &j,
const std::optional<T> &p) {
123template <
typename T>
void from_json(
const nlohmann::json &j, std::optional<T> &p) {
Numeric interval representation data type.
Definition interval.h:14
TYPE upper() const noexcept
Gets the interval upper bound.
Definition interval.h:35
TYPE lower() const noexcept
Gets the interval lower bound.
Definition interval.h:31
Top-level namespace for Health-GPS Core C++ API.
Definition analysis.h:7
nlohmann::json json
Definition jsonparser.h:97
void to_json(json &j, const Interval< T > &interval)
Definition jsonparser.h:99
void from_json(const nlohmann::json &j, Identifier &id)
Definition identifier.cpp:60
Global namespace.
Definition column_iterator.h:123
void to_json(nlohmann::json &j, const std::optional< T > &p)
Definition jsonparser.h:116