edu.cmu.sei.aadl.instance
Class CreateEndToEndFlowsSwitch

java.lang.Object
  extended by edu.cmu.sei.aadl.modelsupport.modeltraversal.ForAllElement
      extended by edu.cmu.sei.aadl.modelsupport.modeltraversal.AadlProcessingSwitch
          extended by edu.cmu.sei.aadl.modelsupport.modeltraversal.AadlProcessingSwitchWithProgress
              extended by edu.cmu.sei.aadl.instance.CreateEndToEndFlowsSwitch

public class CreateEndToEndFlowsSwitch
extends AadlProcessingSwitchWithProgress

Author:
lwrage

Field Summary
 
Fields inherited from class edu.cmu.sei.aadl.modelsupport.modeltraversal.AadlProcessingSwitchWithProgress
monitor
 
Fields inherited from class edu.cmu.sei.aadl.modelsupport.modeltraversal.AadlProcessingSwitch
aadl2Switch, copyright, DONE, INSTANCE, instanceSwitch, NOT_DONE
 
Fields inherited from class edu.cmu.sei.aadl.modelsupport.modeltraversal.ForAllElement
DEFAULT_DEFAULT_TRAVERSAL, NO_DEFAULT, PROCESS_BOTTOM_UP_COMPONENT_IMPL, PROCESS_POST_ORDER_ALL, PROCESS_PRE_ORDER_ALL, PROCESS_TOP_DOWN_COMPONENT_CLASSIFIER, PROCESS_TOP_DOWN_COMPONENT_IMPL, resultList
 
Constructor Summary
CreateEndToEndFlowsSwitch(org.eclipse.core.runtime.IProgressMonitor pm, AnalysisErrorReporterManager errMgr, java.util.HashMap<InstanceObject,InstanceUtil.InstantiatedClassifier> classifierCache)
          Create a new instance.
 
Method Summary
protected  void fillinModes(EndToEndFlowInstance etei)
           
protected  org.eclipse.emf.common.util.EList<ModeInstance> getModeInstances(ComponentInstance ci, org.eclipse.emf.common.util.EList<Mode> mlist)
          build mode instance list from mode list relative to the component instance ci
protected  void initSwitches()
          Subclasses override this method to set the switch fields #coreSwitch,#componentSwitch, #connectionSwitch,#featureSwitch,#flowSwitch, AadlProcessingSwitch.instanceSwitch, and #propertySwitchto analysis-specific switch implementations.
protected  void instantiateEndToEndFlow(ComponentInstance ci, EndToEndFlow ete, java.util.HashMap<EndToEndFlow,java.util.List<edu.cmu.sei.aadl.instance.CreateEndToEndFlowsSwitch.ETEInfo>> ete2info)
           
protected  void processETE(ComponentInstance ci, EndToEndFlowInstance etei, EndToEndFlow ete)
           
protected  void processETEElement(ComponentInstance ci, EndToEndFlowInstance etei, EndToEndFlowElement fe, edu.cmu.sei.aadl.instance.CreateEndToEndFlowsSwitch.FlowIterator iter, NamedElement errorElement)
          Add all flow instances that continue through the next flow element.
protected  boolean processFlowImpl(ComponentInstance ci, EndToEndFlowInstance etei, FlowImplementation flowImpl)
          Continue the current ETE instance with a flow implementation.
protected  void processFlowStep(ComponentInstance ci, EndToEndFlowInstance etei, EndToEndFlowElement leaf, edu.cmu.sei.aadl.instance.CreateEndToEndFlowsSwitch.FlowIterator iter)
          Add all ETE instances that continue through a given leaf flow element.
protected  void processSubcomponentFlow(ComponentInstance ci, EndToEndFlowInstance etei, SubcomponentFlow subFlow, edu.cmu.sei.aadl.instance.CreateEndToEndFlowsSwitch.FlowIterator iter)
          Instantiate a flow specification by recursively following its implementation until a leaf element is reached In case of a leaf element add it as a flow step
 
Methods inherited from class edu.cmu.sei.aadl.modelsupport.modeltraversal.AadlProcessingSwitchWithProgress
checkIfCancelled
 
Methods inherited from class edu.cmu.sei.aadl.modelsupport.modeltraversal.AadlProcessingSwitch
getAadl2Switch, getInstanceSwitch, process
 
