Skip to content
Snippets Groups Projects
Commit 2da78056 authored by Octave Perrin's avatar Octave Perrin
Browse files

more todoes

parent a1e2eb2a
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !245. Comments created here will be created in the context of that merge request.
...@@ -596,8 +596,12 @@ public: ...@@ -596,8 +596,12 @@ public:
return cloneCallback(&Node::clone); return cloneCallback(&Node::clone);
} }
/** /** 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). * @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 * @param cloneNode Callback function to clone a node
* @return std::shared_ptr<GraphView> * @return std::shared_ptr<GraphView>
*/ */
......
...@@ -1479,7 +1479,7 @@ std::shared_ptr<Aidge::GraphView> Aidge::GraphView::cloneCallback(NodePtr(*clone ...@@ -1479,7 +1479,7 @@ std::shared_ptr<Aidge::GraphView> Aidge::GraphView::cloneCallback(NodePtr(*clone
for (const std::shared_ptr<Node> &node_ptr : mNodes) { for (const std::shared_ptr<Node> &node_ptr : mNodes) {
auto clonedNode = cloneNode(node_ptr); 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->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"); AIDGE_ASSERT(node_ptr->dataInputs().size() <= 1, "deleted nodes in GraphView::clone() cannot have multiple data input parents");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment