Tools.h++ Manual

21-44 104011 Tandem Computers Incorporated
21
createMode
to set whether to use an existing tree (creating one if one doesn’t
exist) or to force the creation of a new tree. The location of the resultant root
node can be retrieved using member function
rootLocation()
.
More than one B-Tree can exist in a disk file. Each must have its own separate
root node. This can be done by constructing more than one
RWBTreeOnDisk
,
each with
createMode
set to
create
.
The order of the B-Tree can also be set in the constructor. Larger values will
result in shallower trees, but less efficient use of disk space. The minimum
number of entries in a node can also be set. Smaller values will result in less
time spent balancing the tree, but less efficient use of disk space.
Enumeration
enum styleMode {V6Style, V5Style};
This enumeration is used by the constructor to allow backwards compatibility
with older V5.X style trees, which supported only 16 byte key lengths. It is
used only when creating a new tree. If opening a tree for update, its type is
determined automatically at runtime.
V6Style
Initialize a new tree using V6.X style trees. This is
the default.
V5Style
Initialize a new tree using V5.X style trees. In this
case, the key length is fixed at 16 bytes.
enum createMode {autoCreate, create};
This enumeration is used by the constructor to determine whether to force the
creation of a new tree.
autoCreate
Look in the location given by the constructor
argument start for the root node. If valid, use it.
Otherwise, allocate a new tree. This is the default.
create
Forces the creation of a new tree. The argument
start
is ignored.
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);