1 #ifndef __BLOCKPARAMETER_H__
\r
2 #define __BLOCKPARAMETER_H__
\r
9 #include "AbstractBlock.h"
\r
10 class AbstractBlock;
\r
12 using namespace std;
\r
16 class BlockParameter {
\r
20 enum ParamType { Expression = 1, Character, String, Bit, BitVector, Boolean, Integer, Natural, Positive, Real, Time};
\r
21 // a bit ugly to put that here but more practical for using them
\r
22 enum ParamWBAccess { Read = 1, Write = 2};
\r
23 enum ParamWBDuration { Permanent = 1, Trigger = 2 };
\r
24 enum ParamVHDLContext { Entity = 1, Component = 2, Architecture = 3 }; // NB : 3 is when creating an instance of the block that owns this iface
\r
25 enum ParamVHDLFlags { NoComma = 1 };
\r
28 BlockParameter(AbstractBlock* _owner, const QString& _name , const QString& _type, const QString& _value);
\r
30 virtual ~BlockParameter();
\r
33 inline AbstractBlock* getOwner() { return owner; }
\r
34 inline QString getName() { return name; }
\r
35 inline int getType() { return type; }
\r
36 QString getTypeString();
\r
37 virtual QVariant getValue(); // may be overriden
\r
38 virtual QString getContext() = 0;
\r
41 inline void setOwner(AbstractBlock* _owner) { owner = _owner; }
\r
42 inline void setName(const QString& _name) { name = _name; }
\r
43 inline void setType(int _type) { type = _type; }
\r
44 virtual void setValue(const QString& _value);
\r
47 virtual bool isValueSet(); // may be overridden for User and Generic parameters
\r
48 virtual bool isUserParameter();
\r
49 virtual bool isGenericParameter();
\r
50 virtual bool isWishboneParameter();
\r
51 virtual bool isPortParameter();
\r
54 virtual BlockParameter* clone() = 0;
\r
55 virtual QString toVHDL(int context, int flags);
\r
56 int typeFromString(const QString& _type);
\r
60 AbstractBlock* owner;
\r
63 QVariant defaultValue; // the value set during construction
\r
67 #endif // __BLOCKPARAMETER_H__
\r