public class BranchController
extends java.lang.Object
implements java.lang.Runnable
Branches are assigned to a branch controller by the director associated with the controller's composite actor via the addBranches() method. This method takes an io port and determines the port's receivers. Branches are then instantiated and assigned to the receivers according to whether the receivers are producer or consumer receivers.
Red (davisj) |
Red (davisj) |
Constructor and Description |
---|
BranchController(CompositeActor container)
Construct a branch controller in the specified composite actor
container.
|
Modifier and Type | Method and Description |
---|---|
protected CompositeProcessDirector |
_getDirector()
Return the director that controls the execution of this
branch controller's containing composite actor.
|
void |
activateBranches()
Activate the branches that are managed by this branch
controller.
|
void |
addBranches(IOPort port)
Add branches corresponding to the channels of the port
argument.
|
void |
deactivateBranches()
Deactivate the branches assigned to this branch controller.
|
java.util.LinkedList |
getBranchList()
Return the list of branches controlled by this controller.
|
CompositeActor |
getParent()
Return the composite actor that contains this branch
controller.
|
boolean |
hasBranches()
Return true if this branch controller controls one or more
branches; return false otherwise.
|
boolean |
isActive()
Return true if this controller is active; return false
otherwise.
|
boolean |
isBlocked()
Return true if all of the branches assigned to this branch
controller are blocked or if this branch controller has no
branches; return false otherwise.
|
void |
run()
Begin executing the branches associated with this branch
controller so that they will begin transferring data in
their assigned channels.
|
void |
setActive(boolean active)
Set this branch controller active if the active parameter is
true; set this branch controller to inactive otherwise.
|
public BranchController(CompositeActor container)
container
- The parent actor that contains this object.public void activateBranches()
public void addBranches(IOPort port) throws IllegalActionException
port
- The port for which branches will be added to this
controller.IllegalActionException
- If branches for the
port have been previously added to this controller or
if the port input/output polarity does not match that
of ports for whom branches were previously add to this
controller.public void deactivateBranches()
public java.util.LinkedList getBranchList()
public CompositeActor getParent()
public boolean hasBranches()
public boolean isActive()
public boolean isBlocked()
public void run()
run
in interface java.lang.Runnable
public void setActive(boolean active)
active
- The indicator of whether this branch controller
will be set active or inactive.protected CompositeProcessDirector _getDirector()