gov.nasa.gsfc.drl.rtstps.core
Class Broadcaster

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.Broadcaster
All Implemented Interfaces:
Receiver
Direct Known Subclasses:
FrameBroadcaster, PacketBroadcaster, UnitBroadcaster

public abstract class Broadcaster
extends java.lang.Object
implements Receiver

This is the base class for broadcasters. RtStpsNodes that send units (frames, packets, or units) to receivers use a broadcaster to send them to more than one receiver.

All broadcasters could be made into RtStpsNodes without difficulty. I did not do this because I embed a broadcaster in every RT-STPS node, so there is no need for a standalone broadcaster node.


Field Summary
protected  java.lang.String name
           
protected  java.util.ArrayList<Receiver> output
           
 
Constructor Summary
protected Broadcaster(java.lang.String name, Receiver r1, Receiver r2)
          Create a Broadcaster with an initial two target receivers.
 
Method Summary
 void addReceiver(Receiver r)
          Add a receiver to the broadcast list of receivers.
 void flush()
          Flush the pipeline.
 java.lang.String getLinkName()
          Get this broacaster's name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

output

protected java.util.ArrayList<Receiver> output
Constructor Detail

Broadcaster

protected Broadcaster(java.lang.String name,
                      Receiver r1,
                      Receiver r2)
Create a Broadcaster with an initial two target receivers.

Parameters:
name - A name used to tag error messages.
r1 - The first receiver.
r2 - The second receiver.
Method Detail

getLinkName

public java.lang.String getLinkName()
Get this broacaster's name.

Specified by:
getLinkName in interface Receiver

addReceiver

public void addReceiver(Receiver r)
Add a receiver to the broadcast list of receivers. It is the user's responsibility to ensure that the receiver is of the correct type.


flush

public void flush()
           throws RtStpsException
Flush the pipeline.

Specified by:
flush in interface Receiver
Throws:
RtStpsException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object