1 #ifndef __REFERENCEBLOCK_H__
2 #define __REFERENCEBLOCK_H__
11 #include "AbstractBlock.h"
14 #include "BlockImplementation.h"
16 #include "Exception.h"
23 class ReferenceBlock : public AbstractBlock {
27 ReferenceBlock(const QString _xmlFile);
30 inline QString getXmlFile() { return xmlFile; }
31 inline QString getBriefDescription() { return descriptionBrief; }
32 inline QString getDetailedDescription() { return descriptionDetail; }
33 inline QList<int> getCategories() { return categories; }
34 inline QList<BlockImplementation *> getImplementations() { return implementations; }
35 inline QString getHashMd5() { return hashMd5; }
37 inline AbstractBlock* getParent() { return NULL; }
39 void addCategory(int id);
40 void setBriefDescription(const QString& str);
41 void setDetailedDescription(const QString& str);
42 void addImplementation(BlockImplementation* impl);
44 void load(QDomElement &elt) throw(Exception);
48 QString xmlFile; // the xml file from which attributes are initialized.
50 QString descriptionBrief;
51 QString descriptionDetail;
52 QList<int> categories;
53 QList<BlockImplementation *> implementations; // set when implementations are read
55 // loading methods for the different tags in the XML desc.
56 void loadInformations(QDomElement &elt) throw(Exception);
57 void loadParameters(QDomElement &elt) throw(Exception);
58 void loadInterfaces(QDomElement &elt) throw(Exception);
59 void createInterfaceForParameters() throw(Exception);
61 friend QDataStream &operator<<(QDataStream &out, const ReferenceBlock &b);
62 friend QDataStream &operator>>(QDataStream &in, ReferenceBlock &b);
65 // AbstractBlock interface
67 void parametersValidation(QList<AbstractBlock*>* checkedBlocks, QList<AbstractBlock*>* blocksToConfigure);
71 void computeOutputPattern(int nbExec = -1);
74 #endif // __REFERENCEBLOCK_H__