]> AND Private Git Repository - blast.git/blobdiff - AbstractBlock.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
begun integration of control ifaces
[blast.git] / AbstractBlock.cpp
index 6e9cc86a9c764f014aa3695b023e6111f5e515b8..d316800e91e43534ed43d2d6ef5bbd3b7bca723f 100644 (file)
@@ -16,18 +16,8 @@ AbstractBlock::AbstractBlock(const QString& _name) {
 \r
 AbstractBlock::~AbstractBlock() {\r
 \r
-  foreach(AbstractInterface* iface, inputs) {\r
-    delete iface;\r
-  }\r
-  foreach(AbstractInterface* iface, outputs) {\r
-    delete iface;\r
-  }\r
-  foreach(AbstractInterface* iface, bidirs) {\r
-    delete iface;\r
-  }\r
-  inputs.clear();\r
-  outputs.clear();\r
-  bidirs.clear();\r
+  removeAllInterfaces();\r
+\r
   foreach(BlockParameter* p, params) {\r
     delete p;\r
   }\r
@@ -90,6 +80,23 @@ void AbstractBlock::removeInterface(AbstractInterface *inter) {
   delete inter;\r
 }\r
 \r
+void AbstractBlock::removeAllInterfaces() {\r
+\r
+  foreach(AbstractInterface* iface, inputs) {\r
+    delete iface;\r
+  }\r
+  foreach(AbstractInterface* iface, outputs) {\r
+    delete iface;\r
+  }\r
+  foreach(AbstractInterface* iface, bidirs) {\r
+    delete iface;\r
+  }\r
+  inputs.clear();\r
+  outputs.clear();\r
+  bidirs.clear();\r
+\r
+}\r
+\r
 void AbstractBlock::defineBlockParam(BlockParameter *param)\r
 {\r
   cout << "definition of param : " << param->getName().toStdString() << endl;\r