use of org.osate.aadl2.ComponentCategory in project osate2 by osate.
the class InstanceModelUtil method getBoundProcesses.
/**
* get all processes bound to the given component
* @param procorVP
* @return
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public static EList<ComponentInstance> getBoundProcesses(final ComponentInstance procorVP) {
SystemInstance root = procorVP.getSystemInstance();
EList boundComponents = new ForAllElement() {
@Override
protected boolean suchThat(Element obj) {
ComponentInstance ci = (ComponentInstance) obj;
ComponentCategory cat = ci.getCategory();
return ((cat == ComponentCategory.PROCESS) && InstanceModelUtil.isBoundToProcessor((ComponentInstance) obj, procorVP));
}
}.processPreOrderComponentInstance(root);
return boundComponents;
}
use of org.osate.aadl2.ComponentCategory in project osate2 by osate.
the class InstanceModelUtil method getAllBoundSWComponents.
/**
* get all SW components bound to the given processor or VP component
* This includes the children of a component that is bound as the binding property is inherited.
* @param procorVP
* @return
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public static EList<ComponentInstance> getAllBoundSWComponents(final ComponentInstance procorVP) {
SystemInstance root = procorVP.getSystemInstance();
EList boundComponents = new ForAllElement() {
@Override
protected boolean suchThat(Element obj) {
ComponentInstance ci = (ComponentInstance) obj;
ComponentCategory cat = ci.getCategory();
return ((cat == ComponentCategory.THREAD || cat == ComponentCategory.THREAD_GROUP || cat == ComponentCategory.PROCESS || cat == ComponentCategory.SYSTEM) && InstanceModelUtil.isBoundToProcessor((ComponentInstance) obj, procorVP));
}
}.processPreOrderComponentInstance(root);
return boundComponents;
}
Aggregations