1 #ifndef __BLOCKIMPLEMENTATION_H__
\r
2 #define __BLOCKIMPLEMENTATION_H__
\r
10 class ReferenceBlock;
\r
11 class FunctionalBlock;
\r
12 class AbstractInterface;
\r
14 #include "ArithmeticEvaluator.h"
\r
15 class ArithmeticEvaluator;
\r
17 #include "Exception.h"
\r
20 using namespace std;
\r
23 class BlockImplementation {
\r
27 BlockImplementation(const QString& _xmlFile);
\r
28 BlockImplementation(const QString& _xmlFile, const QString& _referenceXml, const QString& _referenceMd5);
\r
31 inline QString getXmlFile() { return xmlFile; }
\r
32 inline QString getReferenceXml() { return referenceXml; }
\r
33 inline QString getReferenceMd5() { return referenceMd5; }
\r
34 inline QString getDelta() { return delta; }
\r
35 inline QHash<QString,QString> getConsumptionPattern() { return consumptionPattern; }
\r
36 inline QHash<QString,QString> getProductionPattern() { return productionPattern; }
\r
37 inline QString getProductionCounter() { return productionCounter; }
\r
38 inline QList<QString> getResources() { return resources; }
\r
41 inline void setDelta(QString _delta) { delta = _delta; }
\r
42 inline void setConsumptionPattern(QHash<QString,QString> pattern) { consumptionPattern = pattern; }
\r
43 inline void setProductionPattern(QHash<QString,QString> pattern) { productionPattern = pattern; }
\r
44 inline void setProductionCounter(QString pattern) { productionCounter = pattern; }
\r
48 inline bool hasNoPatterns() { return noPatterns; }
\r
50 inline void setReference(ReferenceBlock* _reference) { reference = _reference; }
\r
52 void loadPatterns(QDomElement &root) throw(Exception);
\r
53 bool checkPatterns();
\r
55 inline void addResource(QString file) { resources.append(file); }
\r
58 QString referenceXml;
\r
59 QString referenceMd5;
\r
61 QList<QString> resources;
\r
63 QMap<QString, int> paramMap;
\r
64 ArithmeticEvaluator* evaluator;
\r
65 ReferenceBlock* reference;
\r
66 FunctionalBlock* block; // the current functional block for which this implementation is used.
\r
69 QHash<QString,QString> consumptionPattern; // key = reference interface name, value = pattern expression
\r
70 QHash<QString,QString> productionPattern; // key = reference interface name, value = pattern expression
\r
71 QString productionCounter;
\r
73 friend QDataStream &operator<<(QDataStream &out, const BlockImplementation &impl);
\r
74 friend QDataStream &operator>>(QDataStream &in, BlockImplementation &impl);
\r
77 #endif // __BLOCKIMPLEMENTATION_H__
\r