Tools.h++ Manual

11-2 104011 Tandem Computers Incorporated
11
functions to add a key-value pair, find a key, remove a key, operate on all key-
value pairs in order, return the number of entries in the tree, and determine if
a key is contained in the tree.
11.1 Construction
A
RWBTreeOnDisk
is always constructed from a
RWFileManager
. If the
RWFileManager
is managing a new file, then the
RWBTreeOnDisk
will
initialize it with an empty root node. For example, the following code
fragment constructs a
RWFileManager
for a new file called "
filename.dat
"
and then constructs a
RWBTreeOnDisk
from it:
#include <rw/disktree.h>
#include <rw/filemgr.h>
main()
{
RWFileManager fm("filename.dat");
// Initializes filename.dat with an empty root:
RWBTreeOnDisk bt(fm);
}