home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
cprog
/
btree.zip
/
BTREE.DOC
< prev
next >
Wrap
Text File
|
1992-02-16
|
40KB
|
1,092 lines
L.A. Walker & Co. B+Tree in C++
Copr. 1991 Larry A. Walker
Larry A. Walker & Co.
736 Watford Ct.
Sterling Va. 22170
15 February 1992
Email:
Larry A. Walker, 71116,615
REFERENCE MANUAL
Introduction
Those of you who have fixed ideas about B+Trees and C++
you may wish to skip directly to the License section of this
document, and, deciding upon your agreement with the terms, get
on with using or experimenting with the B+Tree that accompanies
this text file. If you are interested in a few historical notes
and opinionated views, the introduction may offer some interest.
What is a B+Tree and why use C++?
Some years ago, while working at a small computer
consulting firm in Northern Virginia it fell on me to create a
full text retrieval system for the Department of the Army,
specific to a single full text database. I won't go into any
particulars about this system accept to say that it eventually
led to our own planned system for a text retrieval system.
Naturally, any full text system is entirely dependent on its
indexing and is only as good as its indexes are good, no matter
what other text searching algorithm it implements.
Therein is where my study of B+Trees began. I has soon
learned that a Binary Tree, which we had used in the Army system,
was insufficient for any but the most simple indexing
requirements. Only B-Trees and B+Trees seemed to have the power
necessary to support the requirements of a system needing
hundreds of thousands of keys. The full text system project died
when the company I worked for was bought by a larger company, but
the lessons I learned did not, and have proven to be especially
useful in other projects.
One of the most unexpected lessons was that when
purchasing a B-Tree from a vendor, the cost of the B-tree had
little to do with how it performed. After years of collecting
and testing, I had found one that was one of the most expensive
and commercially packaged didn't really work at all. One that
cost a mere $35 outperformed all the rest.
When much later I finally decided on a project for my
own company to produce as a saleable program, each product
defined naturally seemed to be based on a B-Tree. The B-Trees
which I had written were either the property of a company or
their client and didn't match my specifications anyway. B-Trees
can be purchased, but even the best did not seem to live up to
expectations of performance or requirements of licensing. So,
the first phase of product development was to produce a B-Tree.
Since the development effort is far behind schedule, and for
various other reasons, I have decided to release the index as its
own product.
Exactly what is a B-Tree? Definitions of B-Trees are
about as consistent as the definitions for structured
programming. That allows me, like anyone else to supply my own
definition which may also not be totally consistent with some
other "expert". For the purposes of this introduction I will
define a binary tree, B-Tree, and B+Tree in the text that
follows. Specific types or modifications of each are not
discussed as I view them as relatively unimportant in comparison
with a basic definition. I also depend on the reader to have at
least a limited general understanding of the B-Tree concept. The
B+Tree supplied with this text is, after all, a tool for
programmers who already recognize their need for an index and are
interested in incorporating it into their program.
A binary tree is a collection of information into
nodes, so that beginning at the "root node" if the information
item or key can not be found in the current that node, one can
branch to one of either two nodes. One node who's keys are all
of a lesser value than all of those items in the current node,
and one who's keys are all of a greater value than all of those
items in the current node. In this way one can proceed from the
root node in either of two directions, either encountering the
key sought, or reaching a "leaf node" which has no more branches.
It is customary that a key be attached to a value that can be
translated into an address pointing to the record which the key
indexes. The additional act of balancing a binary tree, keeping
as many keys in each direction from a node, is difficult but in
practical use necessary. There are algorithms in both general
use, and proprietary algorithms, which actually accomplish this
balancing act to a lesser or greater extent.
A B-Tree or Btree is similar to a binary tree in that
it is also a hierarchial collection of keys in nodes beginning
with a root node. Each key of a B-Tree has its own pointer,
pointing to another node containing the next order of keys of
higher value than the pointing key. The node itself then must
contain an extra key, pointing to a node containing the order of
keys of lesser value than the first key in the node. Keys
inserted from outside the tree are only inserted into leaf nodes.
If a leaf node is full at the time of an insert, the leaf is
split, and the center key inserted upward into a parent. If the
parent does not exist the key becomes the key of a new root node.
In this way the tree is balanced, in that the number of nodes
left and right are always equal.
A B+Tree is a special instance of the B-Tree in that
left and right sibling nodes are combined during underflow
yielding a more evenly distributed tree. Borrowing from parents
of the key positioned between the left and right siblings and
propagating this forward to the root node creates a condition
where the tree height is decreased as a root node is completely
depleted with the combined node borrowing takes its place. When
I refer to B-Trees I usually am referring to B+Trees since almost
all B-Trees are implemented as B+Trees.
The following statements are sometimes given in
reference to B-Trees and are incorrect.
The B-Tree is a special instance of the binary tree.
Not true. The indexing goal and the hierarchial ordering of
nodes is the only commonality between binary trees and B-Trees.
At first glance, this could seem like a lot. It's not. The same
commonality can be given about a lot of other things. Binary
trees and B-Trees are separate distinct indexing algorithms. I
wouldn't be surprised if some enterprising individual in the
future develops another wholly new indexing idea based on this
hierarchial concept, and is that is neither a B-Tree or a binary
tree.
B-Trees were designed to order fixed length keys. The
B-Tree definition has no bearing on the type or definition of the
key itself. The definition of the key including fixed or
variable length is implementation independent.
B+Trees require pointers to sibling nodes. B+Trees
should never have pointers to sibling nodes. Some early
implementations which may have used such pointers clearly
couldn't see the forest through the trees.
Keys in B-tree branch nodes only have pointers to other
nodes. Only keys in leaf nodes contain data. Incorrect. This
is one of those minor variations that prove to be uninteresting.
So why C++?
Well, some time ago one of AT&T's programmers visited
on us his ideas of what an object oriented language extension to
C should look like. I can't really attack him for what he has
done, because I don't believe he ever intended it to be what it
has become. What it looks like to me is more of a personal
invention to solve his own personal programming problems, but,
now it is here in its present form for all of us anyway. I think
that if he had thought it was being done with every programmer in
mind it would be somewhat different. But, for one reason or
another, the idea has been latched on to and - you had better
believe - has become a permanent part of our programming lives.
If you are a C programmer not using C++, you need to
become a C++ programmer. There really isn't all that much to it,
and C++ has been around long enough that there are now some ok
tutorials available. My advice is to forget Stroustrump's own
book. It isn't worth the price and I never pick it up.
Learn the entire C++ extension, but use only what you
need. For example, I don't mind if another programmer chooses to
use the C++ streams class that Stroustrump provided as a example
of class programming. I rarely ever do myself, because it
provides absolutely no increase in functionality or anything else
beyond the standard C library functions and therefore is simply
not needed. Sometimes I calloc() sometimes I "new", that depends
on what I am doing and how much control I need. I cannot say
that because C++ provides an alternative I dismiss everything
else any more than I dismissed assembly language when C came
along.
Some things are effective when done in C++ vs. C. A
B+Tree class has some advantages over a B-Tree in C. See the
example code to see how it works. In a higher level requirement
like windowing - especially with a GUI - C++ classes have
tremendous advantages over any C only implementation I've seen.
So, here we have it now, on my word, that a B+Tree is a
properly implemented as a class of C++. Never-the-less, I am
also making available a version of the same tree written in C,
mostly based on the fact that C++ is not available everywhere the
tree may be needed.
One of the more readable books which include
descriptions of how B-Trees are built is "Programs and Data
Structures in C" by Leendert Ammerall, by John Wiley & Sons Ltd.
Disclaimer:
The Larry A. Walker & Co. B+Tree software, utilities and manual
is provided "as is" and is without express or limited warranty of
any kind by either Larry A. Walker & Co. or anyone who has been
involved in the creation, production, or distribution of the
software, including, but not limited to the implied warranties of
merchantability and fitness for a particular purpose. The entire
risk as the quality and performance of the software and user
manual is with you. Should the software and user manual prove
defective, you assume the entire cost of all necessary servicing,
repair or correction. Use of the software constitutes agreement
to these provisions.
Licensing:
Non-registered users are granted a limited license to
use this product, and to copy the program for trial use by others
subject to the following limitations:
Any copy is distributed unmodified form, complete
with documentation.
No fee, charge or other consideration is
requested or accepted.
This product is not used in conjunction with and
distributed as a part of any other product.
If you want to license the source code for this product
for personal use, you can do so by sending $45 to:
Larry A. Walker & Co.
736 Watford Ct.
Sterling Va 22170
You will receive a disk which contains the latest
version of the product, manuals and source. For an additional
$10, you can receive a printed version of the manual. The manual
which accompanies the source contains the same information as
contained in this distribution, makefiles, and additional
information about other built in capabilities. You cannot
distribute or sell the source. A personal use license is
provided on a one person one license basis. I don't care how
many copies of the source you make, but it is for your personal
use only. If someone else wants it, tell them to order their own
copy.
If you intend to use the B+Tree in conjunction with a
product you are distributing, you will need to obtain a
developer's license. A developers license is $450. A developers
license includes a diskette containing all the latest source, one
printed copy of the manual, with any additional copies of the
manual requested at $10 per copy. A developers license allows
you to use the source, modify the source, compile the source for
inclusion with your programs, and distribute the compiled objects
with your programs. You cannot distribute the source code in
either its original or modified versions. Additionally, you will
receive regular updates of any new version of the source made
available for distribution to run on DOS for a period of two
years. You will receive a discount for purchase of any version
developed for other operating environments (i.e. it is likely I
will provide a version for Unix in both standard C and for AT&T
cfront, since this is where I use it myself. If you are
interested in it now, write me a letter.). A developers license
is provided as a one cpu one license basis. For multiple
developers copies purchased at the same time, the price is $50
less for each subsequent copy, but no less than $300.
If you have a product you are building and have
specifications you wish a custom btree designed for, contact me
for a cost estimate.
Product support for Individual Licenses is provided by
mail and email through my compuserve id. You will be provided
with my business number, but since my primary business is Unix
consulting, it will of course take precedence over any telephone
support which will be on an as available basis.
Please note that the prices in this document are
subject to change without notice. If the date of this document
is over 6 months old, ask for the current registration costs from
me by email through my compuserve id.
Runtime System:
The B-Tree runtime system consists of the Runtime Error
Handler class, Block File Handler class and the Btree class.
Btree class is a derived class of Block File Handler class. The
Block File Handler class is a derived class of the Runtime Error
Handler class. The Runtime Error Handler provides the necessary
reporting and report control mechanisms to control internal
errors. The block file handler provides the necessary block file
io for the B+Tree file structure.
C++ RunError Runtime Error Handler Class
System header:
#include "dbfiles.hpp"
Class header:
#include "BFH.hpp"
Class object file name (MSDOS)
runerr.obj
Public data:
NONE
Member functions:
RunError()
Purpose:
Class Constructor
Syntax:
RunError <object_name>;
Discussion:
The RunError constructor provides
initialization of the functionality. The display destination is
initially set to stdout and the switch for display of errors is
turned off.
Example:
RunError error_handler;
~RunError()
Purpose:
Class Destructor
set_display();
Purpose:
Turns the display of errors on and off, and
stores a destination for the display of errors.
Syntax:
<object_name>.set_display( int onoff,
FILE* <destination>);
Discussion:
The destination of errors can be changed at
any time and the display of general errors can be suppressed or
switched on at any point in the program. Note that this does not
control errors which are marked as fatal. The display of fatal
errors cannot be suppressed, and is always to stderr.
Return value:
NONE.
Example:
error_handler.set_display(ON,stderr);
set_log();
Purpose:
Turns the logging of errors on and off, and
stores a destination for the logging of errors.
Syntax:
<object_name>.set_log( int onoff,
char* <destination>,
int append);
Discussion:
Logging of errors can be turned ON or OFF,
with the calling program providing the destination file name and
the switch designation for appending or truncating any log
already at that name destination. If a log is already open at
the time a call to open an new log is made, the old log is
closed. The default for the append parameter is ON.
Return value:
NONE.
Example:
error_handler.set_display(ON,
"test.log",
ON );
proc_error();
Purpose:
Process errors being reported to the error
handler.
Syntax:
<object_name>.proc_error (int state,
int line,
char * file,
char * string,
int exit_code);
Discussion:
The function processes the errors being
logged into the error handler. Depending on the switches which
are in effect, the proc_error function may report the error to
the display and/or to a log file. If the level of the error is
fatal, the error will be reported to stderr and exit will be
called with the provided exit code.
The parameters consist of the state which is
at present either WARNING or FATAL. The lin of the error is
usually reported through the the preprossor __LINE__ mechanism.
The file is usually reported through the preprossor __FILE__
mechanism. The string is any statement you want attached to the
error. The exit code is required only if a fatal error is being
called.
A macro is included in bfh.hpp which is used
internally for the btree reporting procedures. You might want to
procuce macros similar to warning() and fatal() which require
only a message string and provide the remaining parameters.
Naturally your macro would require the addition of the instance
name of the error handler class.
Return value:
NONE
Example:
error_handler.proc_error (WARNING,
__LINE__,
__FILE__,
"Couldn't open file",
1);
C++ BFHClass Block File Handler Class
System header:
#include "dbfiles.hpp"
Class header:
#include "BFH.hpp"
Class object file name (MSDOS)
BFH.obj
Public data:
NONE
Member functions:
BFHClass();
Purpose:
Class constructor.
Syntax:
BFHClass <object_name>;
Discussion:
The BFHClass constructor provides
initialization functionality only. File open and close is
executed through separate functions in the class.
Return value:
NONE
Example:
BFHClass block_handler;
~BFHClass()
Purpose:
Class Distructor.
OpenBFH()
Purpose:
The OpenBFH function opens a file. If the
file already exists, it retrieves a structure of data that was
stored there by derived class objects and retreives its own data
structure containing the status information at the time of the
last file close. Given a creation key and the block size for a
new file, it will create a new disk file.
Syntax:
<object_name>.OpenBFH( char* <file name> ,
void* <info struct> ,
int <info size>,
int <create key>,
int <file block size>)
Discussion:
Return value:
Returns the defined value SUCCESS or aborts
the program on failure.
Example:
int status;
status = block_handler.OpenBFH(index_name,
(void *) &trunk,
sizeof(struct Trunk),
create,
TreeBlockSize );
int BFHClose();
Purpose:
Close a file previously opened by BFHOpen().
Syntax:
<object name>.BFHClose();
Discussion:
BFHClose closes the file and truncates all
empty blocks which fall at the end of the file. The file must be
manually closed.
Return value:
Returns the integer defines as SUCCESS.
Example:
int status;
status = block_handler.BFHClose();
int WriteBlock();
Purpose:
Write data block to the file.
Syntax:
<object name>.WriteBlock( char *<data block>,
long <file address>);
Discussion:
Function writes the block at the pointer to
the file at the address.
Return value:
Returns the defined values for SUCCESS or
FAILURE.
Example:
int status;
status = WriteBlock( ptr, blockaddr );
int ReadBlock();
Purpose:
Retreive a data block from the file.
Syntax:
<obect name>.ReadBlock(char *<data block>,
long<file address>);
Discussion:
Function retreives the block at the address
into the data area addressed by the pointer.
Return value:
Returns the defined values for SUCCESS or
FAILURE.
Example:
int status;
status = ReadBlock( ptr, blockaddr);
long NewBlock();
Purpose:
To acquire a new data block in the open file.
Syntax:
<object name>.NewBlock();
Discussion:
This function is used to acquire new space in
the data file. If a free block in the file exists, it will be
removed from the free list, and its address returned. If no free
blocks are available, a new block will be added to the file.
Return value:
Address of the new block, or -1L on failure.
Example:
long address;
address = NewBlock();
int FreeBlock(long);
Purpose:
To release a block.
Syntax:
<object name>.FreeBlock( long <file
address>);
Discussion:
Submitting the block address to FreeBlock
releases the block to the free list. During a close, if this
block is found to be at the end of the file, it can be releases
to the system.
Return value:
Returns the defined value for SUCCESS or
FAIL.
Example:
int status;
long block;
block = release_block; // block address being
// released
status = block_handler.FreeBlock( block );
long AddrBlock();
Purpose:
To calculate the address of a block providing
only the number of the block in the file.
Syntax:
<object name>.AddrBlock( long <block_number>
);
Discussion:
This function can provide the address given
the number of the block in the file. Useful for stepping through
the file sequentially.
Return value:
Returns the long value for the block in the
file, or a -1L on failure.
Example:
long address;
long block = 2L; // third block in file
address = block_handler.AddrBlock( block );
int FullBlock();
Purpose:
To determine if a designated block in the
file is empty or full
Syntax:
<object_name>.FullBlock( long );
Discussion:
This function takes the block address and
examines the block to determine if it is marked full or empty and
returns the information.
Return value:
Returns 1 for full, 0 for empty.
Example:
block_handler.FullBlock( next_block );
void get_info ();
Purpose:
Retreives a copy of the class information
structure bfh_data, and places a copy of the structure at the
address provided by the passed pointer
Syntax:
<object_name>.get_info(struct bfh_data *);
Discussion:
User access to the data
Return value:
None
Example:
struct bfh_info;
block_handler.get_info( & bfh_info );
int GetBFHSize();
Purpose:
Allow program access to block size in use.
Syntax:
<object_name>.GetBFHSize();
Discussion:
Allows program access to block size defined
when the block file was created.
Return value:
Integer value representing the block size.
Example:
block_size = block_handler.GetBFHSize();
OpenState();
Purpose:
To determine the state of the file handled by
the block file handler
Syntax:
OpenState();
Discussion:
Since the file is opened and can be closed
before the destructor is called, the open state of the file could
be in question. OpenState provides outside access to determine
of the class currently has a file open.
Return value:
Returns SUCCESS if the file is open and FAIL
if the file is closed.
Example:
int status;
status = block_handler.OpenState();
C++ BtreeClass B+Tree Class
System header:
#include "dbfiles.hpp"
Class header:
#include "Btree.hpp"
Class object file name (MSDOS)
btree.obj
Public data:
NONE
Parent Class:
BFHClass
Member functions:
Btree();
Purpose:
Constructor. Opens a block file and prepares
a btree for access.
Syntax:
Btree( char * name, int create, int
type_of_key, int duplicates_allowed, int
size_of_fixed_length_keys )
Discussion:
This constructor creates an instance of the
Btree class. The name passed is the name of the index file. The
standard application of this constructor is to provide only the
name of the index for already established trees, or all
parameters for new trees. If parameters beyond name are provided
and the tree exists, the create parameter must be passed as 0 or
the class will fail and abort the program. If the program is
uncertain about the existance of the tree, the program is
responsible to verify the existance of the index file before this
consctuctor can be called.
The default for create is 0. CREATE is
defined as 1.
The default for type of key is UNDEF_KEY.
Types of keys are VAR_LNG_KEY, LONG_KEY, DOUBLE_KEY, or
FIX_LNG_KEY.
The default for duplicates allowed is 0. To
allow duplicates set duplicates allowed to 1.
The default for size of a fixed length key is
0. When a fixed length key tree is being created, this value
must be set to the length of the key.
There is a different key compare routine made
available for each type of key definition. The source code
manual contains additional information for programming compare
routines for any type of key - for example database combination
keys.
The installed compare routines compare
(long)1 as less than (long)2, (double)1.1 as less than
(double)1.2, a fixed length key "abcdef" as less than a fixed
length key "bcdefg", a variable length key "abcdef" as less than
a variable length key "bcdefg", a variable length key "abcdef" as
greater than a variable length key "bcdef". It can be assumed
that long and double keys will compare according to rules
established by the compiler, fixed length keys will compare as
runs of binary data, and variable length keys will compare as
strings of characters with presidence placed on string length
over value.
Examples:
char * old_tree = "old.idx";
char * new_tree = "new.idx";
Btree tree(old_tree);
or
Btree tree(new_tree, CREATE, VAR_LNG_KEY, 1,
0 );
~Btree();
Purpose:
Class destructor.
int close();
Purpose:
Close the open btree.
Syntax:
Close();
Discussion:
This function allows the external program to
force a close of the open btree file descriptor before the end of
the scope where the destructor would automatically call the Close
routine. The use of this capability is to allow the program to
reduce open files.
Return value:
Returns the integer value defined as SUCCESS.
Installcompare();
Purpose:
Installs a new compare routine for use by the
btree.
Syntax:
int status;
status = InstallCompare ( int(*) (union Key*
key, struct KeyGroup * kg, int fixed_length ) );
Discussion:
The InstallCompare function installs the
address of a new comparision function into the btree. The
comparison function compares a first parameter key with a second
parameter key imbedded in a KeyGroup. Internally, that would
normally be a search Key and the current active KeyGroup.
Comparison of fix length keys requires a length parameter. The
extended manual accompanying the source code contains additional
information for writing an installable compare routine.
Return Value:
Returns 0 if keys are equal, 1 if the key is
greater than the imbedded key, and -1 if the key is less than the
imbedded key. Note that the standard library string functions do
not meet the requirements of this specification.
operator +=()
Purpose:
Insert a key into the tree.
Syntax:
int status;
status = tree+=( struct KeyGroup * new_key);
Discussion:
The overloaded operator += inserts a new
KeyGroup into the tree.
Return Value:
Returns the defined value for SUCCESS or
FAIL.
operator -=();
Purpose:
Delete a key from the tree.
Syntax:
int status;
status = tree-=(union Key * remove_key);
Discussion:
The overloaded operator -= deletes a KeyGroup
associated with the passed Key *. If there are multiple keys
associated with the passed Key *, then the first encountered is
deleted from the tree.
Return Value:
Returns the defined value for SUCCESS or
FAIL.
Locate();
Purpose:
Locate a key in the tree.
Syntax:
int status;
status = tree.Locate(union Key * locate_key);
Discussion:
This function locates the first exact match
in the tree to the passed Key *. If no match if found the
function returns FAIL.
Return value:
Returns the defined value for SUCCESS or
FAIL.
operator++();
Purpose:
Increment the current position in the tree to
the next sequential key.
Syntax:
struct KeyGroup * kgp;
kgp = tree++();
Discussion:
This overload operator increments to the next
key in the tree and returns a pointer to a copy of the key.
Return value:
struct KeyGroup * to copy of the next key, or
NULL on failure.
operator--();
Purpose:
Decrement the current position in te tree to
the previous sequential key.
Syntax:
struct KeyGroup * kgp;
kgp = tree--();
Discussion:
This operload operator decrements to the next
key in the tree and returns a pointer to a copy of the key.
Return value:
struct KeyGroup * to copy of the previous
key, or NULL on failure.
First();
Purpose:
Reinitialize the current pointer into the
tree to point to the first key in the tree.
Syntax:
struct KeyGroup * kgp;
kgp = First();
Discussion:
Sets active key to the first key in the tree.
Return value:
struct KeyGroup * to copy of the first key in
the tree.
Last()();
Purpose:
Reinitialize the current pointer into the
tree to point to the last key in the tree.
Syntax:
sruct KeyGroup * kgp;
kgp = Last();
Discussion:
Sets active key to the last key in the tree.
Return value:
struct KeyGroup * to copy of the last key in
the tree.
CurrentKey();
Purpose:
Retreive the current key.
Syntax:
struct KeyGroup * kgp;
kgp = tree.CurrentKey();
Discussion:
Called at any time to retreive a pointer to a
copy of the current key.
Return value:
struct KeyGroup * to copy of the current key
in the tree.
ReportState();
Purpose:
Return state information from the tree.
Syntax:
long value;
int request;
value = tree.ReportState(request);
Discussion:
Certain items of information are required
from the tree. These items can be retreived from this function
by passing specified requests. The values are returned as longs
even where integer values might be expected. The following are
valid requests.
SEARCH_LEVELS
DUPLICATES
TYPE_OF_KEY
KEY_LENGTH
NUMBER_OF_KEYS
LAST_ACCESS
ACTIVE_LEVEL
Other functionality:
Source code documentation discusses other
public functions which allow debugging, header displays, key
displays, node dumps, and checks of the current hierarchy, and
access to address information relative to the the current node.
Appendix A
Order Blank and Registration:
Register to:
Name: ______________________________________________
Address: ______________________________________________
______________________________________________
City: _____________________State_________Zip________
Telephone: _______/________-____________
Ship to: (if different than above)
Name: ______________________________________________
Address: ______________________________________________
______________________________________________
City: _____________________State_________Zip________
Telephone: _______/________-____________
Remit to: Larry A. Walker & Co.
736 Watford Ct.
Sterling Va 22170
============================================================
Date: PO #:
============================================================
Quantity Description Unit Extended
------------------------------------------------------------
| Individual License | $45.00 | $
| Development License 1st | 450.00 |
| Development License 2nd | 400.00 |
| Development License 3rd | 350.00 |
| Development License 4th + | 300.00 |
| Printed Manual | 10.00 |
------------------------------------------------------------
Subtotal: $
(VA Residents please add 4.5% sales tax) Tax: $
Total: $
Appendix B
Files:
Btree.man
The B+Tree manual.
Btree.hpp
Header file which defines the B+Tree class.
dbfiles.hpp
Common header file.
BFH.hpp
Header file which defines the block file handler class.
runerr.hpp
Header file which defines the runtime error handler
class.
Btree.obj
Borland Compiled B+Tree class object.
BFH.obj
Borland Compiled block file handler class object.
runerr.obj
Borland Compiled runtime error handler class object.
Btree1.obj
Zortech Compiled B+Tree class object.
BFH1.obj
Zortech Compiled block file handler class object.
runerr1.obj
Zortech Compiled runtime error handler class object.
exercise.cpp
Example program which can be used to manipulate a
B+Tree. Almost all the functionality available in the
B+Tree is exhibited in the exercise program example.
Example Compile Lines:
Borland:
tcc exercise.cpp btree.obj bfh.obj runerr.obj
Zortech:
ztc exercise.cpp btree1.obj bfh1.obj runerr1.obj -DZORTECH