Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

RWBTree


RWBTree-->RWCollection-->RWCollectable

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <rw/btree.h>
RWBTree a;

Description

Class RWBTree represents a group of ordered elements, not accessible by an external key. Duplicates are not allowed. An object stored by class RWBTree must inherit abstract base class RWCollectable -- the elements are ordered internally according to the value returned by virtual function compareTo() (see class RWCollectable).

This class has certain advantages over class RWBinaryTree. First, the B-tree is automatically balanced. (With class RWBinaryTree, you must call member function balance() explicitly to balance the tree.) Nodes are never allowed to have less than a certain number of items (called the order). The default order is 50, but may be changed by resetting the value of the static constant "order" in the header file <rw/btree.h> and recompiling. Larger values will result in shallower trees, but less efficient use of memory.

Because many keys are held in a single node, class RWBTree also tends to fragment memory less.

Persistence

Polymorphic

Public Constructors

RWBTree();
RWBTree(const RWBTree& btr);

Public Destructor

virtual 
~RWBTree();

Public Member Operators

void
operator=(const RWBTree& btr);
RWBoolean
operator<=(const RWBTree& btr) const;
RWBoolean
operator==(const RWBTree& btr) const;

Public Member Functions

virtual void
apply(RWapplyCollectable ap, void*);
virtual RWspace
binaryStoreSize() const;
virtual void
clear();
virtual void
clearAndDestroy();
virtual int
compareTo(const RWCollectable* a) const;
virtual RWBoolean
contains(const RWCollectable* target) const;
virtual size_t
entries() const;
virtual RWCollectable*
find(const RWCollectable* target) const;
virtual unsigned
hash() const;
unsigned
height() const;
virtual RWCollectable*
insert(RWCollectable* c);
virtual RWClassID
isA() const;
virtual RWBoolean
isEmpty() const;
virtual RWBoolean
isEqual(const RWCollectable* a) const;
virtual size_t
occurrencesOf(const RWCollectable* target) const;
virtual RWCollectable*
remove(const RWCollectable* target);
virtual void
removeAndDestroy(const RWCollectable* target);
virtual void
restoreGuts(RWvistream&);
virtual void
restoreGuts(RWFile&);
virtual void
saveGuts(RWvostream&) const;
virtual void
saveGuts(RWFile&) const;
RWStringID
stringID();


Previous fileTop of documentContentsIndexNext file
©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.