|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.codegen.kernel.CodeGeneratorHelper
ptolemy.codegen.rtmaude.kernel.RTMaudeAdaptor
ptolemy.codegen.rtmaude.actor.IOPort
public class IOPort
Generate RTMaude code for an IOPort in DE domain.
IOPort,
Serialized Form
| red (kquine) |
| red (kquine) |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ptolemy.codegen.kernel.CodeGeneratorHelper |
|---|
CodeGeneratorHelper.Channel, CodeGeneratorHelper.VariableScope |
| Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
|---|
NamedObj.ContainedObjectsIterator |
| Field Summary |
|---|
| Fields inherited from class ptolemy.codegen.rtmaude.kernel.RTMaudeAdaptor |
|---|
defaultTermBlock |
| Fields inherited from class ptolemy.codegen.kernel.CodeGeneratorHelper |
|---|
_codeGenerator, _codeStream, _eol, _INDENT1, _INDENT2, _parseTreeCodeGenerator, _portConversions, _referencedParameters |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
|---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Constructor Summary | |
|---|---|
IOPort(IOPort component)
Construct the code generator adaptor associated with the given IOPort. |
|
| Method Summary | |
|---|---|
java.lang.String |
generateCodeForGet(java.lang.String channel)
Generate code for replacing the get() macro. |
java.lang.String |
generateCodeForSend(java.lang.String channel,
java.lang.String dataToken)
Generate code for replacing the send() macro. |
java.lang.String |
generateOffset(java.lang.String offset,
int channel,
boolean isWrite,
Director directorHelper)
Generate the expression that represents the offset in the generated code. |
java.lang.String |
generateTermCode()
Generate a Real-time Maude term representation of given component. |
int |
getBufferSize(int channelNumber)
Get the buffer size of channel of the port. |
java.lang.Object |
getReadOffset(int channelNumber)
Get the read offset of a channel of the port. |
java.lang.Object |
getWriteOffset(int channelNumber)
Get the write offset of a channel of the port. |
java.lang.String |
initializeOffsets()
Initialize the offsets. |
void |
setBufferSize(int channelNumber,
int bufferSize)
Set the buffer size of channel of the port. |
void |
setReadOffset(int channelNumber,
java.lang.Object readOffset)
Set the read offset of a channel of the port. |
void |
setWriteOffset(int channelNumber,
java.lang.Object writeOffset)
Set the write offset of a channel of the port. |
java.lang.String |
updateConnectedPortsOffset(int rate,
Director director)
Update the write offset of the [multiple] connected ports. |
java.lang.String |
updateOffset(int rate,
Director directorHelper)
Update the read offset. |
| Methods inherited from class ptolemy.codegen.rtmaude.kernel.RTMaudeAdaptor |
|---|
_generateBlockCode, _generateTypeConvertMethod, _replaceMacro, generateEntryCode, generateExitCode, generateFireCode, generateFireFunctionCode, getBlockCodeList, getInfo, getModuleCode, getParseTreeCodeGenerator, getRTMmodule, getSharedCode, getTranslatedExpression |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ptolemy.codegen.kernel.ComponentCodeGenerator |
|---|
generateInitializeCode, generateWrapupCode, getComponent, setCodeGenerator |
| Constructor Detail |
|---|
public IOPort(IOPort component)
component - The associated IOPort.| Method Detail |
|---|
public java.lang.String generateTermCode()
throws IllegalActionException
RTMaudeAdaptor
generateTermCode in class RTMaudeAdaptorIllegalActionException
public java.lang.String generateCodeForGet(java.lang.String channel)
throws IllegalActionException
PortCodeGenerator
generateCodeForGet in interface PortCodeGeneratorchannel - The channel for which the get code is generated.
IllegalActionException - If the director adapter class cannot be found.
FIXME: potentially, we could also pass in a boolean that indicates whether
the port the channel resides is a multiport, if it is, then only a static
variable is needed instead of an array of length 1.
public java.lang.String generateCodeForSend(java.lang.String channel,
java.lang.String dataToken)
throws IllegalActionException
PortCodeGenerator
generateCodeForSend in interface PortCodeGeneratorchannel - The channel for which the send code is generated.dataToken - The token to be sent
IllegalActionException - If the director adapter class cannot be found.
FIXME: potentially, we could also pass in a boolean that indicates whether
the port the channel resides is a multiport, if it is, then only a static
variable is needed instead of an array of length 1.
public java.lang.String generateOffset(java.lang.String offset,
int channel,
boolean isWrite,
Director directorHelper)
throws IllegalActionException
PortCodeGenerator
generateOffset in interface PortCodeGeneratoroffset - The specified offset from the user.channel - The referenced port channel.isWrite - Whether to generate the write or read offset.directorHelper - The helper of the director associated with the port.
IllegalActionException - If there is problems getting the port
buffer size or the offset in the channel and offset map.
public int getBufferSize(int channelNumber)
throws IllegalActionException
PortCodeGenerator
getBufferSize in interface PortCodeGeneratorchannelNumber - The number of the channel that is being set.
IllegalActionException - If the buffer size cannot be set.PortCodeGenerator.setBufferSize(int, int)
public java.lang.Object getReadOffset(int channelNumber)
throws IllegalActionException
PortCodeGenerator
getReadOffset in interface PortCodeGeneratorchannelNumber - The number of the channel.
IllegalActionException - If thrown while getting the channel.PortCodeGenerator.setReadOffset(int, Object)
public java.lang.Object getWriteOffset(int channelNumber)
throws IllegalActionException
PortCodeGenerator
getWriteOffset in interface PortCodeGeneratorchannelNumber - The number of the channel.
IllegalActionException - If thrown while getting the channel.PortCodeGenerator.setWriteOffset(int, Object)
public java.lang.String initializeOffsets()
throws IllegalActionException
PortCodeGenerator
initializeOffsets in interface PortCodeGeneratorIllegalActionException - If thrown while getting the channel
or initializing the offset.
public void setBufferSize(int channelNumber,
int bufferSize)
PortCodeGenerator
setBufferSize in interface PortCodeGeneratorchannelNumber - The number of the channel that is being set.bufferSize - The size of the buffer.PortCodeGenerator.getBufferSize(int)
public void setReadOffset(int channelNumber,
java.lang.Object readOffset)
PortCodeGenerator
setReadOffset in interface PortCodeGeneratorchannelNumber - The number of the channel that is being set.readOffset - The offset.PortCodeGenerator.getReadOffset(int)
public void setWriteOffset(int channelNumber,
java.lang.Object writeOffset)
PortCodeGenerator
setWriteOffset in interface PortCodeGeneratorchannelNumber - The number of the channel that is being set.writeOffset - The offset.PortCodeGenerator.getWriteOffset(int)
public java.lang.String updateConnectedPortsOffset(int rate,
Director director)
throws IllegalActionException
PortCodeGenerator
updateConnectedPortsOffset in interface PortCodeGeneratorrate - The rate of the channels.director - The Director helper.
IllegalActionException - If thrown while getting the channel
or updating the offset.
public java.lang.String updateOffset(int rate,
Director directorHelper)
throws IllegalActionException
PortCodeGenerator
updateOffset in interface PortCodeGeneratorrate - The rate of the channels.directorHelper - The Director helper
IllegalActionException - If thrown while getting the channel
or updating the offset.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||