2021-10-10 20:26:30 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "test_t.h"
|
|
|
|
#include <cassert>
|
|
|
|
|
2021-10-18 10:54:01 +00:00
|
|
|
#ifdef USE_SIMDJSON_JSON
|
2021-10-11 13:59:23 +00:00
|
|
|
|
2021-10-18 10:54:01 +00:00
|
|
|
test_t::test_t(const simdjson::dom::element serialised)
|
|
|
|
: m_name(serialised["name"]),
|
|
|
|
m_initial_state(serialised["initial"]),
|
|
|
|
m_final_state(serialised["final"]),
|
|
|
|
m_cycles(serialised["cycles"].get_array()) {}
|
2021-10-11 13:59:23 +00:00
|
|
|
|
2021-10-18 10:54:01 +00:00
|
|
|
#endif
|
2021-10-10 20:26:30 +00:00
|
|
|
|
2021-10-18 10:54:01 +00:00
|
|
|
#ifdef USE_BOOST_JSON
|
2021-10-10 20:26:30 +00:00
|
|
|
|
2021-10-18 10:54:01 +00:00
|
|
|
test_t::test_t(const boost::json::object& serialised)
|
|
|
|
: m_name(serialised.at("name").as_string()),
|
|
|
|
m_initial_state(serialised.at("initial")),
|
|
|
|
m_final_state(serialised.at("final")),
|
|
|
|
m_cycles(serialised.at("cycles")) {}
|
2021-10-10 20:26:30 +00:00
|
|
|
|
2021-10-18 10:54:01 +00:00
|
|
|
test_t::test_t(const boost::json::value& serialised)
|
|
|
|
: test_t(serialised.as_object()) {}
|
2021-10-10 20:26:30 +00:00
|
|
|
|
2021-10-11 13:59:23 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_NLOHMANN_JSON
|
|
|
|
|
2021-10-18 10:54:01 +00:00
|
|
|
test_t::test_t(const nlohmann::json& serialised)
|
|
|
|
: m_name(serialised["name"].get<std::string>()),
|
|
|
|
m_initial_state(serialised["initial"]),
|
|
|
|
m_final_state(serialised["final"]),
|
|
|
|
m_cycles(serialised["cycles"]) {}
|
2021-10-11 13:59:23 +00:00
|
|
|
|
|
|
|
#endif
|
2021-10-11 18:13:05 +00:00
|
|
|
|
|
|
|
#ifdef USE_JSONCPP_JSON
|
|
|
|
|
2021-10-18 10:54:01 +00:00
|
|
|
test_t::test_t(const Json::Value& serialised)
|
2021-10-18 11:07:24 +00:00
|
|
|
: m_name(serialised["name"].asString()),
|
|
|
|
m_initial_state(serialised["initial"]),
|
|
|
|
m_final_state(serialised["final"]),
|
|
|
|
m_cycles(serialised["cycles"]) {}
|
2021-10-11 21:09:03 +00:00
|
|
|
|
|
|
|
#endif
|