#include <BTree.h++>

Classes | |
| struct | _Datum |
| struct | _Node |
| class | Iterator |
| A BTree iterator. More... | |
Public Member Functions | |
| BTree (size_t capacity) | |
| Construct a new BTree with the given maximum capacity. | |
| virtual | ~BTree () |
| Destructor. | |
| bool | put (const K key, const V data) |
| Put a new item in the tree. | |
| bool | remove (const K key) |
| Remove an item from the tree. | |
| V | get (const K key) |
| Get an item from the tree. | |
| bool | contains (const K key) const |
| Determine if an item with the given key exists in the tree. | |
| void | dump (std::ostream &stream) const |
| Dump a representation of the tree (keys only) to a stream. | |
| void | getKeys (std::list< K > &keys) const |
| Get a list of all of the keys in the tree, in access-order. | |
| void | getValues (std::list< V > &values) const |
| Get a list of all of the values in the tree, in access-order. | |
| void | clear () |
| Remove all items from the tree. | |
| size_t | getCapacity () const throw () |
| Get the tree capacity. | |
Protected Member Functions | |
| virtual void | itemDropped (V data) const |
| Called whenever an item is removed from the BTree to make room for another. | |
The BTree has a configurable order and maximum capacity. The items are ordered internally by last access time. When the maximum capacity has been reached, and a new item is added to the tree, the least-recently accessed item is automatically removed.
| BTree | ( | size_t | capacity | ) | [inline] |
Construct a new BTree with the given maximum capacity.
| capacity | The maximum number of items the tree will hold. |
| ~BTree | ( | ) | [inline, virtual] |
Destructor.
| void clear | ( | ) | [inline] |
Remove all items from the tree.
| bool contains | ( | const K | key | ) | const [inline] |
Determine if an item with the given key exists in the tree.
| key | The key. |
| void dump | ( | std::ostream & | stream | ) | const [inline] |
Dump a representation of the tree (keys only) to a stream.
| stream | The stream to write to. |
| V get | ( | const K | key | ) | [inline] |
Get an item from the tree.
| key | The key. |
| size_t getCapacity | ( | ) | const throw () [inline] |
Get the tree capacity.
| void getKeys | ( | std::list< K > & | keys | ) | const [inline] |
Get a list of all of the keys in the tree, in access-order.
| keys | The list in which to store the keys. |
| void getValues | ( | std::list< V > & | values | ) | const [inline] |
Get a list of all of the values in the tree, in access-order.
| values | The list in which to store the values. |
| void itemDropped | ( | V | data | ) | const [inline, protected, virtual] |
Called whenever an item is removed from the BTree to make room for another.
| data | The value that was removed. |
| bool put | ( | const K | key, | |
| const V | data | |||
| ) | [inline] |
Put a new item in the tree.
| key | The key. | |
| data | The data to associate with the key. |
| bool remove | ( | const K | key | ) | [inline] |
Remove an item from the tree.
| key | The key. |
1.5.9