at.dms.kjc.cluster
Interface Tape

All Known Implementing Classes:
TapeBase, TapeCluster, TapeClusterFused, TapeDynrate, TapeFixedBase, TapeFixedCircular, TapeFixedCopydown

public interface Tape

Common elements for all kinds of tapes.
A tape represents the queue of data between two processing nodes. It has a source (processing node), a destination (processing node), it carries items of a particular type. The source end can push items at the front of the tape. The destination end can peek for items on the tape, pop items from the tape (and in the odd case of enqueues push items onto the tape).
Based on Janis' idea of mostly generating strings rather than attempting to hack up IR code and use existing compiler routines to eventually generate the strings. Note to self, known implemenations: cluster nodes using sockets, cluster nodes using cluster fusion, cluster standalone buffers (copy down), cluster standalone buffers (wrap), cluster standalone dynamic rate edges.

Author:
dimock

Method Summary
 String assignPeekToVar(String varName, String offset)
          Assign the result of peeking.
 String assignPopToVar(String varName)
          Statement, but no ";" to pop an item into a variable.
 String dataDeclaration()
          Data declaration: in .c file if needed else noop.
 String dataDeclarationH()
          Data declaration: in .h file if needed else noop.
 String downstreamCleanup()
          Any cleanup needed before exit for downstream end of tape.
 String downstreamDeclaration()
          Data declaration: for code doing downstream processing.
 String downstreamDeclarationExtern()
          Data declaration: following "extern" if needed else noop.
 int getDest()
          Destination of tape.
 String getPeekName()
          name of routine to peek an item from the tape, or in case of an array, the address of an item...
 String getPopName()
          name of routine to pop an item from the tape, or in case of an array, the address of an item...
 String getPushName()
          name of routine to push an item onto the tape.
 int getSource()
          Source of tape.
 CType getType()
          Get type of objects communicated over the tape
 String peekPrefix()
          prefix to peek expression
 String peekSuffix()
          suffix to peek expression
 String popExpr()
          expression to pop an item: to end of statement.
 String popExprCleanup()
          if expression to pop an item requires statements to clean up then this is cleanup.
 String popExprNoCleanup()
          expression to pop an item, really an expression.
 String popManyItems(String destBuffer, int destOffset, int numItems)
           
 String popNStmt(int n)
          prefix to pop N items discarding them.
 String pushbackCleanup()
           
 String pushbackInit(int NumberToPush)
           
 String pushbackPrefix()
           
 String pushbackSuffix()
           
 String pushManyItems(String sourceBuffer, int sourceOffset, int numItems)
           
 String pushPrefix()
          prefix before data expression to push.
 String pushSuffix()
          suffix after data expression to push.
 String topOfWorkIteration()
          Code used at top of work iteration.
 String upstreamCleanup()
          Any cleanup needed before exit for upstream end of tape.
 String upstreamDeclaration()
          Data declaration: for code doing upstream processing.
 String upstreamDeclarationExtern()
          Data declaration: following "extern" if needed else noop.
 

Method Detail

getSource

int getSource()
Source of tape.

Returns:
unique indicator for source SIROperator of tape

getDest

int getDest()
Destination of tape.

Returns:
unique indicator for destination SIROperator of tape

getType

CType getType()
Get type of objects communicated over the tape

Returns:
The type of objects communicated over the tape

getPushName

String getPushName()
name of routine to push an item onto the tape.


getPopName

String getPopName()
name of routine to pop an item from the tape, or in case of an array, the address of an item...


getPeekName

String getPeekName()
name of routine to peek an item from the tape, or in case of an array, the address of an item...


dataDeclarationH

String dataDeclarationH()
Data declaration: in .h file if needed else noop.

Returns:
TODO

dataDeclaration

String dataDeclaration()
Data declaration: in .c file if needed else noop.

Returns:
TODO

downstreamDeclarationExtern

String downstreamDeclarationExtern()
Data declaration: following "extern" if needed else noop. For downstream end of tape.

Returns:
TODO

downstreamDeclaration

String downstreamDeclaration()
Data declaration: for code doing downstream processing.

Returns:
TODO

upstreamDeclarationExtern

String upstreamDeclarationExtern()
Data declaration: following "extern" if needed else noop. For upstream end of tape.

Returns:
TODO

upstreamDeclaration

String upstreamDeclaration()
Data declaration: for code doing upstream processing.

Returns:
TODO

topOfWorkIteration

String topOfWorkIteration()
Code used at top of work iteration.
For instance: resetting pointers in a buffer.

Returns:
TODO

upstreamCleanup

String upstreamCleanup()
Any cleanup needed before exit for upstream end of tape.

Returns:
TODO

downstreamCleanup

String downstreamCleanup()
Any cleanup needed before exit for downstream end of tape.

Returns:
TODO

pushPrefix

String pushPrefix()
prefix before data expression to push.

Returns:
TODO

pushSuffix

String pushSuffix()
suffix after data expression to push.

Returns:
TODO

pushManyItems

String pushManyItems(String sourceBuffer,
                     int sourceOffset,
                     int numItems)

popManyItems

String popManyItems(String destBuffer,
                    int destOffset,
                    int numItems)

assignPopToVar

String assignPopToVar(String varName)
Statement, but no ";" to pop an item into a variable. Useful since C can not handle arrays over tapes by simple assignment.


popExpr

String popExpr()
expression to pop an item: to end of statement.

Returns:
TODO

popExprNoCleanup

String popExprNoCleanup()
expression to pop an item, really an expression.


popExprCleanup

String popExprCleanup()
if expression to pop an item requires statements to clean up then this is cleanup.


popNStmt

String popNStmt(int n)
prefix to pop N items discarding them.

Returns:
TODO

assignPeekToVar

String assignPeekToVar(String varName,
                       String offset)
Assign the result of peeking. Must deal with peeking an array.

Parameters:
varName -
offset -
Returns:

peekPrefix

String peekPrefix()
prefix to peek expression

Returns:
TODO

peekSuffix

String peekSuffix()
suffix to peek expression

Returns:
TODO

pushbackInit

String pushbackInit(int NumberToPush)

pushbackPrefix

String pushbackPrefix()

pushbackSuffix

String pushbackSuffix()

pushbackCleanup

String pushbackCleanup()