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,
14 const QString& _width,
17 throw (Exception) : AbstractInterface(_owner, _name, _direction, _purpose, _type, _width) {
19 if (_owner->isReferenceBlock()) throw(Exception(BLOCK_INVALID_TYPE));
21 multiplicity = _multiplicity;
23 if (purpose == Control) {
24 // override some attributes with forced values
29 if (direction == InOut) {
34 bool ReferenceInterface::isReferenceInterface() {
38 void ReferenceInterface::setMultiplicity(int _multiplicity) {
39 if (direction == InOut) {
43 multiplicity = _multiplicity;
47 int ReferenceInterface::translatePurpose(const QString& txt) {
51 else if (txt == "reset") {
54 else if (txt == "wb") {
60 int ReferenceInterface::translateMultiplicity(const QString& txt) {
67 mult = txt.toInt(&ok);