Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-11-22 12:08:30 +0000
committerHenrik Rentz-Reichert2012-11-22 12:08:30 +0000
commit5f53f6a72db877cf721e6122140f42e8be9073ed (patch)
treef70d66f8ec56885cf31703393c3ef2ae9c419b0b
parent643f785dac3de940916ddc87c171bbbee2042879 (diff)
downloadorg.eclipse.etrice-5f53f6a72db877cf721e6122140f42e8be9073ed.tar.gz
org.eclipse.etrice-5f53f6a72db877cf721e6122140f42e8be9073ed.tar.xz
org.eclipse.etrice-5f53f6a72db877cf721e6122140f42e8be9073ed.zip
[core.genmodel] bug fix for list of sub systems in root
The list previously was a containment list. Now it delegates to a collection of all sub systems contained in the logical systems or (if no logical system is present) to the onwSubSystemInstances
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/model/etricegen.ecore5
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/builder/GeneratorModelBuilder.java3
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/ETriceGenPackage.java54
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/Root.java23
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ETriceGenPackageImpl.java29
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/RootImpl.java58
6 files changed, 129 insertions, 43 deletions
diff --git a/plugins/org.eclipse.etrice.core.genmodel/model/etricegen.ecore b/plugins/org.eclipse.etrice.core.genmodel/model/etricegen.ecore
index 027b4eb93..cd46381ce 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/model/etricegen.ecore
+++ b/plugins/org.eclipse.etrice.core.genmodel/model/etricegen.ecore
@@ -14,8 +14,11 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="library" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="systemInstances" upperBound="-1"
eType="#//SystemInstance" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ownSubSystemInstances"
+ upperBound="-1" eType="#//SubSystemInstance" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="subSystemInstances" upperBound="-1"
- eType="#//SubSystemInstance" containment="true"/>
+ eType="#//SubSystemInstance" changeable="false" volatile="true" transient="true"
+ derived="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="models" upperBound="-1"
eType="ecore:EClass ../../org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/Room.ecore#//RoomModel"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="xpActorClasses" upperBound="-1"
diff --git a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/builder/GeneratorModelBuilder.java b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/builder/GeneratorModelBuilder.java
index 8d75a1c9a..d4bef235e 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/builder/GeneratorModelBuilder.java
+++ b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/builder/GeneratorModelBuilder.java
@@ -149,7 +149,6 @@ public class GeneratorModelBuilder {
hasSystem = true;
SystemInstance si = createLogicalSystemInstance(sys);
root.getSystemInstances().add(si);
- root.getSubSystemInstances().addAll(si.getInstances());
}
}
@@ -157,7 +156,7 @@ public class GeneratorModelBuilder {
logger.logInfo("GeneratorModelBuilder: no SystemClass found, assuming SubSystemClasses as top level elements");
for (RoomModel mdl : models) {
for (SubSystemClass comp : mdl.getSubSystemClasses()) {
- root.getSubSystemInstances().add(createSubSystemInstance(comp));
+ root.getOwnSubSystemInstances().add(createSubSystemInstance(comp));
}
}
}
diff --git a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/ETriceGenPackage.java b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/ETriceGenPackage.java
index 63f988d2d..85af010a2 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/ETriceGenPackage.java
+++ b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/ETriceGenPackage.java
@@ -95,13 +95,22 @@ public interface ETriceGenPackage extends EPackage {
int ROOT__SYSTEM_INSTANCES = 1;
/**
- * The feature id for the '<em><b>Sub System Instances</b></em>' containment reference list.
+ * The feature id for the '<em><b>Own Sub System Instances</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int ROOT__SUB_SYSTEM_INSTANCES = 2;
+ int ROOT__OWN_SUB_SYSTEM_INSTANCES = 2;
+
+ /**
+ * The feature id for the '<em><b>Sub System Instances</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ROOT__SUB_SYSTEM_INSTANCES = 3;
/**
* The feature id for the '<em><b>Models</b></em>' reference list.
@@ -110,7 +119,7 @@ public interface ETriceGenPackage extends EPackage {
* @generated
* @ordered
*/
- int ROOT__MODELS = 3;
+ int ROOT__MODELS = 4;
/**
* The feature id for the '<em><b>Xp Actor Classes</b></em>' containment reference list.
@@ -119,7 +128,7 @@ public interface ETriceGenPackage extends EPackage {
* @generated
* @ordered
*/
- int ROOT__XP_ACTOR_CLASSES = 4;
+ int ROOT__XP_ACTOR_CLASSES = 5;
/**
* The feature id for the '<em><b>Used Data Classes</b></em>' reference list.
@@ -128,7 +137,7 @@ public interface ETriceGenPackage extends EPackage {
* @generated
* @ordered
*/
- int ROOT__USED_DATA_CLASSES = 5;
+ int ROOT__USED_DATA_CLASSES = 6;
/**
* The feature id for the '<em><b>Used Protocol Classes</b></em>' reference list.
@@ -137,7 +146,7 @@ public interface ETriceGenPackage extends EPackage {
* @generated
* @ordered
*/
- int ROOT__USED_PROTOCOL_CLASSES = 6;
+ int ROOT__USED_PROTOCOL_CLASSES = 7;
/**
* The feature id for the '<em><b>Used Actor Classes</b></em>' reference list.
@@ -146,7 +155,7 @@ public interface ETriceGenPackage extends EPackage {
* @generated
* @ordered
*/
- int ROOT__USED_ACTOR_CLASSES = 7;
+ int ROOT__USED_ACTOR_CLASSES = 8;
/**
* The feature id for the '<em><b>Used Room Models</b></em>' reference list.
@@ -155,7 +164,7 @@ public interface ETriceGenPackage extends EPackage {
* @generated
* @ordered
*/
- int ROOT__USED_ROOM_MODELS = 8;
+ int ROOT__USED_ROOM_MODELS = 9;
/**
* The feature id for the '<em><b>Sub System Classes</b></em>' reference list.
@@ -164,7 +173,7 @@ public interface ETriceGenPackage extends EPackage {
* @generated
* @ordered
*/
- int ROOT__SUB_SYSTEM_CLASSES = 9;
+ int ROOT__SUB_SYSTEM_CLASSES = 10;
/**
* The number of structural features of the '<em>Root</em>' class.
@@ -173,7 +182,7 @@ public interface ETriceGenPackage extends EPackage {
* @generated
* @ordered
*/
- int ROOT_FEATURE_COUNT = 10;
+ int ROOT_FEATURE_COUNT = 11;
/**
* The meta object id for the '{@link org.eclipse.etrice.core.genmodel.etricegen.impl.InstanceBaseImpl <em>Instance Base</em>}' class.
@@ -1677,10 +1686,21 @@ public interface ETriceGenPackage extends EPackage {
EReference getRoot_SystemInstances();
/**
- * Returns the meta object for the containment reference list '{@link org.eclipse.etrice.core.genmodel.etricegen.Root#getSubSystemInstances <em>Sub System Instances</em>}'.
+ * Returns the meta object for the containment reference list '{@link org.eclipse.etrice.core.genmodel.etricegen.Root#getOwnSubSystemInstances <em>Own Sub System Instances</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Own Sub System Instances</em>'.
+ * @see org.eclipse.etrice.core.genmodel.etricegen.Root#getOwnSubSystemInstances()
+ * @see #getRoot()
+ * @generated
+ */
+ EReference getRoot_OwnSubSystemInstances();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.etrice.core.genmodel.etricegen.Root#getSubSystemInstances <em>Sub System Instances</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Sub System Instances</em>'.
+ * @return the meta object for the reference list '<em>Sub System Instances</em>'.
* @see org.eclipse.etrice.core.genmodel.etricegen.Root#getSubSystemInstances()
* @see #getRoot()
* @generated
@@ -2544,7 +2564,15 @@ public interface ETriceGenPackage extends EPackage {
EReference ROOT__SYSTEM_INSTANCES = eINSTANCE.getRoot_SystemInstances();
/**
- * The meta object literal for the '<em><b>Sub System Instances</b></em>' containment reference list feature.
+ * The meta object literal for the '<em><b>Own Sub System Instances</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference ROOT__OWN_SUB_SYSTEM_INSTANCES = eINSTANCE.getRoot_OwnSubSystemInstances();
+
+ /**
+ * The meta object literal for the '<em><b>Sub System Instances</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
diff --git a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/Root.java b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/Root.java
index b7db8db53..114fc9906 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/Root.java
+++ b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/Root.java
@@ -34,6 +34,7 @@ import org.eclipse.emf.ecore.EObject;
* <ul>
* <li>{@link org.eclipse.etrice.core.genmodel.etricegen.Root#isLibrary <em>Library</em>}</li>
* <li>{@link org.eclipse.etrice.core.genmodel.etricegen.Root#getSystemInstances <em>System Instances</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.etricegen.Root#getOwnSubSystemInstances <em>Own Sub System Instances</em>}</li>
* <li>{@link org.eclipse.etrice.core.genmodel.etricegen.Root#getSubSystemInstances <em>Sub System Instances</em>}</li>
* <li>{@link org.eclipse.etrice.core.genmodel.etricegen.Root#getModels <em>Models</em>}</li>
* <li>{@link org.eclipse.etrice.core.genmodel.etricegen.Root#getXpActorClasses <em>Xp Actor Classes</em>}</li>
@@ -93,7 +94,23 @@ public interface Root extends EObject {
EList<SystemInstance> getSystemInstances();
/**
- * Returns the value of the '<em><b>Sub System Instances</b></em>' containment reference list.
+ * Returns the value of the '<em><b>Own Sub System Instances</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Own Sub System Instances</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Own Sub System Instances</em>' containment reference list.
+ * @see org.eclipse.etrice.core.genmodel.etricegen.ETriceGenPackage#getRoot_OwnSubSystemInstances()
+ * @model containment="true"
+ * @generated
+ */
+ EList<SubSystemInstance> getOwnSubSystemInstances();
+
+ /**
+ * Returns the value of the '<em><b>Sub System Instances</b></em>' reference list.
* The list contents are of type {@link org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance}.
* <!-- begin-user-doc -->
* <p>
@@ -101,9 +118,9 @@ public interface Root extends EObject {
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- * @return the value of the '<em>Sub System Instances</em>' containment reference list.
+ * @return the value of the '<em>Sub System Instances</em>' reference list.
* @see org.eclipse.etrice.core.genmodel.etricegen.ETriceGenPackage#getRoot_SubSystemInstances()
- * @model containment="true"
+ * @model transient="true" changeable="false" volatile="true" derived="true"
* @generated
*/
EList<SubSystemInstance> getSubSystemInstances();
diff --git a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ETriceGenPackageImpl.java b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ETriceGenPackageImpl.java
index 517d93afe..502f8ca63 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ETriceGenPackageImpl.java
+++ b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ETriceGenPackageImpl.java
@@ -287,7 +287,7 @@ public class ETriceGenPackageImpl extends EPackageImpl implements ETriceGenPacka
* <!-- end-user-doc -->
* @generated
*/
- public EReference getRoot_SubSystemInstances() {
+ public EReference getRoot_OwnSubSystemInstances() {
return (EReference)rootEClass.getEStructuralFeatures().get(2);
}
@@ -296,7 +296,7 @@ public class ETriceGenPackageImpl extends EPackageImpl implements ETriceGenPacka
* <!-- end-user-doc -->
* @generated
*/
- public EReference getRoot_Models() {
+ public EReference getRoot_SubSystemInstances() {
return (EReference)rootEClass.getEStructuralFeatures().get(3);
}
@@ -305,7 +305,7 @@ public class ETriceGenPackageImpl extends EPackageImpl implements ETriceGenPacka
* <!-- end-user-doc -->
* @generated
*/
- public EReference getRoot_XpActorClasses() {
+ public EReference getRoot_Models() {
return (EReference)rootEClass.getEStructuralFeatures().get(4);
}
@@ -314,7 +314,7 @@ public class ETriceGenPackageImpl extends EPackageImpl implements ETriceGenPacka
* <!-- end-user-doc -->
* @generated
*/
- public EReference getRoot_UsedDataClasses() {
+ public EReference getRoot_XpActorClasses() {
return (EReference)rootEClass.getEStructuralFeatures().get(5);
}
@@ -323,7 +323,7 @@ public class ETriceGenPackageImpl extends EPackageImpl implements ETriceGenPacka
* <!-- end-user-doc -->
* @generated
*/
- public EReference getRoot_UsedProtocolClasses() {
+ public EReference getRoot_UsedDataClasses() {
return (EReference)rootEClass.getEStructuralFeatures().get(6);
}
@@ -332,7 +332,7 @@ public class ETriceGenPackageImpl extends EPackageImpl implements ETriceGenPacka
* <!-- end-user-doc -->
* @generated
*/
- public EReference getRoot_UsedActorClasses() {
+ public EReference getRoot_UsedProtocolClasses() {
return (EReference)rootEClass.getEStructuralFeatures().get(7);
}
@@ -341,7 +341,7 @@ public class ETriceGenPackageImpl extends EPackageImpl implements ETriceGenPacka
* <!-- end-user-doc -->
* @generated
*/
- public EReference getRoot_UsedRoomModels() {
+ public EReference getRoot_UsedActorClasses() {
return (EReference)rootEClass.getEStructuralFeatures().get(8);
}
@@ -350,7 +350,7 @@ public class ETriceGenPackageImpl extends EPackageImpl implements ETriceGenPacka
* <!-- end-user-doc -->
* @generated
*/
- public EReference getRoot_SubSystemClasses() {
+ public EReference getRoot_UsedRoomModels() {
return (EReference)rootEClass.getEStructuralFeatures().get(9);
}
@@ -359,6 +359,15 @@ public class ETriceGenPackageImpl extends EPackageImpl implements ETriceGenPacka
* <!-- end-user-doc -->
* @generated
*/
+ public EReference getRoot_SubSystemClasses() {
+ return (EReference)rootEClass.getEStructuralFeatures().get(10);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getInstanceBase() {
return instanceBaseEClass;
}
@@ -997,6 +1006,7 @@ public class ETriceGenPackageImpl extends EPackageImpl implements ETriceGenPacka
rootEClass = createEClass(ROOT);
createEAttribute(rootEClass, ROOT__LIBRARY);
createEReference(rootEClass, ROOT__SYSTEM_INSTANCES);
+ createEReference(rootEClass, ROOT__OWN_SUB_SYSTEM_INSTANCES);
createEReference(rootEClass, ROOT__SUB_SYSTEM_INSTANCES);
createEReference(rootEClass, ROOT__MODELS);
createEReference(rootEClass, ROOT__XP_ACTOR_CLASSES);
@@ -1141,7 +1151,8 @@ public class ETriceGenPackageImpl extends EPackageImpl implements ETriceGenPacka
initEClass(rootEClass, Root.class, "Root", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getRoot_Library(), ecorePackage.getEBoolean(), "library", null, 0, 1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getRoot_SystemInstances(), this.getSystemInstance(), null, "systemInstances", null, 0, -1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getRoot_SubSystemInstances(), this.getSubSystemInstance(), null, "subSystemInstances", null, 0, -1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getRoot_OwnSubSystemInstances(), this.getSubSystemInstance(), null, "ownSubSystemInstances", null, 0, -1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getRoot_SubSystemInstances(), this.getSubSystemInstance(), null, "subSystemInstances", null, 0, -1, Root.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEReference(getRoot_Models(), theRoomPackage.getRoomModel(), null, "models", null, 0, -1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getRoot_XpActorClasses(), this.getExpandedActorClass(), null, "xpActorClasses", null, 0, -1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getRoot_UsedDataClasses(), theRoomPackage.getDataClass(), null, "usedDataClasses", null, 0, -1, Root.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
diff --git a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/RootImpl.java b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/RootImpl.java
index b1849efda..a5bdbbeb5 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/RootImpl.java
+++ b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/RootImpl.java
@@ -12,6 +12,7 @@
package org.eclipse.etrice.core.genmodel.etricegen.impl;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
@@ -22,6 +23,7 @@ import java.util.LinkedList;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.DelegatingEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EClass;
@@ -69,6 +71,7 @@ import org.eclipse.etrice.core.room.VarDecl;
* <ul>
* <li>{@link org.eclipse.etrice.core.genmodel.etricegen.impl.RootImpl#isLibrary <em>Library</em>}</li>
* <li>{@link org.eclipse.etrice.core.genmodel.etricegen.impl.RootImpl#getSystemInstances <em>System Instances</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.etricegen.impl.RootImpl#getOwnSubSystemInstances <em>Own Sub System Instances</em>}</li>
* <li>{@link org.eclipse.etrice.core.genmodel.etricegen.impl.RootImpl#getSubSystemInstances <em>Sub System Instances</em>}</li>
* <li>{@link org.eclipse.etrice.core.genmodel.etricegen.impl.RootImpl#getModels <em>Models</em>}</li>
* <li>{@link org.eclipse.etrice.core.genmodel.etricegen.impl.RootImpl#getXpActorClasses <em>Xp Actor Classes</em>}</li>
@@ -133,14 +136,14 @@ public class RootImpl extends EObjectImpl implements Root {
protected EList<SystemInstance> systemInstances;
/**
- * The cached value of the '{@link #getSubSystemInstances() <em>Sub System Instances</em>}' containment reference list.
+ * The cached value of the '{@link #getOwnSubSystemInstances() <em>Own Sub System Instances</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see #getSubSystemInstances()
+ * @see #getOwnSubSystemInstances()
* @generated
* @ordered
*/
- protected EList<SubSystemInstance> subSystemInstances;
+ protected EList<SubSystemInstance> ownSubSystemInstances;
/**
* The cached value of the '{@link #getModels() <em>Models</em>}' reference list.
@@ -184,13 +187,22 @@ public class RootImpl extends EObjectImpl implements Root {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
public EList<SubSystemInstance> getSubSystemInstances() {
- if (subSystemInstances == null) {
- subSystemInstances = new EObjectContainmentEList<SubSystemInstance>(SubSystemInstance.class, this, ETriceGenPackage.ROOT__SUB_SYSTEM_INSTANCES);
+ if (getOwnSubSystemInstances().isEmpty()) {
+ // we have top level logical system(s)
+ // add all their sub system instances
+ ArrayList<SubSystemInstance> result = new ArrayList<SubSystemInstance>();
+
+ for (SystemInstance si : getSystemInstances()) {
+ result.addAll(si.getInstances());
+ }
+
+ return new DelegatingEList.UnmodifiableEList<SubSystemInstance>(result);
}
- return subSystemInstances;
+ else
+ return new DelegatingEList.UnmodifiableEList<SubSystemInstance>((getOwnSubSystemInstances()));
}
/**
@@ -325,6 +337,18 @@ public class RootImpl extends EObjectImpl implements Root {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<SubSystemInstance> getOwnSubSystemInstances() {
+ if (ownSubSystemInstances == null) {
+ ownSubSystemInstances = new EObjectContainmentEList<SubSystemInstance>(SubSystemInstance.class, this, ETriceGenPackage.ROOT__OWN_SUB_SYSTEM_INSTANCES);
+ }
+ return ownSubSystemInstances;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated NOT
*/
public EList<RoomModel> getReferencedModels(RoomClass cls) {
@@ -422,8 +446,8 @@ public class RootImpl extends EObjectImpl implements Root {
switch (featureID) {
case ETriceGenPackage.ROOT__SYSTEM_INSTANCES:
return ((InternalEList<?>)getSystemInstances()).basicRemove(otherEnd, msgs);
- case ETriceGenPackage.ROOT__SUB_SYSTEM_INSTANCES:
- return ((InternalEList<?>)getSubSystemInstances()).basicRemove(otherEnd, msgs);
+ case ETriceGenPackage.ROOT__OWN_SUB_SYSTEM_INSTANCES:
+ return ((InternalEList<?>)getOwnSubSystemInstances()).basicRemove(otherEnd, msgs);
case ETriceGenPackage.ROOT__XP_ACTOR_CLASSES:
return ((InternalEList<?>)getXpActorClasses()).basicRemove(otherEnd, msgs);
}
@@ -442,6 +466,8 @@ public class RootImpl extends EObjectImpl implements Root {
return isLibrary();
case ETriceGenPackage.ROOT__SYSTEM_INSTANCES:
return getSystemInstances();
+ case ETriceGenPackage.ROOT__OWN_SUB_SYSTEM_INSTANCES:
+ return getOwnSubSystemInstances();
case ETriceGenPackage.ROOT__SUB_SYSTEM_INSTANCES:
return getSubSystemInstances();
case ETriceGenPackage.ROOT__MODELS:
@@ -478,9 +504,9 @@ public class RootImpl extends EObjectImpl implements Root {
getSystemInstances().clear();
getSystemInstances().addAll((Collection<? extends SystemInstance>)newValue);
return;
- case ETriceGenPackage.ROOT__SUB_SYSTEM_INSTANCES:
- getSubSystemInstances().clear();
- getSubSystemInstances().addAll((Collection<? extends SubSystemInstance>)newValue);
+ case ETriceGenPackage.ROOT__OWN_SUB_SYSTEM_INSTANCES:
+ getOwnSubSystemInstances().clear();
+ getOwnSubSystemInstances().addAll((Collection<? extends SubSystemInstance>)newValue);
return;
case ETriceGenPackage.ROOT__MODELS:
getModels().clear();
@@ -528,8 +554,8 @@ public class RootImpl extends EObjectImpl implements Root {
case ETriceGenPackage.ROOT__SYSTEM_INSTANCES:
getSystemInstances().clear();
return;
- case ETriceGenPackage.ROOT__SUB_SYSTEM_INSTANCES:
- getSubSystemInstances().clear();
+ case ETriceGenPackage.ROOT__OWN_SUB_SYSTEM_INSTANCES:
+ getOwnSubSystemInstances().clear();
return;
case ETriceGenPackage.ROOT__MODELS:
getModels().clear();
@@ -568,8 +594,10 @@ public class RootImpl extends EObjectImpl implements Root {
return library != LIBRARY_EDEFAULT;
case ETriceGenPackage.ROOT__SYSTEM_INSTANCES:
return systemInstances != null && !systemInstances.isEmpty();
+ case ETriceGenPackage.ROOT__OWN_SUB_SYSTEM_INSTANCES:
+ return ownSubSystemInstances != null && !ownSubSystemInstances.isEmpty();
case ETriceGenPackage.ROOT__SUB_SYSTEM_INSTANCES:
- return subSystemInstances != null && !subSystemInstances.isEmpty();
+ return !getSubSystemInstances().isEmpty();
case ETriceGenPackage.ROOT__MODELS:
return models != null && !models.isEmpty();
case ETriceGenPackage.ROOT__XP_ACTOR_CLASSES:

Back to the top