PerChannel


A PerChannel is an array template which keeps track of things by channel and node. The array is subscripted by using the node and then the channel. Note that () is used instead of [] as a subscripting operator, since operator[] can only take one argument.

template <class T>
class PerChannel {
public:
  PerChannel();
  ~PerChannel();
  T& operator()(ioref, int);
  void iterate(void (*func)(ioref, int, T*, void*), void*);
};
PerChannel()
The constructor creates a PerChannel with slots for 16 channels for each of the output nodes in the system.
~PerChannel()
This destroys the PerChannel.
T& operator()(ioref n, int c)
This references the element for node n and channel c. If n or c does not exist, returns an arbitraru element.
void iterate(void (*func)(ioref n, int c, T* e, void* x), void* x)
This iterates over every node/channel combination, and calls func exactly once for each. func is given the node n, the channel c, the element e, and the additional pointer x which was passed by the caller.

Modified 26 October 1995 pepellet@mit.edu