clone method

  1. @mustBeOverridden
Interface<TagType> clone()

Creates a new Interface with the same ports as this.

It is expected that any implementation will override this in a way that returns the same type as itself.

Implementation

@mustBeOverridden
Interface<TagType> clone() {
  final newIntf = Interface<TagType>();
  _portToTagMap.forEach((portName, tags) {
    newIntf.setPorts([port(portName).clone()], tags);
  });
  return newIntf;
}