|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.util.Attribute
ptolemy.actor.Director
ptolemy.actor.DoNothingDirector
public class DoNothingDirector
A director that does nothing, for use in models that have no useful execution.
This director is added to models for code generation purposes when the model has no useful execution but the code generator runs CompositeActor.preinitialize().
If this director is used in a model, then adding a _hide
attribute to the director will make the director invisible to the user.
Red (cxh) |
Red (eal) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary |
---|
Fields inherited from class ptolemy.actor.Director |
---|
_actorsFinishedExecution, _currentTime, _finishRequested, _initializables, _stopRequested, timeResolution |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Fields inherited from interface ptolemy.actor.Executable |
---|
COMPLETED, NOT_READY, STOP_ITERATING |
Constructor Summary | |
---|---|
DoNothingDirector(CompositeEntity container,
java.lang.String name)
Construct a director with the given container and name. |
Method Summary | |
---|---|
void |
addInitializable(Initializable initializable)
Add the specified object to the list of objects whose preinitialize(), initialize(), and wrapup() methods should be invoked upon invocation of the corresponding methods of this object. |
void |
fire()
Iterate all the deeply contained actors of the container of this director exactly once. |
void |
initialize()
Initialize the model controlled by this director. |
boolean |
postfire()
Return true if the director wishes to be scheduled for another iteration. |
boolean |
prefire()
Return true if the director is ready to fire. |
void |
preinitialize()
Validate the attributes and then invoke the preinitialize() methods of all its deeply contained actors. |
boolean |
transferInputs(IOPort port)
Transfer data from an input port of the container to the ports it is connected to on the inside. |
boolean |
transferOutputs(IOPort port)
Transfer data from an output port of the container to the ports it is connected to on the outside. |
void |
wrapup()
Invoke the wrapup() method of all the actors contained in the director's container. |
Methods inherited from class ptolemy.kernel.util.Attribute |
---|
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DoNothingDirector(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor.
IllegalActionException
- If the entity cannot be contained
by the proposed container.
NameDuplicationException
- If the container already has an
actor with this name.Method Detail |
---|
public void addInitializable(Initializable initializable)
Director
addInitializable
in interface Initializable
addInitializable
in class Director
initializable
- The object whose methods should be invoked.Director.removeInitializable(Initializable)
,
CompositeActor.addPiggyback(Executable)
public void fire()
Director
This method is not synchronized on the workspace, so the caller should be.
In this base class, an attempt is made to fire each actor exactly once, in the order they were created. Prefire is called once, and if prefire returns true, then fire is called once, followed by postfire. The return value from postfire is ignored. If the container is not an instance of CompositeActor, however, then this method does nothing.
fire
in interface Executable
fire
in class Director
public void initialize()
Director
initialize
in interface Initializable
initialize
in class Director
public boolean postfire()
Director
In this base class, return the false if stop() has been called since preinitialize(), and true otherwise. Derived classes that override this method need to respect this semantics. The protected variable _stopRequested indicates whether stop() has been called.
postfire
in interface Executable
postfire
in class Director
public boolean prefire()
Director
In this base class, assume that the director is always ready to be fired, and so return true. Domain directors should probably override this method to provide domain-specific behavior. However, they should call super.prefire() if they wish to propagate time as done here.
prefire
in interface Executable
prefire
in class Director
public void preinitialize()
Director
This method also resets the protected variable _stopRequested to false, so if a derived class overrides this method, then it should also do that.
This method is not synchronized on the workspace, so the caller should be.
preinitialize
in interface Initializable
preinitialize
in class Director
public boolean transferInputs(IOPort port)
Director
transferInputs
in class Director
port
- The port to transfer tokens from.
public boolean transferOutputs(IOPort port)
Director
transferOutputs
in class Director
port
- The port to transfer tokens from.
public void wrapup()
Director
This method should be invoked once per execution. None of the other action methods should be invoked after it in the execution. This method is not synchronized on the workspace, so the caller should be.
wrapup
in interface Initializable
wrapup
in class Director
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |