From 92738e8157a75abf976a26f2ec2f25faed542186 Mon Sep 17 00:00:00 2001
From: NAUD Maxence <maxence.naud@cea.fr>
Date: Mon, 11 Dec 2023 01:53:56 +0000
Subject: [PATCH] Remove deprecated function
 'updateInputsOutputsNodes_DEPRECATED()'

---
 include/aidge/graph/GraphView.hpp   |  8 -------
 src/graph/GraphView.cpp             | 34 -----------------------------
 unit_tests/graph/Test_GraphView.cpp | 17 +--------------
 3 files changed, 1 insertion(+), 58 deletions(-)

diff --git a/include/aidge/graph/GraphView.hpp b/include/aidge/graph/GraphView.hpp
index 4ec1929c6..dda3d8ee4 100644
--- a/include/aidge/graph/GraphView.hpp
+++ b/include/aidge/graph/GraphView.hpp
@@ -451,14 +451,6 @@ public:
      */
     IOIndex_t getNbFreeDataInputs() const;
 
-protected:
-    /**
-     * @brief Update inputs/outputs of the GraphView, with no particular order.
-     * This function DOES NOT preserve inputs/outputs order and should NOT BE USED.
-     * It is here only to leave time to adapt the replace() function.
-     */
-    void updateInputsOutputsNodes_DEPRECATED();
-
 private:
 ///////////////////////////////////////////////////////
 //        TENSOR MANAGEMENT
diff --git a/src/graph/GraphView.cpp b/src/graph/GraphView.cpp
index 064cb3a04..9fcea6b82 100644
--- a/src/graph/GraphView.cpp
+++ b/src/graph/GraphView.cpp
@@ -1040,40 +1040,6 @@ void Aidge::GraphView::updateInputsOutputsDelete(std::shared_ptr<Node> deletedNo
   }
 }
 
-void Aidge::GraphView::updateInputsOutputsNodes_DEPRECATED() {
-  mInputNodes.clear();
-  for (const std::shared_ptr<Node>& go_ptr : mNodes) {
-    IOIndex_t inputIdx = 0;
-    for (const std::shared_ptr<Node>& pa_ptr : go_ptr->getParents()) {
-      if ((pa_ptr == nullptr) ||
-          (mNodes.find(pa_ptr) ==
-           mNodes.end())) { // Parent doesn't exist || Parent not in the graph
-        mInputNodes.push_back(std::make_pair(go_ptr, inputIdx));
-      }
-
-      ++inputIdx;
-    }
-  }
-
-  mOutputNodes.clear();
-  for (const std::shared_ptr<Node>& go_ptr : mNodes) {
-    IOIndex_t outputIdx = 0;
-    for (auto orderedChilds : go_ptr->getOrderedChildren()) {
-      bool noInsideConnection = true;
-      for (auto ch_ptr : orderedChilds) {
-        if (mNodes.find(ch_ptr) != mNodes.end()) {
-          noInsideConnection = false;
-          break;
-        }
-      }
-
-      if (noInsideConnection) {
-        mOutputNodes.push_back(std::make_pair(go_ptr, outputIdx));
-      }
-      ++outputIdx;
-    }
-  }
-}
 
 std::shared_ptr<Aidge::GraphView> Aidge::GraphView::cloneCallback(NodePtr(*cloneNode)(NodePtr)) const {
   std::shared_ptr<GraphView> newGraph = std::make_shared<GraphView>(mName);
diff --git a/unit_tests/graph/Test_GraphView.cpp b/unit_tests/graph/Test_GraphView.cpp
index 1887cdca1..acbea04a2 100644
--- a/unit_tests/graph/Test_GraphView.cpp
+++ b/unit_tests/graph/Test_GraphView.cpp
@@ -28,19 +28,6 @@
 
 using namespace Aidge;
 
-class GraphView_Test : public GraphView {
-public:
-    GraphView_Test(std::string name="")
-        : GraphView(name)
-    {
-        // ctor
-    }
-
-    void updateInputsOutputsNodes_DEPRECATED_Test() {
-        GraphView::updateInputsOutputsNodes_DEPRECATED();
-    }
-};
-
 TEST_CASE("genRandomGraph", "[GraphView][randomGen]") {
     const size_t nbTests = 100;
     size_t nbUnicity = 0;
@@ -50,7 +37,7 @@ TEST_CASE("genRandomGraph", "[GraphView][randomGen]") {
         const std::mt19937::result_type seed(rd());
 
         RandomGraph randGraph;
-        const auto g1 = std::make_shared<GraphView_Test>("g1");
+        const auto g1 = std::make_shared<GraphView>("g1");
         const bool unicity1 = g1->add(randGraph.gen(seed, 10));
         const auto g2 = std::make_shared<GraphView>("g2");
         const bool unicity2 = g2->add(randGraph.gen(seed, 10));
@@ -68,8 +55,6 @@ TEST_CASE("genRandomGraph", "[GraphView][randomGen]") {
             REQUIRE(nodePtrTo(g1->outputNodes(), nodePtrToName) == nodePtrTo(g2->outputNodes(), nodePtrToName));
             ++nbUnicity;
 
-            // Test deprecated function
-            g1->updateInputsOutputsNodes_DEPRECATED_Test();
             // Check that inputs/outputs are the same regardless of the order
             auto orderedInputs1 = nodePtrTo(g1->getOrderedInputs(), nodePtrToName);
             auto orderedInputs2 = nodePtrTo(g2->getOrderedInputs(), nodePtrToName);
-- 
GitLab