]> AND Private Git Repository - blast.git/blobdiff - AbstractInterface.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
source connection ok
[blast.git] / AbstractInterface.cpp
index e651f583583e507f0b198288088bcd629114e909..dde5930ab90aebae1d11a4f965bfeb97395c1b48 100644 (file)
@@ -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;