Top Up Prev Next Bottom Contents Index Search

11.2 Communication in SR

Time in SR is divided into discrete instants. In each instant, the communication channels in SR contain a valued event, have no event, or are "undefined," corresponding to when the system could not decide whether there was an event or not. These channels are not buffered, unlike Ptolemy's dataflow domains, and do not hold their values between instants.

Stars in the SR domain have input and output ports, much like they do in other domains. However, primarly because absent events are different from undefined ones, the interface to these ports are unique.

Because SR domain ports are unbuffered, output ports can be read just like input ports. It is often convenient to do this when checking to see whether the value on an output port is already correct and does not need to be changed.

Input/Output Porthole Interface

int SRPortHole::known()
Return TRUE when the value in the port is is known.
int SRPortHole::present()
Return TRUE when the value in the port is present.
int SRPortHole::absent()
Return TRUE when the value in the port is absent.
Particle & InSRPort::get()
Return the particle in the port. This should only be called when present() returns TRUE.

Output Porthole Interface

Particle & OutSRPort::emit()
Force the value on the output port to be present and return a reference to the output particle.
void OutSRPort::makeAbsent()
Force the value on the output port to be absent.


Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.