X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/43fd94117de66d533ef9e58b2de85daa244da309..3bbc311e444c1ef9ac66dd6861fb0acb13ddb72a:/AbstractInterface.cpp?ds=inline diff --git a/AbstractInterface.cpp b/AbstractInterface.cpp index e651f58..f57f780 100644 --- a/AbstractInterface.cpp +++ b/AbstractInterface.cpp @@ -10,6 +10,7 @@ AbstractInterface::AbstractInterface(AbstractBlock* _owner) { direction = Input; purpose = Data; type = Boolean; + associatedIface = NULL; } @@ -21,6 +22,7 @@ AbstractInterface::AbstractInterface(AbstractBlock* _owner, const QString& _name direction = _direction; purpose = _purpose; type = typeFromString(_type); + associatedIface = NULL; } AbstractInterface::AbstractInterface(AbstractInterface* other) { @@ -30,6 +32,7 @@ AbstractInterface::AbstractInterface(AbstractInterface* other) { width = other->width; direction = other->direction; purpose = other->purpose; + associatedIface = NULL; } AbstractInterface::~AbstractInterface() { @@ -126,6 +129,14 @@ void AbstractInterface::setDirection(int _direction) { } } +bool AbstractInterface::setAssociatedIface(AbstractInterface* iface) { + if (purpose != Control) return false; + if (iface->purpose != Data) return false; + associatedIface = iface; + iface->associatedIface = this; + return true; +} + int AbstractInterface::getIntDirection(QString str) { if(str == "input") return Input; @@ -161,6 +172,9 @@ int AbstractInterface::typeFromString(const QString &_type) { else if (_type == "natural") { ret = Natural; } + else if (_type == "inherited") { + ret = Inherited; + } return ret; }