Tools.h++ Class Reference

Table Of Contents
Public Constructor
RWBTreeOnDisk(RWFileManager& f,
unsigned nbuf = 10,
createMode omode = autoCreate,
unsigned keylen = 16,
RWBoolean ignoreNull = FALSE,
RWoffset start = RWNIL,
styleMode smode = V6Style,
unsigned halfOrder = 10,
unsigned minFill = 10);
Construct a B-tree on disk. The parameters are as follows:
f The file in which the B-tree is to be managed. This is the only required parameter.
nbuf The maximum number of nodes that can be cached in memory.
omode Determines whether to force the creation of a new tree or whether to attempt
to open an existing tree for update (the default).
keylen The length of a key in bytes. Ignored when opening an existing tree.
ignoreNull Controls whether to allow embedded nulls in keys. If FALSE (the
default), then keys end with a terminating null. If TRUE, then all keylen
bytes are significant. Ignored when opening an existing tree.
start Where to find the root node. If set to RWNIL (the default), then uses the value
returned by the RWFileManager's start() member function. Ignored when
creating a new tree.
smode Sets the type of B-tree to create, allowing backwards compatibility (see
above). The default specifies new V6.X style B-trees. Ignored when opening
an existing tree.
halfOrder One half the order of the B-tree (that is, one half the number of entries in
a node). Ignored when opening an existing tree.
minFill The minimum number of entries allowed in a node (must be less than or
equal to halfOrder). Ignored when opening an existing tree.
Public Member Functions
void
applyToKeyAndValue((*ap)(const char*,RWstoredValue), void* x);
Visits all items in the collection in order, from smallest to largest, calling the user-provided
function pointed to by ap with the key and value as arguments. This function should have
the prototype:
void yourApplyFunction(const char* ky,
RWstoredValue val,void* x);
The function yourApplyFunction may not change the key. The value x can be anything and