home *** CD-ROM | disk | FTP | other *** search
- /*
- IXBTreeCursor.h
- Copyright 1991, NeXT, Inc.
- */
-
- #import "IXBTree.h"
-
- #ifndef RELEASE_2
- @interface IXBTreeCursor : Object <IXCursorPositioning>
- #else RELEASE_2
- @interface IXBTreeCursor : Object
- #endif RELEASE_2
- {
- struct BTree *btree;
- void *keyBuffer;
- unsigned keyLength;
- unsigned bufferSize;
- unsigned storeVersion;
- unsigned keyLimit;
- unsigned traceHint;
- unsigned cursorVersion;
- unsigned cursorDepth;
- NXZone *cursorZ(
- struct BTreeTraceRecord *cursorTrace;
- struct {
- unsigned isSpanning:1;
- unsigned rightRotation:1;
- unsigned leftRotation:1;
- unsigned traceNeeded:1;
- unsigned traceOpened:1;
- unsigned zeroPosition:1;
- unsigned lastPosition:1;
- } cursorStatus;
- }
-
- - (IXBTree *)btree;
- - initWithBTree:(IXBTree *)aBTree;
-
- - (unsigned)readRange:(void **)value // reads part of the value
- ofLength:(unsigned)length atOffset:(unsigned)offset;
- - (unsigned)readValue:(void **)value; // reads the value and returns length
-
- - removeValue; // removes the key/value pair from the B* tree
-
- - (BOOL)writeValue:(const void *)value // replaces if key exists, else inserts
- andLength:(unsigned)length;
- - writeRange:(const void *)value
- ofLength:(unsigned)length atOffset:(unsigned)offset;
-
- - (unsigned)openRange:(void **)value // returns a pointer to write mapped page
- ofLength:(unsigned)length atOffset:(unsigned)offset
- forWriting:(BOOL)writing;
-
- - (BOOL)getKey:(void **)key // returns hint for cursor position
- andLength:(unsigned *)length withHint:(unsigned *)hint;
- - (BOOL)setKey:(const void *)key // sets key with hint returned by preceding
- andLength:(unsigned)length withHint:(unsigned)hint;
-
- #ifdef RELEASE_2
-
- // @protocol IXCursorPositioning
-
- - (BOOL)setFirst; // positions cursor at first key in key space
- - (BOOL)setLast; // positions cursor at last key in key space
- - (BOOL)setNext; // positions cursor at next key in key space
- - (BOOL)setPrevious; // position cursor at previous key in key space
-
- - (BOOL)getKey:(const void **)key // returns value of key at cursor
- andLength:(unsigned *)length;
- - (BOOL)setKey:(const void *)key // positions cursor at supplied key
- andLength:(unsigned)length;
-
- - (BOOL)isMatch; // true if cursor matched a key on last operation
-
- #endif RELEASE_2
-
- @end
-
-