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

Private GIT Repository
started to include patterns in implementation
[blast.git] / AbstractBlock.cpp
index 87c973cc0bf1e4204daf16743d1de983fa32a96f..c71b2e0c508e46719659e2e15ba8982a69cdaf66 100644 (file)
@@ -52,6 +52,13 @@ bool AbstractBlock::isSourceBlock() {
   return false;\r
 }\r
 \r
+bool AbstractBlock::isGeneratorBlock() {\r
+  foreach(AbstractInterface* iface, inputs) {\r
+    if (iface->getPurpose() == AbstractInterface::Data) return false;\r
+  }\r
+  return true;\r
+}\r
+\r
 void AbstractBlock::addParameter(BlockParameter *param) {\r
   params.append(param);\r
 }\r
@@ -137,6 +144,26 @@ QList<AbstractInterface *> AbstractBlock::getDataInputs() {
   return list;\r
 }\r
 \r
+QList<AbstractInterface *> AbstractBlock::getControlInputs() {\r
+  QList<AbstractInterface *> list;\r
+  foreach(AbstractInterface* iface, inputs) {\r
+    if (iface->getPurpose() == AbstractInterface::Control) {\r
+      list.append(iface);\r
+    }\r
+  }\r
+  return list;\r
+}\r
+\r
+QList<AbstractInterface *> AbstractBlock::getControlOutputs() {\r
+  QList<AbstractInterface *> list;\r
+  foreach(AbstractInterface* iface, outputs) {\r
+    if (iface->getPurpose() == AbstractInterface::Control) {\r
+      list.append(iface);\r
+    }\r
+  }\r
+  return list;\r
+}\r
+\r
 AbstractInterface* AbstractBlock::getIfaceFromName(QString name) {\r
 \r
   foreach(AbstractInterface* iface, inputs) {\r