ptolemy.domains.sr.lib
Class Latch
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.actor.lib.Transformer
ptolemy.domains.sr.lib.Latch
- All Implemented Interfaces:
- Actor, Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, Executable, Instantiable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable, TypedActor
- public class Latch
- extends Transformer
This actor implements a latch. It has one input port and
one output port, both of which are single ports. A token that is received
on the input port is sent to the output port immediately, and also every time
the actor is fired until a new token is received. No tokens are output until
the first token is received at the input.
Note that this actor is not really a latch in the classical sense
of the term since it is missing a trigger. This actor will not
be of much use in the DE domain, see the DE Sampler actor for
an alternative. This actor is useful in domains with non-strict semantics
like SR and Giotto.
FIXME: This actor should be modified to handle multiports, but under SR
a multiport version of this actor hangs in
$PTII/ptolemy/actor/lib/test/auto/Latch.xml
- Since:
- Ptolemy II 2.0
- Version:
- $Id: Latch.java,v 1.13 2004/04/13 03:36:39 cxh Exp $
- Author:
- Paul Whitaker, Christopher Hylands
- See Also:
Sampler,
Serialized Form
- Accepted Rating:
| Red (cxh) Should support multiports |
- Proposed Rating:
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
|
Constructor Summary |
Latch(CompositeEntity container,
java.lang.String name)
Construct an actor in the specified container with the specified
name. |
|
Method Summary |
void |
fire()
If there is a token on the input port, consume exactly one token
from the input port, and output this token. |
void |
initialize()
Initialize the buffer variable. |
| Methods inherited from class ptolemy.actor.AtomicActor |
_createReceivers, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, removeDependency, setContainer, stop, stopFire, terminate, wrapup |
| Methods inherited from class ptolemy.kernel.Entity |
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables |
| Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Latch
public Latch(CompositeEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
- Construct an actor in the specified container with the specified
name.
- Parameters:
container - The container.name - The name of this actor within the container.
- Throws:
IllegalActionException - If the actor cannot be contained
by the proposed container.
NameDuplicationException - If the name coincides with
an actor already in the container.
fire
public void fire()
throws IllegalActionException
- If there is a token on the input port, consume exactly one token
from the input port, and output this token. If there is no token
on the input port, output the most recent token received, if any.
- Specified by:
fire in interface Executable- Overrides:
fire in class AtomicActor
- Throws:
IllegalActionException - If there is no director.
initialize
public void initialize()
throws IllegalActionException
- Initialize the buffer variable.
- Specified by:
initialize in interface Executable- Overrides:
initialize in class AtomicActor
- Throws:
IllegalActionException - If there is no director.