Tools.h++ Manual
104011 Tandem Computers Incorporated 21-45
21
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 prototype:
void yourApplyFunction( const char* ky,
RWstoredValue val,
void* x);