use of org.osate.aadl2.ComponentClassifier in project osate2 by osate.
the class BottomUpComponentImplTraversal method addUsageReferencesSubcomponents.
private void addUsageReferencesSubcomponents(final EList<Subcomponent> sublist, EList<ComponentImplementation> encl, ComponentImplementation aobj, final ComponentImplementation ci) {
for (Iterator<Subcomponent> it = sublist.iterator(); it.hasNext(); ) {
final Subcomponent sc = it.next();
final ComponentClassifier cc = sc.getAllClassifier();
if (cc == aobj) {
encl.add(ci);
}
}
}
use of org.osate.aadl2.ComponentClassifier in project osate2 by osate.
the class AccessSpecificationImpl method setClassifier.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setClassifier(ComponentClassifier newClassifier) {
ComponentClassifier oldClassifier = classifier;
classifier = newClassifier;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.ACCESS_SPECIFICATION__CLASSIFIER, oldClassifier, classifier));
}
}
use of org.osate.aadl2.ComponentClassifier in project osate2 by osate.
the class ComponentPrototypeImpl method setConstrainingClassifier.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setConstrainingClassifier(ComponentClassifier newConstrainingClassifier) {
ComponentClassifier oldConstrainingClassifier = constrainingClassifier;
constrainingClassifier = newConstrainingClassifier;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.COMPONENT_PROTOTYPE__CONSTRAINING_CLASSIFIER, oldConstrainingClassifier, constrainingClassifier));
}
}
use of org.osate.aadl2.ComponentClassifier in project osate2 by osate.
the class FeaturePrototypeImpl method setConstrainingClassifier.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setConstrainingClassifier(ComponentClassifier newConstrainingClassifier) {
ComponentClassifier oldConstrainingClassifier = constrainingClassifier;
constrainingClassifier = newConstrainingClassifier;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.FEATURE_PROTOTYPE__CONSTRAINING_CLASSIFIER, oldConstrainingClassifier, constrainingClassifier));
}
}
use of org.osate.aadl2.ComponentClassifier in project AMASE by loonwerks.
the class SafetyUtil method getSafetyAnnexes.
/**
* getSafetyAnnexes from an AgreeNode
*
* @param EObject comp : The component classifier in question will contain
* the safety annex.
* @return SafetyContractSubclause : This is the safety annex.
*
* MWW: generalized to return a list in case of multiple annex instances.
* Also generalized the lookup type to support the different kinds of
* EObjects used by AGREE to represent references.
*/
public static List<SafetyContractSubclause> getSafetyAnnexes(AgreeNode node, boolean isTop) {
List<SafetyContractSubclause> subclauses = new ArrayList<>();
// get the component instance from the AGREE program: less brittle than storing a global ref
// in verify handler - esp. if the user selects a different impl.
ComponentClassifier comp;
comp = node.compInst.getClassifier();
if (!isTop && comp instanceof ComponentImplementation) {
comp = ((ComponentImplementation) comp).getType();
} else if (isTop && node.compInst instanceof SystemInstanceImpl) {
comp = ((SystemInstanceImpl) node.compInst).getComponentImplementation();
}
// Grab the annex subclause using the safety package instance
for (AnnexSubclause annex : AnnexUtil.getAllAnnexSubclauses(comp, SafetyPackage.eINSTANCE.getSafetyContractSubclause())) {
// Then get the component classifier from that and return the annex
if (annex instanceof SafetyContractSubclause) {
// In newer versions of osate the annex this returns annexes in
// the type as well as the implementation. We want the annex in the
// specific component.
EObject container = annex.eContainer();
while (!(container instanceof ComponentClassifier)) {
container = container.eContainer();
}
if (container == comp) {
subclauses.add((SafetyContractSubclause) annex);
}
}
}
return subclauses;
}
Aggregations