driveOther method

  1. @override
void driveOther(
  1. Interface<PairDirection> other,
  2. Iterable<PairDirection> tags
)
inherited

Makes this drive interface signals tagged with tags on other.

In addition to the base Interface.driveOther functionality, this also handles driving signals on all subInterfaces hierarchically when other is a PairInterface, considering reverse.

Implementation

@override
void driveOther(
    Interface<PairDirection> other, Iterable<PairDirection> tags) {
  super.driveOther(other, tags);

  if (other is PairInterface) {
    subInterfaces.forEach((subIntfName, subInterface) {
      if (!other.subInterfaces.containsKey(subIntfName)) {
        throw InterfaceTypeException(
            other, 'missing a sub-interface named $subIntfName');
      }

      if (_subInterfaces[subIntfName]!.reverse) {
        subInterface.receiveOther(other.subInterfaces[subIntfName]!, tags);
      } else {
        subInterface.driveOther(other.subInterfaces[subIntfName]!, tags);
      }
    });
  }
}