#include <DS_BPlusTree.h>
Classes | |
struct | ReturnAction |
Public Member Functions | |
BPlusTree () | |
~BPlusTree () | |
void | SetPoolPageSize (int size) |
bool | Get (const KeyType key, DataType &out) const |
bool | Delete (const KeyType key) |
bool | Delete (const KeyType key, DataType &out) |
bool | Insert (const KeyType key, const DataType &data) |
void | Clear (void) |
unsigned | Size (void) const |
bool | IsEmpty (void) const |
Page< KeyType, DataType, order > * | GetListHead (void) const |
DataType | GetDataHead (void) const |
void | PrintLeaves (void) |
void | ForEachLeaf (void(*func)(Page< KeyType, DataType, order > *leaf, int index)) |
void | ForEachData (void(*func)(DataType input, int index)) |
void | PrintGraph (void) |
Protected Member Functions | |
void | ValidateTreeRecursive (Page< KeyType, DataType, order > *cur) |
void | DeleteFromPageAtIndex (const int index, Page< KeyType, DataType, order > *cur) |
void | FreePages (void) |
bool | GetIndexOf (const KeyType key, Page< KeyType, DataType, order > *page, int *out) const |
void | ShiftKeysLeft (Page< KeyType, DataType, order > *cur) |
bool | CanRotateLeft (Page< KeyType, DataType, order > *cur, int childIndex) |
bool | CanRotateRight (Page< KeyType, DataType, order > *cur, int childIndex) |
void | RotateRight (Page< KeyType, DataType, order > *cur, int childIndex, ReturnAction *returnAction) |
void | RotateLeft (Page< KeyType, DataType, order > *cur, int childIndex, ReturnAction *returnAction) |
Page< KeyType, DataType, order > * | InsertIntoNode (const KeyType key, const DataType &childData, int insertionIndex, Page< KeyType, DataType, order > *nodeData, Page< KeyType, DataType, order > *cur, ReturnAction *returnAction) |
Page< KeyType, DataType, order > * | InsertBranchDown (const KeyType key, const DataType &data, Page< KeyType, DataType, order > *cur, ReturnAction *returnAction, bool *success) |
Page< KeyType, DataType, order > * | GetLeafFromKey (const KeyType key) const |
bool | FindDeleteRebalance (const KeyType key, Page< KeyType, DataType, order > *cur, bool *underflow, KeyType rightRootKey, ReturnAction *returnAction, DataType &out) |
bool | FixUnderflow (int branchIndex, Page< KeyType, DataType, order > *cur, KeyType rightRootKey, ReturnAction *returnAction) |
void | ShiftNodeLeft (Page< KeyType, DataType, order > *cur) |
void | ShiftNodeRight (Page< KeyType, DataType, order > *cur) |
Static Protected Member Functions | |
static void | PrintLeaf (Page< KeyType, DataType, order > *leaf, int index) |
Protected Attributes | |
MemoryPool< Page< KeyType, DataType, order > > | pagePool |
Page< KeyType, DataType, order > * | root |
Page< KeyType, DataType, order > * | leftmostLeaf |
A BPlus tree Written with efficiency and speed in mind.
Definition at line 42 of file DS_BPlusTree.h.
DataStructures::BPlusTree< KeyType, DataType, order >::BPlusTree | ( | ) |
Definition at line 98 of file DS_BPlusTree.h.
DataStructures::BPlusTree< KeyType, DataType, order >::~BPlusTree | ( | ) |
Definition at line 105 of file DS_BPlusTree.h.
bool DataStructures::BPlusTree< KeyType, DataType, order >::CanRotateLeft | ( | Page< KeyType, DataType, order > * | cur, | |
int | childIndex | |||
) | [protected] |
Definition at line 627 of file DS_BPlusTree.h.
bool DataStructures::BPlusTree< KeyType, DataType, order >::CanRotateRight | ( | Page< KeyType, DataType, order > * | cur, | |
int | childIndex | |||
) | [protected] |
Definition at line 652 of file DS_BPlusTree.h.
void DataStructures::BPlusTree< KeyType, DataType, order >::Clear | ( | void | ) |
bool DataStructures::BPlusTree< KeyType, DataType, order >::Delete | ( | const KeyType | key, | |
DataType & | out | |||
) |
Definition at line 155 of file DS_BPlusTree.h.
bool DataStructures::BPlusTree< KeyType, DataType, order >::Delete | ( | const KeyType | key | ) |
void DataStructures::BPlusTree< KeyType, DataType, order >::DeleteFromPageAtIndex | ( | const int | index, | |
Page< KeyType, DataType, order > * | cur | |||
) | [protected] |
bool DataStructures::BPlusTree< KeyType, DataType, order >::FindDeleteRebalance | ( | const KeyType | key, | |
Page< KeyType, DataType, order > * | cur, | |||
bool * | underflow, | |||
KeyType | rightRootKey, | |||
ReturnAction * | returnAction, | |||
DataType & | out | |||
) | [protected] |
Definition at line 195 of file DS_BPlusTree.h.
bool DataStructures::BPlusTree< KeyType, DataType, order >::FixUnderflow | ( | int | branchIndex, | |
Page< KeyType, DataType, order > * | cur, | |||
KeyType | rightRootKey, | |||
ReturnAction * | returnAction | |||
) | [protected] |
Definition at line 270 of file DS_BPlusTree.h.
void DataStructures::BPlusTree< KeyType, DataType, order >::ForEachData | ( | void(*)(DataType input, int index) | func | ) |
void DataStructures::BPlusTree< KeyType, DataType, order >::ForEachLeaf | ( | void(*)(Page< KeyType, DataType, order > *leaf, int index) | func | ) |
void DataStructures::BPlusTree< KeyType, DataType, order >::FreePages | ( | void | ) | [protected] |
bool DataStructures::BPlusTree< KeyType, DataType, order >::Get | ( | const KeyType | key, | |
DataType & | out | |||
) | const |
DataType DataStructures::BPlusTree< KeyType, DataType, order >::GetDataHead | ( | void | ) | const |
Definition at line 940 of file DS_BPlusTree.h.
bool DataStructures::BPlusTree< KeyType, DataType, order >::GetIndexOf | ( | const KeyType | key, | |
Page< KeyType, DataType, order > * | page, | |||
int * | out | |||
) | const [protected] |
Definition at line 883 of file DS_BPlusTree.h.
Page< KeyType, DataType, order > * DataStructures::BPlusTree< KeyType, DataType, order >::GetLeafFromKey | ( | const KeyType | key | ) | const [protected] |
Definition at line 677 of file DS_BPlusTree.h.
Page< KeyType, DataType, order > * DataStructures::BPlusTree< KeyType, DataType, order >::GetListHead | ( | void | ) | const |
bool DataStructures::BPlusTree< KeyType, DataType, order >::Insert | ( | const KeyType | key, | |
const DataType & | data | |||
) |
Definition at line 800 of file DS_BPlusTree.h.
Page< KeyType, DataType, order > * DataStructures::BPlusTree< KeyType, DataType, order >::InsertBranchDown | ( | const KeyType | key, | |
const DataType & | data, | |||
Page< KeyType, DataType, order > * | cur, | |||
ReturnAction * | returnAction, | |||
bool * | success | |||
) | [protected] |
Definition at line 692 of file DS_BPlusTree.h.
Page< KeyType, DataType, order > * DataStructures::BPlusTree< KeyType, DataType, order >::InsertIntoNode | ( | const KeyType | key, | |
const DataType & | childData, | |||
int | insertionIndex, | |||
Page< KeyType, DataType, order > * | nodeData, | |||
Page< KeyType, DataType, order > * | cur, | |||
ReturnAction * | returnAction | |||
) | [protected] |
bool DataStructures::BPlusTree< KeyType, DataType, order >::IsEmpty | ( | void | ) | const |
void DataStructures::BPlusTree< KeyType, DataType, order >::PrintGraph | ( | void | ) |
void DataStructures::BPlusTree< KeyType, DataType, order >::PrintLeaf | ( | Page< KeyType, DataType, order > * | leaf, | |
int | index | |||
) | [static, protected] |
void DataStructures::BPlusTree< KeyType, DataType, order >::PrintLeaves | ( | void | ) |
Definition at line 976 of file DS_BPlusTree.h.
void DataStructures::BPlusTree< KeyType, DataType, order >::RotateLeft | ( | Page< KeyType, DataType, order > * | cur, | |
int | childIndex, | |||
ReturnAction * | returnAction | |||
) | [protected] |
Definition at line 633 of file DS_BPlusTree.h.
void DataStructures::BPlusTree< KeyType, DataType, order >::RotateRight | ( | Page< KeyType, DataType, order > * | cur, | |
int | childIndex, | |||
ReturnAction * | returnAction | |||
) | [protected] |
Definition at line 658 of file DS_BPlusTree.h.
void DataStructures::BPlusTree< KeyType, DataType, order >::SetPoolPageSize | ( | int | size | ) |
Definition at line 110 of file DS_BPlusTree.h.
void DataStructures::BPlusTree< KeyType, DataType, order >::ShiftKeysLeft | ( | Page< KeyType, DataType, order > * | cur | ) | [protected] |
Definition at line 848 of file DS_BPlusTree.h.
void DataStructures::BPlusTree< KeyType, DataType, order >::ShiftNodeLeft | ( | Page< KeyType, DataType, order > * | cur | ) | [protected] |
Definition at line 469 of file DS_BPlusTree.h.
void DataStructures::BPlusTree< KeyType, DataType, order >::ShiftNodeRight | ( | Page< KeyType, DataType, order > * | cur | ) | [protected] |
Definition at line 450 of file DS_BPlusTree.h.
unsigned DataStructures::BPlusTree< KeyType, DataType, order >::Size | ( | void | ) | const |
void DataStructures::BPlusTree< KeyType, DataType, order >::ValidateTreeRecursive | ( | Page< KeyType, DataType, order > * | cur | ) | [protected] |
Page<KeyType, DataType, order> * DataStructures::BPlusTree< KeyType, DataType, order >::leftmostLeaf [protected] |
Definition at line 94 of file DS_BPlusTree.h.
MemoryPool<Page<KeyType, DataType, order> > DataStructures::BPlusTree< KeyType, DataType, order >::pagePool [protected] |
Definition at line 93 of file DS_BPlusTree.h.
Page<KeyType, DataType, order>* DataStructures::BPlusTree< KeyType, DataType, order >::root [protected] |
Definition at line 94 of file DS_BPlusTree.h.