
Source |
ptolemy.actor.lib.Source |
Base for simple data sources. This provides an output
port and a trigger input port, both exposed as public variables.
The trigger port is a multiport with undeclared type, meaning that
you can supply it with any data type. The trigger port can also be
left unconnected. The purpose of the trigger input is to
(optionally) supply events that cause the actor to fire. If the
port is connected to something, then this actor will check it
for a token and return false from prefire() if there is no token.
each channel of the trigger input, if any, and then discards the
token.
Some derived classes may attach additional significance to an input
on the trigger port. For example, they might fix the type and attach
some significance to the value. Note that it is not recommend to
use getWidth() on the port to determine whether the port is connected,
since the width may be greater than zero even if there
is no actual source of data. This can occur, for example, if a trigger port
is connected to the inside of a port of an opaque composite actor, and
there is nothing connected to the outside of that port. It is not
recommended to make the behavior of an actor dependent on a global
property such as whether there is ultimately a source of data.
Author(s): Edward A. Lee
Version:$Id: Source.java,v 1.45 2005/07/08 19:56:07 cxh Exp $
Pt.Proposed Rating:Green (eal)
Pt.Accepted Rating:Green (bilung)
output
The output port. The type of this port is unspecified.
Derived classes may set it.
trigger
The trigger port. The type of this port is undeclared, meaning
that it will resolve to any data type.