Package ptolemy.domains.wireless.kernel
Class WirelessReceiver
- java.lang.Object
-
- ptolemy.actor.AbstractReceiver
-
- ptolemy.domains.de.kernel.DEReceiver
-
- ptolemy.domains.wireless.kernel.WirelessReceiver
-
- All Implemented Interfaces:
Receiver
public class WirelessReceiver extends DEReceiver
A receiver for use in the wireless domain.This receiver overrides the base class to handle transmission properties. This receiver works by bundling the token and its transmission properties into a record token, and then unbundling at the corresponding get() methods. FIXME: properties should be a RecordToken instead of Token. But I couldn't fix this until we can create an empty record token. yang
- Since:
- Ptolemy II 4.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Yellow (cxh)
- Pt.ProposedRating:
- Green (cxh)
-
-
Field Summary
-
Fields inherited from class ptolemy.domains.de.kernel.DEReceiver
_directorVersion, _tokens
-
-
Constructor Summary
Constructors Constructor Description WirelessReceiver()
Construct an empty WirelessReceiver with no container.WirelessReceiver(IOPort container)
Construct an empty WirelessReceiver with the specified container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Token
get()
Override the base class to unbundle the token and its properties.Token
getProperties()
Return the properties token associated with the most recent call to get(), or null if there was none.void
put(Token token)
Override the base class to attach an empty properties token.void
put(Token token, Token properties)
Put the specified token bundled with the specified properties.-
Methods inherited from class ptolemy.domains.de.kernel.DEReceiver
clear, elementList, hasRoom, hasRoom, hasToken, hasToken
-
Methods inherited from class ptolemy.actor.AbstractReceiver
getArray, getContainer, getCurrentTime, getModelTime, isKnown, putArray, putArrayToAll, putToAll, reset, setContainer, toString
-
-
-
-
Constructor Detail
-
WirelessReceiver
public WirelessReceiver()
Construct an empty WirelessReceiver with no container.
-
WirelessReceiver
public WirelessReceiver(IOPort container) throws IllegalActionException
Construct an empty WirelessReceiver with the specified container.- Parameters:
container
- The container.- Throws:
IllegalActionException
- If the container does not accept this receiver.
-
-
Method Detail
-
get
public Token get() throws NoTokenException
Override the base class to unbundle the token and its properties. After this is called, the properties are available via the getProperties() method.- Specified by:
get
in interfaceReceiver
- Overrides:
get
in classDEReceiver
- Returns:
- The next token in the receiver.
- Throws:
NoTokenException
- If there are no more tokens. This is a runtime exception, so it need not be declared explicitly.- See Also:
getProperties()
,Receiver.get()
-
getProperties
public Token getProperties()
Return the properties token associated with the most recent call to get(), or null if there was none.- Returns:
- A properties token or null.
-
put
public void put(Token token) throws IllegalActionException
Override the base class to attach an empty properties token.- Specified by:
put
in interfaceReceiver
- Overrides:
put
in classDEReceiver
- Parameters:
token
- The token to put, or null to send no token.- Throws:
IllegalActionException
- If cannot get the director or if the current microstep is zero.- See Also:
DEReceiver.put(ptolemy.data.Token)
-
put
public void put(Token token, Token properties) throws IllegalActionException
Put the specified token bundled with the specified properties.- Parameters:
token
- The token to put, or null to send no token.properties
- The associated properties, or null to not put any in.- Throws:
IllegalActionException
- If cannot get the director or if the current microstep is zero.
-
-