at.dms.kjc.iterator
Class SIRSplitJoinIter

java.lang.Object
  extended by at.dms.kjc.iterator.SIRIterator
      extended by at.dms.kjc.iterator.SIRSplitJoinIter
All Implemented Interfaces:
Iterator, IteratorBase, JoinerIter, SplitJoinIter, SplitterIter, SplitterNJoinerIter
Direct Known Subclasses:
SIRFineGrainedSplitJoinIter

public class SIRSplitJoinIter
extends SIRIterator
implements SplitJoinIter

IterFactory uses this for SIRSplitJoin. Includes extra methods as appropriate.


Field Summary
protected  SIRSplitJoin obj
          Object pointed to by this iterator.
 
Fields inherited from class at.dms.kjc.iterator.SIRIterator
factory
 
Method Summary
 void accept(StreamVisitor v)
           
 SIRIterator get(int i)
          Same as getChild with different signature.
 Iterator getChild(int n)
          Returns the n-th child of the SplitJoin.
 int getFanIn()
          Returns the number of ways this Joiner joines data.
 int getFanOut()
          Returns the number of ways this Splitter splits data.
 int getJoinerNumWork()
          Returns the number of work functions for the Joiner of this Stream.
 Object getJoinerWork(int nWork)
          Returns n-th work function associated with this Joiner.
 int[] getJoinPopWeights(int nWork)
          Returns distribution of weights on a particular invocation of work function for Joiner of this SplitJoin.
 int getJoinPush(int nWork)
          Returns number of data items produced by a particular invocation of work function for Joiner of this SplitJoin.
 int getNumChildren()
          Returns the number of children that this SplitJoin has.
 int getSplitPop(int nWork)
          Returns number of data items consumed by a particular invocation of work function for Splitter of this Stream.
 int[] getSplitPushWeights(int nWork)
          Returns distribution of weights on a particular invocation of work function for Splitter of this Stream.
 int getSplitterNumWork()
          Returns the number of work functions for this Splitter.
 Object getSplitterWork(int nWork)
          Returns n-th work function associated with this Splitter.
 SIRStream getStream()
          Return the stream pointed to by this.
 Iterator getUnspecializedIter()
          This function is needed by the scheduler, but isn't useful from the compiler.
 SplitJoinIter isSplitJoin()
          Checks if the iterator points to a SplitJoin.
 
Methods inherited from class at.dms.kjc.iterator.SIRIterator
checkValidity, equals, getObject, getParent, getParents, getPos, getRelativeName, hashCode, invalidateNode, invalidateTree, isFeedbackLoop, isFilter, isPipeline
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface streamit.scheduler2.iriter.IteratorBase
equals, getObject, hashCode
 

Field Detail

obj

protected SIRSplitJoin obj
Object pointed to by this iterator.

Method Detail

isSplitJoin

public SplitJoinIter isSplitJoin()
Description copied from interface: Iterator
Checks if the iterator points to a SplitJoin. If so, returns a SplitJoin iterator that points to the same object. If not, returns null.

Specified by:
isSplitJoin in interface Iterator
Overrides:
isSplitJoin in class SIRIterator
Returns:
iterator to a SplitJoin or null if self doesn't point to a SplitJoin

getStream

public SIRStream getStream()
Return the stream pointed to by this.

Specified by:
getStream in class SIRIterator

getNumChildren

public int getNumChildren()
Description copied from interface: SplitJoinIter
Returns the number of children that this SplitJoin has. If some of the children and sinks or joins, they still count to this total.

Specified by:
getNumChildren in interface SplitJoinIter
Returns:
number of children of this SplitJoin

getChild

public Iterator getChild(int n)
Description copied from interface: SplitJoinIter
Returns the n-th child of the SplitJoin. If the SplitJoin doesn't have enough children (n is too large), this function asserts and throws an AssertionError.

Specified by:
getChild in interface SplitJoinIter
Returns:
n-th child of the SplitJoin

get

public SIRIterator get(int i)
Same as getChild with different signature.


getFanOut

public int getFanOut()
Returns the number of ways this Splitter splits data.

Specified by:
getFanOut in interface SplitterIter
Returns:
return Splitter fan-out

getSplitterNumWork

public int getSplitterNumWork()
Returns the number of work functions for this Splitter.

Specified by:
getSplitterNumWork in interface SplitterIter
Returns:
number of work functions for this Splitter

getSplitPushWeights

public int[] getSplitPushWeights(int nWork)
Returns distribution of weights on a particular invocation of work function for Splitter of this Stream. The distribution is simply an array of ints, with numChildren elements. The value at index 0 corresponds to number of items pushed out to 1st child, etc.

Specified by:
getSplitPushWeights in interface SplitterIter
Returns:
distribution of weights on a particular invocation of work function for the Splitter of this Stream.

getSplitPop

public int getSplitPop(int nWork)
Returns number of data items consumed by a particular invocation of work function for Splitter of this Stream. These are the items that will end up being pushed out to the children of this Stream.

Specified by:
getSplitPop in interface SplitterIter
Returns:
number of data items consumed by a particular invocation of work function for Splitter of this Stream.

getFanIn

public int getFanIn()
Returns the number of ways this Joiner joines data.

Specified by:
getFanIn in interface JoinerIter
Returns:
return Joiner fan-in

getJoinerNumWork

public int getJoinerNumWork()
Returns the number of work functions for the Joiner of this Stream.

Specified by:
getJoinerNumWork in interface JoinerIter
Returns:
number of work functions for the JOiner of this Stream

getSplitterWork

public Object getSplitterWork(int nWork)
Returns n-th work function associated with this Splitter.

Specified by:
getSplitterWork in interface SplitterIter
Returns:
n-th work function for the Splitter

getJoinerWork

public Object getJoinerWork(int nWork)
Returns n-th work function associated with this Joiner.

Specified by:
getJoinerWork in interface JoinerIter
Returns:
n-th work function for the Joiner

getJoinPopWeights

public int[] getJoinPopWeights(int nWork)
Returns distribution of weights on a particular invocation of work function for Joiner of this SplitJoin. The distribution is simply an array of ints, with numChildren elements. The value at index 0 corresponds to number of items popped from 1st child, etc.

Specified by:
getJoinPopWeights in interface JoinerIter
Returns:
distribution of weights on a particular invocation of work function for Joiner of this SplitJoin.

getJoinPush

public int getJoinPush(int nWork)
Returns number of data items produced by a particular invocation of work function for Joiner of this SplitJoin. These are the items that were consumed from various children of this SplitJoin.

Specified by:
getJoinPush in interface JoinerIter
Returns:
number of data items produced by a particular invocation of work function for Joiner of this SplitJoin.

accept

public void accept(StreamVisitor v)
Specified by:
accept in class SIRIterator

getUnspecializedIter

public Iterator getUnspecializedIter()
This function is needed by the scheduler, but isn't useful from the compiler.

Specified by:
getUnspecializedIter in interface SplitterNJoinerIter
Returns:
an Iterator that points to the same object