Exemplo n.º 1
0
  /**
   * returns a flat list of Port scopes for a {@link MessageFromIf}
   *
   * @param mfi - the message from interface
   * @param ref - not used
   * @return a list of scopes
   */
  public IScope scope_MessageFromIf_port(MessageFromIf mfi, EReference ref) {
    final List<IEObjectDescription> scopes = new ArrayList<IEObjectDescription>();

    ActorClass ac = getActorClass(mfi);
    for (Port p : ac.getIntPorts()) {
      scopes.add(EObjectDescription.create(p.getName(), p));
    }
    for (ExternalPort p : ac.getExtPorts()) {
      scopes.add(EObjectDescription.create(p.getIfport().getName(), p.getIfport()));
    }

    return new SimpleScope(IScope.NULLSCOPE, scopes);
  }
Exemplo n.º 2
0
 /**
  * check whether port is referenced by external port
  *
  * @param p - port to be checked
  * @param ports - list of external ports
  * @return true if contained
  */
 private boolean isContained(Port p, EList<ExternalPort> ports) {
   for (ExternalPort port : ports) {
     if (port.getIfport() == p) return true;
   }
   return false;
 }