at.dms.kjc.sir
Class SIRJoiner

java.lang.Object
  extended by at.dms.kjc.sir.SIROperator
      extended by at.dms.kjc.sir.SIRJoiner
All Implemented Interfaces:
DeepCloneable, Finalizable, Serializable

public class SIRJoiner
extends SIROperator

This represents a stream construct with a single output and multiple inputs.

See Also:
Serialized Form

Field Summary
 int oldSumWeights
           
static JMethodDeclaration WORK_FUNCTION
          This is a dummy work function that is used to represent the work of a joiner to the scheduling package.
 
Method Summary
 Object accept(AttributeStreamVisitor v)
          Accepts attribute visitor at this node.
static SIRJoiner create(SIRContainer parent, SIRJoinType type, int n)
          Constructs a joiner with given parent, type and n number of inputs.
static SIRJoiner create(SIRContainer parent, SIRJoinType type, JExpression[] weights)
           
static SIRJoiner createUniformRR(SIRContainer parent, JExpression weight)
          This is for creating a round robin with uniform weights across the stream.
static SIRJoiner createWeightedRR(SIRContainer parent, JExpression[] weights)
          Constructs a weighted round-robin joiner with the given parent and weights.
 Object deepClone()
          Returns a deep clone of this object.
protected  void deepCloneInto(SIRJoiner other)
          Clones all fields of this into
 boolean equals(SIRJoiner obj)
          Tests whether or not this has the same type and the same weights as obj.
 String getIdent()
          See doc in SIROperator.
 JExpression[] getInternalWeights()
          Returns JExpression weights of this.
 int getSumOfWeights()
          Returns the sum of all weights in this.
 SIRJoinType getType()
          Return type of this.
 int getWays()
          Return the number of inputs to this.
 int getWeight(int i)
          Return int weight at position i.
 JExpression getWeightNoChecking(int i)
           
 int[] getWeights()
          Return int weights array of this.
 void rescale(int extent)
          If this is a joiner that has equal weight per way, then rescale the weights to be of the given
 String toString()
           
 
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
 

Field Detail

WORK_FUNCTION

public static final JMethodDeclaration WORK_FUNCTION
This is a dummy work function that is used to represent the work of a joiner to the scheduling package. In the future this could be replaced with a custom, instance-wise work function.


oldSumWeights

public int oldSumWeights
Method Detail

create

public static SIRJoiner create(SIRContainer parent,
                               SIRJoinType type,
                               JExpression[] weights)

create

public static SIRJoiner create(SIRContainer parent,
                               SIRJoinType type,
                               int n)
Constructs a joiner with given parent, type and n number of inputs.


createWeightedRR

public static SIRJoiner createWeightedRR(SIRContainer parent,
                                         JExpression[] weights)
Constructs a weighted round-robin joiner with the given parent and weights. Here the number of weights must match the number of weights in the splitjoin.


createUniformRR

public static SIRJoiner createUniformRR(SIRContainer parent,
                                        JExpression weight)
This is for creating a round robin with uniform weights across the stream.


equals

public boolean equals(SIRJoiner obj)
Tests whether or not this has the same type and the same weights as obj. This can return true for splitters with different numbers of outputs if the type is not a weighted round robin.


accept

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

Specified by:
accept in class SIROperator

getType

public SIRJoinType getType()
Return type of this.


rescale

public void rescale(int extent)
If this is a joiner that has equal weight per way, then rescale the weights to be of the given


getWays

public int getWays()
Return the number of inputs to this.


getIdent

public String getIdent()
See doc in SIROperator.

Specified by:
getIdent in class SIROperator

toString

public String toString()
Overrides:
toString in class Object

getInternalWeights

public JExpression[] getInternalWeights()
Returns JExpression weights of this.


getSumOfWeights

public int getSumOfWeights()
Returns the sum of all weights in this.


getWeights

public int[] getWeights()
Return int weights array of this.


getWeight

public int getWeight(int i)
Return int weight at position i.


getWeightNoChecking

public JExpression getWeightNoChecking(int i)

deepClone

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

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

deepCloneInto

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