Tools.h++ Class Reference

Table Of Contents
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
RWBTreeOnDisk
Synopsis
Description
Persistence
Enumerations
Public Constructor
Public Member Functions
Synopsis
typedef long RWstoredValue ;
typedef int (*RWdiskTreeCompare)(const char*, const char*,
size_t);
#include <rw/disktree.h>
#include <rw/filemgr.h>
RWFileManager fm("filename.dat");
RWBTreeOnDisk bt(fm);
Description
Class RWBTreeOnDisk represents an ordered collection of associations of keys and values,
where the ordering is determined by comparing keys using an external function. The user can set
this function. Duplicate keys are not allowed. Given a key, the corresponding value can be found.
This class is specifically designed for managing a B-tree in a disk file. Keys, defined to be arrays
of chars, and values, defined by the typedef RWstoredValue, are stored and retrieved from a
B-tree. The values can represent offsets to locations in a file where objects are stored.
The key length is set by the constructor. By default, this value is 16 characters. By default, keys
are null-terminated. However, the tree can be used with embedded nulls, allowing multibyte and
binary data to be used as keys. To do so you must:
Specify TRUE for parameter ignoreNull in the constructor (see below);