|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.actor.process.BranchController
public class BranchController
A BranchController manages the execution of a set of branch objects by monitoring whether the branches have blocked. A branch blocks when it is either unable to get data from its producer receiver or put data into its consumer receiver. When a branch blocks, it registers the block with its branch controller by passing the specific receiver that is blocked. If all of a branch controllers branches are blocked, then the branch controller informs the director associated with its containing composite actors.
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 determine's 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) |
Field Summary | |
---|---|
private java.util.LinkedList |
_branches
|
private int |
_branchesBlocked
|
private boolean |
_isActive
|
private CompositeActor |
_parentActor
|
private java.util.LinkedList |
_ports
|
Constructor Summary | |
---|---|
BranchController(CompositeActor container)
Construct a branch controller in the specified composite actor container. |
Method Summary | |
---|---|
protected CompositeProcessDirector |
_getDirector()
Return the director that controls the execution of this branch controller's containing composite actor. |
private boolean |
_hasInputPorts()
Return true if this branch controller has input ports associated with it; return false otherwise. |
private boolean |
_hasOutputPorts()
Return true if this branch controller has output ports associated with it; return false otherwise. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int _branchesBlocked
private CompositeActor _parentActor
private java.util.LinkedList _branches
private java.util.LinkedList _ports
private boolean _isActive
Constructor Detail |
---|
public BranchController(CompositeActor container)
container
- The parent actor that contains this object.Method Detail |
---|
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()
private boolean _hasInputPorts()
private boolean _hasOutputPorts()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |