Check out the new USENIX Web site. next up previous contents
Next: Type-specific Reduction Up: Reduction Previous: The Reduction Class

Implementation Details

The class FanInNode defines the fan-in node properties. It defines a type fanin_size_type. For a fan-in size of k this is a C++ data type whose size (as given by the C++ sizeof operator) is k bytes. For instance, the code defines fanin_size_type to be a short to specify a fan-in size of 2 (given by the field fanin_size), since short is 2 bytes in many implementations gif This class also defines a boolean query member function, which when given the index i says whether or not it has an ith child (note that any node in the fan-in tree has at most children).

The class FanOutNode defines the fan-out node properties. It defines a type fanout_size_type. For a fan-out size of k this is a C++ data type whose size (as given by the C++ sizeof operator) is k bytes. For instance, the code defines fanout_size_type to be an int to specify a fan-out size of 4 (given by the field fanin_size), since int is 4 bytes in many implementations. This class also defines a boolean query member function, which when given the index i says whether or not it has an ith child (note that any node in the fan-out tree has at most children).

The four functions fanin_parent, fanout_parent, fanin_child, and fanout_child are static because these functions depend only on the fanin_size and fanout_size quantities which are constants and the arguments passed to these functions. This permits the C++ compiler to perform inlining optimizations.



Sundaresan Neelakantan
Thu May 15 16:11:49 PDT 1997