Construction
An RWBTreeOnDisk is always constructed from an 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 an RWFileManager for a new file called filename.dat and then constructs an RWBTreeOnDisk from it:
 
#include <rw/disktree.h>
#include <rw/filemgr.h>
int main(){
RWFileManager fm("filename.dat");
// Initializes filename.dat with an empty root:
RWBTreeOnDisk bt(fm);
}