1 #include "ReferenceInterface.h"
2 #include "AbstractBlock.h"
4 ReferenceInterface::ReferenceInterface(AbstractBlock* _owner) throw(Exception) : AbstractInterface(_owner) {
5 if (_owner->isReferenceBlock()) throw(Exception(BLOCK_INVALID_TYPE));
9 ReferenceInterface::ReferenceInterface(AbstractBlock* _owner,
10 const QString& _name, const QString&_type,
11 const QString& _width,
15 throw (Exception) : AbstractInterface(_owner, _name, _type, _width, _direction, _purpose) {
17 if (_owner->isReferenceBlock()) throw(Exception(BLOCK_INVALID_TYPE));
19 multiplicity = _multiplicity;
21 if (purpose == Control) {
22 // override some attributes with forced values
27 if (direction == InOut) {
32 bool ReferenceInterface::isReferenceInterface() {
36 void ReferenceInterface::setMultiplicity(int _multiplicity) {
37 if (direction == InOut) {
41 multiplicity = _multiplicity;
45 int ReferenceInterface::translatePurpose(const QString& txt) {
49 else if (txt == "reset") {
52 else if (txt == "wb") {
58 int ReferenceInterface::translateMultiplicity(const QString& txt) {
65 mult = txt.toInt(&ok);