コード例 #1
0
ファイル: RoomScopeProvider.java プロジェクト: hckkid/eTrice
  /**
   * returns a flat list of SPPRef scopes for a {@link RelaySAPoint}
   *
   * @param pt
   * @param ref
   * @return a list of scopes
   */
  public IScope scope_RelaySAPoint_relay(RelaySAPoint pt, EReference ref) {
    final List<IEObjectDescription> scopes = new ArrayList<IEObjectDescription>();

    ActorClass ac = getActorClass(pt);
    LinkedList<ActorClass> classes = getBaseClasses(ac);
    for (ActorClass a : classes) {
      for (SPPRef spp : a.getIfSPPs()) {
        scopes.add(EObjectDescription.create(spp.getName(), spp));
      }
    }

    return new SimpleScope(IScope.NULLSCOPE, scopes);
  }
コード例 #2
0
ファイル: RoomScopeProvider.java プロジェクト: hckkid/eTrice
  /**
   * returns a flat list of SPPRef scopes for a {@link SPPoint}
   *
   * @param pt
   * @param ref
   * @return a list of scopes
   */
  public IScope scope_SPPoint_service(SPPoint pt, EReference ref) {
    final List<IEObjectDescription> scopes = new ArrayList<IEObjectDescription>();

    if (pt.getRef() != null) {
      if (pt.getRef() instanceof ActorRef) {
        ActorClass ac = ((ActorRef) pt.getRef()).getType();
        LinkedList<ActorClass> classes = getBaseClasses(ac);
        for (ActorClass a : classes) {
          for (SPPRef spp : a.getIfSPPs()) {
            scopes.add(EObjectDescription.create(spp.getName(), spp));
          }
        }
      } else if (pt.getRef() instanceof SubSystemRef) {
        SubSystemClass ssc = ((SubSystemRef) pt.getRef()).getType();
        for (SPPRef spp : ssc.getIfSPPs()) {
          scopes.add(EObjectDescription.create(spp.getName(), spp));
        }
      }
    }

    return new SimpleScope(IScope.NULLSCOPE, scopes);
  }