X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/43fd94117de66d533ef9e58b2de85daa244da309..dd3fe103df79a5a4c2962e2f05fec9a9ed58580d:/AbstractInterface.cpp diff --git a/AbstractInterface.cpp b/AbstractInterface.cpp index e651f58..dde5930 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;