package modules.broadcast;

import simulator.*;

// a convergecast is used to poll the whole network about, for example,
// its diameter, or the number of nodes in it.
// For a convergecast, a few pieces of information are needed: what
// it does at leaf nodes, what it does at branch nodes, and what it
// does at the root node
public interface ConvergeCast {
  public Object getLeafValue(PortedProcessor pp); // tree ack value
  public Object deliverLeaf(PortedProcessor pp); // user return value

  public void putBranchValue(PortedProcessor pp, Object input);// integrate ack
  public Object getBranchValue(PortedProcessor pp); // tree ack value
  public Object deliverBranch(PortedProcessor pp); // user return value

  public void putRootValue(PortedProcessor pp, Object input); // integrate ack
  public Object deliverRoot(PortedProcessor pp); // user return value

  public Object fail(PortedProcessor pp); // user notification of failure
  
  public ConvergeCast getChild();
}
