From 2da780564d7b30db679f99de6467735e77c8ac28 Mon Sep 17 00:00:00 2001 From: Octave Perrin <operrin@lrtechnologies.fr> Date: Tue, 12 Nov 2024 14:29:32 +0100 Subject: [PATCH] more todoes --- include/aidge/graph/GraphView.hpp | 8 ++++++-- src/graph/GraphView.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/aidge/graph/GraphView.hpp b/include/aidge/graph/GraphView.hpp index d761af469..53f5ad826 100644 --- a/include/aidge/graph/GraphView.hpp +++ b/include/aidge/graph/GraphView.hpp @@ -596,8 +596,12 @@ public: return cloneCallback(&Node::clone); } - /** - * @brief Clone the current GraphView using a callback function for the Node cloning, allowing to specify how each Node should be cloned or replaced by another Node type, or removed (i.e. replaced by identity). When a Node is removed, the clone() method automatically finds the next valid parent in line, going backward in the graph and connects it if that makes sense without ambiguity (effectively treating the removed Node as an identity operation). + /** TODO: reformulate + * @brief Clone the current GraphView using a callback function for the Node cloning, allowing to specify how each + * Node should be cloned or replaced by another Node type, or removed (i.e. replaced by identity). + * When a Node is removed, the clone() method automatically finds the next valid parent in line, going backward in + * the graph and connects it if that makes sense without ambiguity (effectively treating the removed Node as an + * identity operation). * @param cloneNode Callback function to clone a node * @return std::shared_ptr<GraphView> */ diff --git a/src/graph/GraphView.cpp b/src/graph/GraphView.cpp index fd0f1561d..626270ce4 100644 --- a/src/graph/GraphView.cpp +++ b/src/graph/GraphView.cpp @@ -1479,7 +1479,7 @@ std::shared_ptr<Aidge::GraphView> Aidge::GraphView::cloneCallback(NodePtr(*clone for (const std::shared_ptr<Node> &node_ptr : mNodes) { auto clonedNode = cloneNode(node_ptr); - if (clonedNode == nullptr) { + if (clonedNode == nullptr) { //todo: don't understand those checks: why is one child OK for deleted nodes? AIDGE_ASSERT(node_ptr->getChildren().size() <= 1, "deleted nodes in GraphView::clone() cannot have multiple children"); AIDGE_ASSERT(node_ptr->dataInputs().size() <= 1, "deleted nodes in GraphView::clone() cannot have multiple data input parents"); } -- GitLab