Running again after weak_ptr refactoring. No connecting of nodes atm. Copy/Paste might not work, too.

This commit is contained in:
Sebastian
2024-12-04 01:43:06 +01:00
parent 1fde652495
commit 036c6f4723
11 changed files with 150 additions and 104 deletions
+31
View File
@@ -20,6 +20,37 @@
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;
}
}
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 {
using namespace VISEQ::GRAPH::NODES;