public class WirelessIOPort extends TypedIOPort
This port can be used on the boundary of wireless domain models. A port is outside wireless if an outside channel name is given and a wireless channel with the given name is contained by the container of the port's container (transparent hierarchy is not supported). Specially, it will use the specified wireless channel to communicate on the outside. A port is inside wireless if an inside channel name is given and a wireless channel with the given name is contained by the container of this port. It will use the specified wireless channel to communicate on the inside. If no outside channel or inside channel name is given or the named channel does not exist, then the behavior of the port reverts to that of the base class. Specifically, it will only communicate if it is wired.
It is valid for a model using the wireless director to have both wireless communication and wired communication, i.e. it may contain actors with ports using wireless communication (by specifying a wireless channel) and actors with ports using wired communication. If a port is outside/inside wireless(a wireless channel is specified), it will ignore all the communication through the wired connections to it if there is any on the outside/inside of it.
The width of this port on either side that is using wireless communication is fixed at one. Otherwise, it depends on the number of links to the port.
When this port is used for wireless communications, nothing is connected to it. Consequently, methods that access the topology such as connectedPortList() and deepConnectedInPortList() return an empty list. There are no deeply connected ports. However, sinkPortList() returns the port of the specified wireless channel. A consequence of this is that type constraints are automatically set up between ports that send on the channel and the channel port.
| Yellow (cxh) |
| Green (cxh) |
TypedIOPort.RunTimeTypeCheckExceptionNamedObj.ContainedObjectsIterator| Modifier and Type | Field and Description |
|---|---|
StringParameter |
insideChannel
The name of the inside channel.
|
Parameter |
insideTransmitProperties
The transmit properties of this port for inside transmissions.
|
StringParameter |
outsideChannel
The name of the outside channel.
|
Parameter |
outsideTransmitProperties
The transmit properties of this port for outside transmissions.
|
_resolvedType, TYPE_constantLimit, _constantToken, _constantTokensSent, _hasPortEventListeners, _portEventListeners, CONFIGURATION, defaultValue, RECEIVERS, REMOTERECEIVERS_insideLinks, _relationsList_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS| Constructor and Description |
|---|
WirelessIOPort(ComponentEntity container,
java.lang.String name)
Construct a port with the specified container and name
that is neither an input nor an output.
|
WirelessIOPort(ComponentEntity container,
java.lang.String name,
boolean isInput,
boolean isOutput)
Construct a port with a container and a name that is
either an input, an output, or both, depending on the third
and fourth arguments.
|
WirelessIOPort(Workspace workspace)
Construct a port in the specified workspace with an empty
string as a name.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
_insideIsWireless()
Return true if the port is inside wireless.
|
protected boolean |
_outsideIsWireless()
Return true if the port is outside wireless.
|
void |
attributeChanged(Attribute attribute)
If the attribute is one of the properties attributes, make sure
its value is a record token.
|
void |
broadcast(Token token)
Override the base class to delegate to the channel if there is
one.
|
void |
broadcast(Token[] tokenArray,
int vectorLength)
Override the base class to delegate to the channel if there is
one.
|
void |
broadcastClear()
Override the base class to delegate to the channel if there is
one.
|
java.lang.Object |
clone(Workspace workspace)
Clone the object into the specified workspace.
|
void |
createReceivers()
Override the base class to create receivers for WirelessIOPort.
|
WirelessChannel |
getInsideChannel()
Get the channel specified by the insideChannel parameter.
|
Receiver[][] |
getInsideReceivers()
Override the base class to return the inside receiver for wireless
communication if wireless communication is being used.
|
WirelessChannel |
getOutsideChannel()
Get the channel specified by the outsideChannel parameter.
|
Token |
getProperties(int channelIndex)
Get the properties token associated with the data token most
recently retrieved using get().
|
Token |
getPropertiesInside(int channelIndex)
Get the properties token associated with the data token most
recently retrieved using getInside().
|
Receiver[][] |
getReceivers()
Override the base class to return the outside receiver for wireless
communication if wireless communication is being used.
|
int |
getWidth()
Get the width of the port.
|
int |
getWidthInside()
Return the inside width of this port.
|
boolean |
hasRoom(int channelIndex)
Override the base class to always return true if there is
a wireless channel, and otherwise, defer to the base class.
|
boolean |
hasRoomInside(int channelIndex)
Override the base class to always return true if there is
a wireless channel, and otherwise, defer to the base class.
|
java.util.List |
insideSinkPortList()
Return a list of the ports that can potentially accept data
from this port when it sends on the inside.
|
java.util.List |
insideSourcePortList()
Return a list of the ports that can potentially send data to
this port from the inside.
|
int |
numberOfSinks()
Return 1 if the port is outside wireless, which represents the
channel port of the outside wireless channel.
|
int |
numberOfSources()
Return 1 if the port is outside wireless,, which represents the
channel port of the outside wireless channel.
|
void |
send(int channelIndex,
Token token)
Override the base class to delegate to the wireless channel if
the port is outside wireless.
|
void |
send(int channelIndex,
Token[] tokenArray,
int vectorLength)
Override the base class to delegate to the wireless channel if
the port is outside wireless.
|
void |
sendClear(int channelIndex)
Override the base class to delegate to the wireless channel if
the port is outside wireless.
|
void |
sendClearInside(int channelIndex)
Override the base class to delegate to the wireless channel if
the port is inside wireless.
|
void |
sendInside(int channelIndex,
Token token)
Override the base class to delegate to the wireless channel if
the port is inside wireless.
|
java.util.List |
sinkPortList()
Return a list of the ports that can potentially accept data
from this port when it sends on the outside.
|
java.util.List |
sourcePortList()
Return a list of the ports that can potentially send data to
this port from the outside.
|
_checkContainer, _checkLiberalLink, _checkLink, _checkType, _checkTypedIOPortContainer, _description, addTypeListener, convert, getAutomaticTypeConversion, getType, getTypeTerm, isTypeAcceptable, removeTypeListener, setAutomaticTypeConversion, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, typeConstraintList, typeConstraints_checkLiberalLink, _exportMoMLContents, _getInsideWidth, _getOutsideWidth, _getReceiversLinkedToGroup, _newInsideReceiver, _newInsideReceiver, _newReceiver, _newReceiver, _notifyPortEventListeners, _removeReceivers, _setConstant, _wrapReceiver, addIOPortEventListener, checkWidthConstraints, deepConnectedInPortList, deepConnectedInPorts, deepConnectedOutPortList, deepConnectedOutPorts, deepGetReceivers, get, get, getChannelForReceiver, getCommunicationAspects, getCurrentTime, getDefaultWidth, getInside, getModelTime, getReceivers, getReceivers, getRelationIndex, getRemoteReceivers, getRemoteReceivers, getWidthFromConstraints, hasNewToken, hasNewTokenInside, hasToken, hasToken, hasTokenInside, hasWidthConstraints, insertLink, invalidateCommunicationAspects, isInput, isInsideConnected, isKnown, isKnown, isKnownInside, isMultiport, isOutput, isOutsideConnected, liberalLink, link, removeIOPortEventListener, reset, setContainer, setDefaultWidth, setInput, setMultiport, setOutput, setWidthEquals, setWidthEquals, transferInputs, transferOutputs, unlink, unlink, unlinkAll, unlinkAllInside, unlinkInside, unlinkInside_deepConnectedPortList, _deepConnectedPorts, _deepInsidePortList, _deepInsidePorts, _isInsideLinkable, deepConnectedPortList, deepConnectedPorts, deepInsidePortList, deepInsidePorts, insertInsideLink, insidePortList, insidePorts, insideRelationList, insideRelations, isDeeplyConnected, isInsideGroupLinked, isInsideLinked, isOpaque, numInsideLinks_getContainedObject, _propagateExistence, connectedPortList, connectedPorts, getContainer, isGroupLinked, isLinked, linkedRelationList, linkedRelations, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, numLinks, setName_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspacepublic StringParameter insideChannel
public Parameter insideTransmitProperties
public StringParameter outsideChannel
public Parameter outsideTransmitProperties
public WirelessIOPort(Workspace workspace) throws IllegalActionException, NameDuplicationException
workspace - The workspace that will list the port.IllegalActionException - If creating the parameters
of this port throws it.NameDuplicationException - If creating the parameters
of this port throws it.public WirelessIOPort(ComponentEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container - The container actor.name - The name of the port.IllegalActionException - If the port is not of an acceptable
class for the container, or if the container does not implement the
Actor interface.NameDuplicationException - If the name coincides with
a port already in the container.public WirelessIOPort(ComponentEntity container, java.lang.String name, boolean isInput, boolean isOutput) throws IllegalActionException, NameDuplicationException
container - The container actor.name - The name of the port.isInput - True if this is to be an input port.isOutput - True if this is to be an output port.IllegalActionException - If the port is not of an acceptable
class for the container, or if the container does not implement the
Actor interface.NameDuplicationException - If the name coincides with
a port already in the container.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged in class TypedIOPortattribute - The attribute that changed.IllegalActionException - If the change is not acceptable
to this container.public void broadcast(Token token) throws IllegalActionException
broadcast in class TypedIOPorttoken - The token to send.IllegalActionException - If the port is not an output,
or if the outsideChannel parameter cannot be evaluated
or if the transmit() method throws an IllegalActionException.public void broadcast(Token[] tokenArray, int vectorLength) throws IllegalActionException, NoRoomException
broadcast in class TypedIOPorttokenArray - The token array to sendvectorLength - The number of elements of the token
array to send.NoRoomException - If there is no room in the receiver.IllegalActionException - If the tokens to be sent cannot
be converted to the type of this portpublic void broadcastClear()
throws IllegalActionException
broadcastClear in class IOPortIllegalActionException - If a receiver does not support
clear().IOPort.sendClear(int )public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone in class TypedIOPortworkspace - The workspace for the cloned object.java.lang.CloneNotSupportedException - Not thrown in this base classNamedObj.exportMoML(Writer, int, String),
NamedObj.setDeferringChangeRequests(boolean)public void createReceivers()
throws IllegalActionException
createReceivers in class IOPortIllegalActionException - If this port is not
an opaque input port or if there is no director.public WirelessChannel getInsideChannel() throws IllegalActionException
IllegalActionException - If the insideChannel
parameter value cannot be evaluated.public Receiver[][] getInsideReceivers()
getInsideReceivers in class IOPortIOPort.getInside(int)public WirelessChannel getOutsideChannel() throws IllegalActionException
IllegalActionException - If the outsideChannel
parameter value cannot be evaluated.public Token getProperties(int channelIndex)
channelIndex - The channel index.IOPort.get(int),
IOPort.get(int, int)public Token getPropertiesInside(int channelIndex)
channelIndex - The channel index.IOPort.getInside(int)public Receiver[][] getReceivers()
getReceivers in class IOPortpublic int getWidth()
throws IllegalActionException
getWidth in class IOPortIllegalActionExceptionIOPort.numberOfSinks(),
IOPort.numberOfSources()public int getWidthInside()
throws IllegalActionException
getWidthInside in class IOPortIllegalActionExceptionpublic boolean hasRoom(int channelIndex)
throws IllegalActionException
hasRoom in class IOPortchannelIndex - The channel index.IllegalActionException - If the receivers do not support
this query, if this is not an output port, or if the channel index
is out of range.public boolean hasRoomInside(int channelIndex)
throws IllegalActionException
hasRoomInside in class IOPortchannelIndex - The channel index.IllegalActionException - If the receivers do not support
this query, if this is not an output port, or if the channel index
is out of range.public java.util.List insideSinkPortList()
insideSinkPortList in class IOPortIOPort.deepGetReceivers()public java.util.List insideSourcePortList()
insideSourcePortList in class IOPortpublic int numberOfSinks()
numberOfSinks in class IOPortIOPort.sinkPortList(),
IOPort.numberOfSources(),
IOPort.getWidth()public int numberOfSources()
numberOfSources in class IOPortIOPort.sourcePortList(),
IOPort.numberOfSinks(),
IOPort.getWidth()public void send(int channelIndex,
Token token)
throws IllegalActionException,
NoRoomException
send in class TypedIOPortchannelIndex - The index of the channel, from 0 to width-1.
If there is an outside channel, then this argument is ignored.token - The token to send.IllegalActionException - If the port is not an output,
or if the token to be sent cannot
be converted to the type of this port, or if the token is null.NoRoomException - If there is no room in the receiver.
This should not occur in the DE domain.public void send(int channelIndex,
Token[] tokenArray,
int vectorLength)
throws IllegalActionException,
NoRoomException
send in class TypedIOPortchannelIndex - The index of the channel, from 0 to width-1
If there is an outside channel, then this argument is ignored.tokenArray - The token array to sendvectorLength - The number of elements of the token
array to send.NoRoomException - If there is no room in the receiver.IllegalActionException - If the tokens to be sent cannot
be converted to the type of this port, or if the vectorLength
argument is greater than the length of the tokenArray
argument.public void sendClear(int channelIndex)
throws IllegalActionException
sendClear in class IOPortchannelIndex - The index of the channel, from 0 to width-1.
If there is an outside channel, then this argument is ignored.IllegalActionException - If a receiver does not support
clear().IOPort.broadcastClear(),
IOPort.sendClearInside(int)public void sendClearInside(int channelIndex)
throws IllegalActionException
sendClearInside in class IOPortchannelIndex - The index of the channel, from 0 to width-1.
If there is an inside channel, then this argument is ignored.IllegalActionException - If a receiver does not support
clear().IOPort.sendClear(int)public void sendInside(int channelIndex,
Token token)
throws IllegalActionException,
NoRoomException
sendInside in class TypedIOPortchannelIndex - The index of the channel, from 0 to width-1.
If there is an inside channel, then this argument is ignored.token - The token to sendNoRoomException - If there is no room in the receiver.IllegalActionException - If conversion to the type of
the destination port cannot be done.public java.util.List sinkPortList()
sinkPortList in class IOPortIOPort.getRemoteReceivers()public java.util.List sourcePortList()
sourcePortList in class IOPortprotected boolean _insideIsWireless()
protected boolean _outsideIsWireless()