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

Private GIT Repository
1st commit of all files
[blast.git] / Graph.cpp
1 #include "Graph.h"
2 #include "GroupBlock.h"
3 #include "ReferenceBlock.h"
4 #include "FunctionalBlock.h"
5
6 Graph::Graph() {
7   topGroup = new GroupBlock(NULL);
8   topGroup->setName("top group");
9 }
10
11 Graph::~Graph() {
12   delete topGroup;
13 }
14
15 QList<AbstractInterface *> Graph::getOutsideInterfaces() {
16   return topGroup->getInterfaces();
17 }
18
19 GroupBlock* Graph::createChildBlock(GroupBlock* parent) {
20   GroupBlock* b = new GroupBlock(parent);
21   return b;
22 }
23
24 FunctionalBlock* Graph::addFunctionalBlock(GroupBlock* group, ReferenceBlock* ref) {
25
26   FunctionalBlock* newBlock = new FunctionalBlock(group,ref);
27   newBlock->populate();
28   group->addBlock(newBlock);
29
30   return newBlock;
31 }