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

Private GIT Repository
clkconvert OP compute done
[blast.git] / Graph.cpp
index 8e55077e6d069759f837f790924f0661fb33fea2..808dbda2f18486c8e247651e4290cea3fdebd109 100644 (file)
--- a/Graph.cpp
+++ b/Graph.cpp
@@ -14,7 +14,7 @@ Graph::~Graph() {
 }
 
 void Graph::createTopGroup(bool createTopGroupIfaces) {
-  topGroup = new GroupBlock(NULL, createTopGroupIfaces);
+  topGroup = new GroupBlock(this, NULL, createTopGroupIfaces);
   topGroup->setName("top group");
   groups.append(topGroup);
 }
@@ -24,7 +24,7 @@ QList<AbstractInterface *> Graph::getOutsideInterfaces() {
 }
 
 GroupBlock* Graph::createChildGroupBlock(GroupBlock* parent, bool createGroupIface) {
-  GroupBlock* b = new GroupBlock(parent, createGroupIface);
+  GroupBlock* b = new GroupBlock(this, parent, createGroupIface);
   groups.append(b);
   return b;
 }
@@ -47,10 +47,12 @@ FunctionalBlock* Graph::createFunctionalBlock(GroupBlock* group, ReferenceBlock*
 
   FunctionalBlock* newBlock = NULL;
   if (ref->getSpecialType() != -1) {
-    newBlock = new SpecialBlock(ref->getSpecialType(), group,ref, createIfaces);
+    cout << "Graph: create special block from " << qPrintable(ref->getName()) << endl;
+    newBlock = new SpecialBlock(this, ref->getSpecialType(), group,ref, createIfaces);
   }
   else {
-    newBlock = new FunctionalBlock(group,ref, createIfaces);
+    cout << "Graph: create normal block from " << qPrintable(ref->getName()) << endl;
+    newBlock = new FunctionalBlock(this, group,ref, createIfaces);
   }
   group->addBlock(newBlock);
 
@@ -91,7 +93,7 @@ FunctionalBlock* Graph::getFunctionalBlockByName(QString name, GroupBlock* paren
 FunctionalBlock* Graph::createStimuliBlock(ReferenceBlock* ref, bool createIfaces) {
   /* A stimuli block is always a special block with idSpecial = 1 */
 
-  FunctionalBlock* newBlock = new SpecialBlock(AbstractBlock::Source, NULL,ref, createIfaces);
+  FunctionalBlock* newBlock = new SpecialBlock(this, AbstractBlock::Source, NULL,ref, createIfaces);
   stimulis.append(newBlock);
   return newBlock;
 }