Running again. Next step: making connections work again!
This commit is contained in:
+18
-28
@@ -20,35 +20,25 @@
|
||||
typedef std::shared_ptr<VISEQ::GRAPH::GraphItem> SPTR_GraphItem;
|
||||
typedef std::vector<SPTR_GraphItem> VEC_SPTR_GraphItem;
|
||||
|
||||
namespace nlohmann
|
||||
{
|
||||
template <typename T>
|
||||
struct adl_serializer<std::shared_ptr<T>>
|
||||
{
|
||||
static void to_json(json& j, const std::shared_ptr<T>& opt)
|
||||
{
|
||||
if (opt)
|
||||
{
|
||||
j = *opt;
|
||||
}
|
||||
else
|
||||
{
|
||||
j = nullptr;
|
||||
}
|
||||
}
|
||||
namespace nlohmann {
|
||||
template <typename T>
|
||||
struct adl_serializer<std::shared_ptr<T>> {
|
||||
static void to_json(json& j, const std::shared_ptr<T>& opt) {
|
||||
if (opt) {
|
||||
j = *opt;
|
||||
} else {
|
||||
j = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
static void from_json(const json& j, std::shared_ptr<T>& opt)
|
||||
{
|
||||
if (j.is_null())
|
||||
{
|
||||
opt = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
opt.reset(new T(j.get<T>()));
|
||||
}
|
||||
}
|
||||
};
|
||||
static void from_json(const json& j, std::shared_ptr<T>& opt) {
|
||||
if (j.is_null()) {
|
||||
opt = nullptr;
|
||||
} else {
|
||||
opt.reset(new T(j.get<T>()));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
namespace VISEQ::GRAPH::EDGES {
|
||||
|
||||
Reference in New Issue
Block a user