Methods inherited from class edu.cmu.sei.aadl.modelsupport.modeltraversal.ForAllElement
action, cancelled, cancelTraversal, defaultTraversal, defaultTraversal, defaultTraversalAllDeclarativeModels, defaultTraversalAllInstances, error, error, getErrorManager, getResultList, info, info, internalError, internalError, notCancelled, processAllComponentImpl, processBottomUpComponentImpl, processBottomUpComponentImpl, processEList, processObject, processPostOrderAll, processPostOrderAll, processPostOrderAll, processPostOrderAllDeclarativeModels, processPostOrderAllInstances, processPostOrderComponentInstance, processPostOrderComponentInstance, processPreOrderAll, processPreOrderAll, processPreOrderAll, processPreOrderAllDeclarativeModels, processPreOrderAllInstances, processPreOrderComponentInstance, processPreOrderComponentInstance, processResources, processResources, processResourcesIgnoreFailure, processTopDownComponentClassifier, processTopDownComponentClassifierAllDeclarativeModels, processTopDownComponentImpl, processTopDownComponentImpl, processTree, processTreeIgnoreFailure, suchThat, warning, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateEndToEndFlowsSwitch

public CreateEndToEndFlowsSwitch(org.eclipse.core.runtime.IProgressMonitor pm,
                                 AnalysisErrorReporterManager errMgr,
                                 java.util.HashMap<InstanceObject,InstanceUtil.InstantiatedClassifier> classifierCache)
Create a new instance.

Parameters:
pm - the progress monitor
errMgr - the error manager
classifierCache - cache of known instantiated classifiers, may be null
Method Detail

initSwitches

protected final void initSwitches()
Description copied from class: AadlProcessingSwitch
Subclasses override this method to set the switch fields #coreSwitch,#componentSwitch, #connectionSwitch,#featureSwitch,#flowSwitch, AadlProcessingSwitch.instanceSwitch, and #propertySwitchto analysis-specific switch implementations. Implementaions should take care, however, as this method is invoked by the constructor AadlProcessingSwitch.AadlProcessingSwitch(). Only the switches that are actually needed need to be initialized, as the switch fields are previously inialized to default do-nothing switch implementations.

Specified by:
initSwitches in class AadlProcessingSwitch

instantiateEndToEndFlow

protected void instantiateEndToEndFlow(ComponentInstance ci,
                                       EndToEndFlow ete,
                                       java.util.HashMap<EndToEndFlow,java.util.List<edu.cmu.sei.aadl.instance.CreateEndToEndFlowsSwitch.ETEInfo>> ete2info)

processETE

protected void processETE(ComponentInstance ci,
                          EndToEndFlowInstance etei,
                          EndToEndFlow ete)

processETEElement

protected void processETEElement(ComponentInstance ci,
                                 EndToEndFlowInstance etei,
                                 EndToEndFlowElement fe,
                                 edu.cmu.sei.aadl.instance.CreateEndToEndFlowsSwitch.FlowIterator iter,
                                 NamedElement errorElement)
Add all flow instances that continue through the next flow element.

Parameters:
ci - the component instance we're in
etei - the current flow instance
fe - the next flow element
iter - the position in the current ETE declaration
errorElement - the model element that we attach errors to

processSubcomponentFlow

protected void processSubcomponentFlow(ComponentInstance ci,
                                       EndToEndFlowInstance etei,
                                       SubcomponentFlow subFlow,
                                       edu.cmu.sei.aadl.instance.CreateEndToEndFlowsSwitch.FlowIterator iter)
Instantiate a flow specification by recursively following its implementation until a leaf element is reached In case of a leaf element add it as a flow step

Parameters:
ci - the component whose flow specification is to be processed
etei - the end to end flow instance
fs - the flow specification to be processed

processFlowImpl

protected boolean processFlowImpl(ComponentInstance ci,
                                  EndToEndFlowInstance etei,
                                  FlowImplementation flowImpl)
Continue the current ETE instance with a flow implementation.

Parameters:
ci - the component instance whose flow implementation is being processed
etei - the end to end flow instance
flowImpl - the flow implementation to be processed
Returns:
if elements were added to the end to end flow instance

processFlowStep

protected void processFlowStep(ComponentInstance ci,
                               EndToEndFlowInstance etei,
                               EndToEndFlowElement leaf,
                               edu.cmu.sei.aadl.instance.CreateEndToEndFlowsSwitch.FlowIterator iter)
Add all ETE instances that continue through a given leaf flow element. One instance per matching connection.

Parameters:
ci -
etei - the current end to end flow instance
leaf - the next ETE element
iter - the position in the current end to end flow declaration

getModeInstances

protected org.eclipse.emf.common.util.EList<ModeInstance> getModeInstances(ComponentInstance ci,
                                                                           org.eclipse.emf.common.util.EList<Mode> mlist)
build mode instance list from mode list relative to the component instance ci

Parameters:
ci - Component Instance
mlist - mode list
Returns:
list of mode instances

fillinModes

protected void fillinModes(EndToEndFlowInstance etei)