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,
16 throw (Exception) : AbstractInterface(_owner, _name, _type, _width, _direction, _purpose, _level) {
18 if (_owner->isReferenceBlock()) throw(Exception(BLOCK_INVALID_TYPE));
20 multiplicity = _multiplicity;
21 if (direction == InOut) {
26 bool ReferenceInterface::isReferenceInterface() {
30 void ReferenceInterface::setMultiplicity(int _multiplicity) {
31 if (direction == InOut) {
35 multiplicity = _multiplicity;
39 int ReferenceInterface::translatePurpose(const QString& txt) {
43 else if (txt == "reset") {
52 int ReferenceInterface::translateLevel(const QString& txt) {
60 int ReferenceInterface::translateMultiplicity(const QString& txt) {
67 mult = txt.toInt(&ok);