|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PortCodeGenerator
Language independent code generator for Ptolemy ports.
Red (cxh) |
Red (cxh) |
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. |
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 interface ptolemy.codegen.kernel.ComponentCodeGenerator |
---|
generateInitializeCode, generateWrapupCode, getComponent, setCodeGenerator |
Method Detail |
---|
java.lang.String generateOffset(java.lang.String offset, int channel, boolean isWrite, Director directorHelper) throws IllegalActionException
offset
- 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.java.lang.String generateCodeForGet(java.lang.String channel) throws IllegalActionException
channel
- 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.java.lang.String generateCodeForSend(java.lang.String channel, java.lang.String dataToken) throws IllegalActionException
channel
- 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.int getBufferSize(int channelNumber) throws IllegalActionException
channelNumber
- The number of the channel that is being set.
IllegalActionException
- If the buffer size cannot be set.setBufferSize(int, int)
java.lang.Object getReadOffset(int channelNumber) throws IllegalActionException
channelNumber
- The number of the channel.
IllegalActionException
- If thrown while getting the channel.setReadOffset(int, Object)
java.lang.Object getWriteOffset(int channelNumber) throws IllegalActionException
channelNumber
- The number of the channel.
IllegalActionException
- If thrown while getting the channel.setWriteOffset(int, Object)
void setBufferSize(int channelNumber, int bufferSize)
channelNumber
- The number of the channel that is being set.bufferSize
- The size of the buffer.getBufferSize(int)
void setReadOffset(int channelNumber, java.lang.Object readOffset)
channelNumber
- The number of the channel that is being set.readOffset
- The offset.getReadOffset(int)
void setWriteOffset(int channelNumber, java.lang.Object writeOffset)
channelNumber
- The number of the channel that is being set.writeOffset
- The offset.getWriteOffset(int)
java.lang.String updateOffset(int rate, Director directorHelper) throws IllegalActionException
rate
- The rate of the channels.directorHelper
- The Director helper
IllegalActionException
- If thrown while getting the channel
or updating the offset.java.lang.String updateConnectedPortsOffset(int rate, Director director) throws IllegalActionException
rate
- The rate of the channels.director
- The Director helper.
IllegalActionException
- If thrown while getting the channel
or updating the offset.java.lang.String initializeOffsets() throws IllegalActionException
IllegalActionException
- If thrown while getting the channel
or initializing the offset.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |