at.dms.kjc.backendSupport
Interface ComputeNodesI<CodeStoreType extends ComputeCodeStore<?>>

All Known Implementing Classes:
CellChip, ComputeNodes, RawChip, UniProcessors

public interface ComputeNodesI<CodeStoreType extends ComputeCodeStore<?>>

Define what a collection of ComputeNodes must implement. A Collection of ComputeNodes inherits from a collection of ProcElements Here, we want to mix in the fact that ComputeNodes are accessible by some index, possibly a subrange of the indices used to access ProcElements And we need to be able to get the size of a collection of ComputeNodes and an element from the collection. Would like to enforce that ComputeNodes have a constructor that takes an integer number of nodes as an argument, but this does not seem possible to specify with a Java interface.


Method Summary
 boolean canAllocateNewComputeNode()
          Does this implementation have dynamic creation of new nodes or are all nodes statically allocated.
<T extends ComputeNode<CodeStoreType>>
T
getNthComputeNode(int n)
          Get the nth element of the collection of compute nodes.
 boolean isValidComputeNodeNumber(int nodeNumber)
          Does a number correspond to a compute node?
 int newComputeNode()
          Create a new compute node if compute nodes are dynamically creatable.
 int size()
          Return the (current) number of compute nodes.
 

Method Detail

canAllocateNewComputeNode

boolean canAllocateNewComputeNode()
Does this implementation have dynamic creation of new nodes or are all nodes statically allocated.

Returns:
if false, newComputeNode() may throw any throwable.

newComputeNode

int newComputeNode()
Create a new compute node if compute nodes are dynamically creatable.

Returns:
unique number for the new compute node, usable with #getComputeNode(int).

isValidComputeNodeNumber

boolean isValidComputeNodeNumber(int nodeNumber)
Does a number correspond to a compute node?

Parameters:
nodeNumber - number to check
Returns:
true if a valid compute node number, false otherwise.

size

int size()
Return the (current) number of compute nodes.

Returns:
size of collection of compute nodes.

getNthComputeNode

<T extends ComputeNode<CodeStoreType>> T getNthComputeNode(int n)
Get the nth element of the collection of compute nodes.

Type Parameters:
T - the actual class returned.