at.dms.kjc.sir.lowering.partition
Class StreamTransform

java.lang.Object
  extended by at.dms.kjc.sir.lowering.partition.StreamTransform
Direct Known Subclasses:
FissionTransform, FreqReplaceTransform, FusionTransform, IdempotentTransform, LinearReplaceTransform

public abstract class StreamTransform
extends Object

This represents a symbolic transformation on a stream graph.


Field Summary
protected  int id
          Identifier for this transform.
 
Constructor Summary
protected StreamTransform()
           
 
Method Summary
 void addPred(StreamTransform st)
          Adds a predecessor child transform to this.
 void addSucc(StreamTransform st)
          Adds a successor child transform to this.
protected abstract  SIRStream doMyTransform(SIRStream str)
           
 SIRStream doTransform(SIRStream str)
          Perform the transform on
 StreamTransform getPred(int i)
          Gets the predecessor child transform from this.
 int getPredSize()
          Returns the number of predecessors.
 StreamTransform getSucc(int i)
          Gets the successor child transform from this.
 int getSuccSize()
          Returns the number of successors.
protected  boolean isIdempotent()
          Returns whether or not the deep set of transforms starting at this performs any fusion or fission on the child streams.
 void printHierarchy()
          Prints hierarchy of stream transforms rooted at
 StreamTransform reduce()
          If this is an idempotent transform, then returns an identity transform with no predecessors or sucessors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected int id
Identifier for this transform.

Constructor Detail

StreamTransform

protected StreamTransform()
Method Detail

doMyTransform

protected abstract SIRStream doMyTransform(SIRStream str)

doTransform

public final SIRStream doTransform(SIRStream str)
Perform the transform on
str
and return new stream.


addPred

public void addPred(StreamTransform st)
Adds a predecessor child transform to this.


getPred

public StreamTransform getPred(int i)
Gets the predecessor child transform from this.


getPredSize

public int getPredSize()
Returns the number of predecessors.


addSucc

public void addSucc(StreamTransform st)
Adds a successor child transform to this.


getSucc

public StreamTransform getSucc(int i)
Gets the successor child transform from this.


getSuccSize

public int getSuccSize()
Returns the number of successors.


printHierarchy

public void printHierarchy()
Prints hierarchy of stream transforms rooted at
st
.


reduce

public final StreamTransform reduce()
If this is an idempotent transform, then returns an identity transform with no predecessors or sucessors. Otherwise returns this.


isIdempotent

protected boolean isIdempotent()
Returns whether or not the deep set of transforms starting at this performs any fusion or fission on the child streams. If it is just re-arranging synchronization, then it is idempotent (and can be replaced by an identity if desired.)