at.dms.kjc.sir
Class SIRPipeline

java.lang.Object
  extended by at.dms.kjc.sir.SIROperator
      extended by at.dms.kjc.sir.SIRStream
          extended by at.dms.kjc.sir.SIRContainer
              extended by at.dms.kjc.sir.SIRPipeline
All Implemented Interfaces:
DeepCloneable, Finalizable, SIRCodeUnit, Serializable, Cloneable

public class SIRPipeline
extends SIRContainer
implements Cloneable

This represents a pipeline of stream structures, as would be declared with a Stream construct in StreaMIT.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class at.dms.kjc.sir.SIRStream
fields, ident, init, methods, work
 
Constructor Summary
SIRPipeline(SIRContainer parent, String ident)
          Construct a new SIRPipeline with empty fields and methods.
SIRPipeline(SIRContainer parent, String ident, JFieldDeclaration[] fields, JMethodDeclaration[] methods)
          Construct a new SIRPipeline with the given fields and methods.
SIRPipeline(String ident)
          Construct a new SIRPipeline with no parent and empty fields and methods.
 
Method Summary
 Object accept(AttributeStreamVisitor v)
          Accepts attribute visitor at this node.
 Object deepClone()
          Returns a deep clone of this object.
protected  void deepCloneInto(SIRPipeline other)
          Clones all fields of this into
 List<Object> getChildrenBetween(SIROperator first, SIROperator last)
          Returns a list of the children between and , inclusive.
 CType getInputType()
          Returns the input type of this.
 CType getOutputType()
          Returns the output type of this.
 int getPopForSchedule(HashMap[] counts)
          Same as getPushForSchedule, but with pop instead of push.
 int getPushForSchedule(HashMap[] counts)
          Returns the number of items pushed out of this stream in one execution of the steady-state, given the steady-state execution counts specified by (as in SIRScheduler.) Requires that contains a firing for each *filter* that contained in the hierarchy of this (does not depend on splitters / joiners.) The intent of this method is that can be calculated once for a stream graph, then the splitjoins & pipelines of the graph can be refactored, and one can still call this to get the push count of new constructs without re-invoking the scheduler.
 List<SIRStream> getSequentialStreams()
          Returns a list of the children of this Use instead of getChildren if want to get List rather than List
 LIRStreamType getStreamType()
          Returns the type of this stream.
 List<SIROperator[]> getTapePairs()
          Returns a list of tuples (two-element arrays) of SIROperators, representing a tape from the first element of each tuple to the second.
 void replace(SIRStream oldStr, SIRStream newStr)
          See documentation in SIRContainer.
 void replace(SIRStream start, SIRStream end, SIRStream newStream)
          Replaces the sequence of ...
 void setChildren(LinkedList<Object> children)
          Sets children of this to be all the children of , and set all the parent fields in to be this.
 String toString()
           
 
Methods inherited from class at.dms.kjc.sir.SIRContainer
add, add, add, add, clear, contains, deepCloneInto, destroy, get, getChildren, getParams, getParams, getSuccessor, indexOf, makeWrapper, myChildren, myParams, reclaimChildren, remove, remove, set, setParams, size
 
Methods inherited from class at.dms.kjc.sir.SIRStream
addField, addField, addFields, addFields, addMethod, addMethods, addReplacementMethod, deepCloneInto, getFields, getIdent, getInit, getMethods, getStreamWithNumber, getTypeNameInC, getWork, hasMethod, insideFeedbackLoop, makeEmptyInit, makeEmptyInitWork, makeEmptyWork, needsInit, needsWork, setFields, setIdent, setInit, setInitWithoutReplacement, setMethods, setWork
 
Methods inherited from class at.dms.kjc.sir.SIROperator
assertMutable, deepCloneInto, getAncestors, getName, getNumber, getParent, getParents, getParentStructureAccess, getRelativeName, getShortIdent, hashCode, readResolve, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SIRPipeline

public SIRPipeline(SIRContainer parent,
                   String ident,
                   JFieldDeclaration[] fields,
                   JMethodDeclaration[] methods)
Construct a new SIRPipeline with the given fields and methods.


SIRPipeline

public SIRPipeline(SIRContainer parent,
                   String ident)
Construct a new SIRPipeline with empty fields and methods.


SIRPipeline

public SIRPipeline(String ident)
Construct a new SIRPipeline with no parent and empty fields and methods.

Method Detail

getOutputType

public CType getOutputType()
Returns the output type of this.

Specified by:
getOutputType in class SIRStream

getInputType

public CType getInputType()
Returns the input type of this.

Specified by:
getInputType in class SIRStream

getStreamType

public LIRStreamType getStreamType()
Returns the type of this stream.

Specified by:
getStreamType in class SIRStream

getPushForSchedule

public int getPushForSchedule(HashMap[] counts)
Description copied from class: SIRStream
Returns the number of items pushed out of this stream in one execution of the steady-state, given the steady-state execution counts specified by (as in SIRScheduler.) Requires that contains a firing for each *filter* that contained in the hierarchy of this (does not depend on splitters / joiners.) The intent of this method is that can be calculated once for a stream graph, then the splitjoins & pipelines of the graph can be refactored, and one can still call this to get the push count of new constructs without re-invoking the scheduler.

Specified by:
getPushForSchedule in class SIRStream

getPopForSchedule

public int getPopForSchedule(HashMap[] counts)
Description copied from class: SIRStream
Same as getPushForSchedule, but with pop instead of push.

Specified by:
getPopForSchedule in class SIRStream

getSequentialStreams

public List<SIRStream> getSequentialStreams()
Returns a list of the children of this Use instead of getChildren if want to get List rather than List


getChildrenBetween

public List<Object> getChildrenBetween(SIROperator first,
                                       SIROperator last)
Returns a list of the children between and , inclusive. Assumes that and are both contained in this, and that comes before .


setChildren

public void setChildren(LinkedList<Object> children)
Sets children of this to be all the children of , and set all the parent fields in to be this.


getTapePairs

public List<SIROperator[]> getTapePairs()
Returns a list of tuples (two-element arrays) of SIROperators, representing a tape from the first element of each tuple to the second.

Specified by:
getTapePairs in class SIRContainer

replace

public void replace(SIRStream oldStr,
                    SIRStream newStr)
See documentation in SIRContainer.

Specified by:
replace in class SIRContainer

replace

public void replace(SIRStream start,
                    SIRStream end,
                    SIRStream newStream)
Replaces the sequence of ... within this pipeline with the single stream . Requires that and are both in this, with coming before .


accept

public Object accept(AttributeStreamVisitor v)
Accepts attribute visitor at this node.

Specified by:
accept in class SIROperator

toString

public String toString()
Overrides:
toString in class SIRStream

deepClone

public Object deepClone()
Returns a deep clone of this object.

Specified by:
deepClone in interface DeepCloneable
Overrides:
deepClone in class SIRContainer

deepCloneInto

protected void deepCloneInto(SIRPipeline other)
Clones all fields of this into
other