This is Splitter.h in view mode; [Download] [Up]
//
// Splitter
//
// Splits off set of bits from input node.
//
// A Splitter is a subclass of Node because it behaves just
// like a node except that it gets cycled (to update its value).
//
// When designing with Splitters, one should treat them like a Node
// for connections (i.e. they can be passed in as Node parameters,
// but ONLY as inputs to a device), and like a device for simulation
// (i.e. they need to be cycled before any devices which use their
// values).
//
// A splitter uses its Node data instance variable to hold the bits
// it splits from its IN Node. Of course, in most cases, this means
// that not all of that space will be used (i.e. usually Splitters
// are NOT used to replicate all the bits of the source--except the
// case where you might want to reverse the bits of another Node).
//
#import "Node.h"
@interface Splitter : Node
{
//
// Internal State:
//
int inbits; // Number of "input" bits;
int start; // Starting input bit;
int stop; // Stopping input bit;
//
// External Interface:
//
Node *IN;
}
- initNumBits:(int)nbits // Number of input bits.
in:innode // Node from which to split.
start:(int)startbit // Bit 0 in split out.
stop:(int)stopbit; // Bit n in split out.
- cycle;
@end
//
// End of file.
//These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.