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

Private GIT Repository
added source items
[blast.git] / GroupBlock.h
1 #ifndef __GROUPBLOCK_H__
2 #define __GROUPBLOCK_H__
3
4 #include <iostream>
5
6 #include <QtCore>
7
8 #include "AbstractBlock.h"
9 class AbstractBlock;
10 #include "Exception.h"
11 class Exception;
12
13 using namespace std;
14 using namespace Qt;
15
16
17 class GroupBlock : public AbstractBlock {
18 public:
19
20   GroupBlock(GroupBlock* _parent) throw(Exception);
21   virtual ~GroupBlock();
22
23   // getters
24   inline QList<AbstractBlock*> getBlocks() { return blocks; }
25   // setters
26   void setParent(AbstractBlock *_parent);
27
28   // testers
29   bool isGroupBlock();
30   inline bool isTop() { return topGroup; }
31
32   // others
33   inline void addBlock(AbstractBlock* block) { blocks.append(block); }
34   void removeBlock(AbstractBlock* block);
35   AbstractBlock* getFunctionalBlockByName(QString name);
36   
37   void removeAllBlocks();
38   void parametersValidation(QList<AbstractBlock *> *checkedBlocks, QList<AbstractBlock*>* blocksToConfigure);  
39   void addGenericParameter(QString name, QString type, QString value);
40   void removeGenericParameter(QString name);
41   // public attributes
42   static int counter;
43
44 private:  
45   bool topGroup;  
46   QList<AbstractBlock*> blocks; // contains instances of FunctionalBlock or GroupBlock that are children of this group
47
48 };
49
50 #endif // __GROUPBLOCK_H__