SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
DataStructures::BPlusTree< KeyType, DataType, order > Class Template Reference

`#include <slikenet/DS_BPlusTree.h>`

Inheritance diagram for DataStructures::BPlusTree< KeyType, DataType, order >:

## 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

## Detailed Description

### template<class KeyType, class DataType, int order>
class DataStructures::BPlusTree< KeyType, DataType, order >

A BPlus tree Written with efficiency and speed in mind.

Definition at line 77 of file DS_BPlusTree.h.

## Constructor & Destructor Documentation

template<class KeyType , class DataType , int order>

DataStructures::BPlusTree< KeyType, DataType, order >::BPlusTree | ( |  | ) |

Definition at line 133 of file DS_BPlusTree.h.

References RakAssert.

template<class KeyType , class DataType , int order>

DataStructures::BPlusTree< KeyType, DataType, order >::~BPlusTree | ( |  | ) |

Definition at line 140 of file DS_BPlusTree.h.

## Member Function Documentation

template<class KeyType, class DataType, int order>

bool DataStructures::BPlusTree< KeyType, DataType, order >::CanRotateLeft | ( | Page< KeyType, DataType, order > * | cur,
|  | int | childIndex
| ) |  |

protected

Definition at line 662 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::children, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType, class DataType, int order>

bool DataStructures::BPlusTree< KeyType, DataType, order >::CanRotateRight | ( | Page< KeyType, DataType, order > * | cur,
|  | int | childIndex
| ) |  |

protected

Definition at line 687 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::children, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType , class DataType , int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::Clear | ( | void |  | ) |

Definition at line 890 of file DS_BPlusTree.h.

References _FILE_AND_LINE_.

Referenced by DataStructures::Table::Clear().

template<class KeyType, class DataType , int order>

bool DataStructures::BPlusTree< KeyType, DataType, order >::Delete | ( | const KeyType | key | ) |

Definition at line 184 of file DS_BPlusTree.h.

Referenced by DataStructures::Table::RemoveRow(), and DataStructures::Table::RemoveRows().

template<class KeyType, class DataType, int order>

bool DataStructures::BPlusTree< KeyType, DataType, order >::Delete | ( | const KeyType | key,
|  | DataType & | out
| ) |  |

Definition at line 190 of file DS_BPlusTree.h.

References _FILE_AND_LINE_, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::action, and DataStructures::Page< KeyType, DataType, order >::children.

template<class KeyType, class DataType, int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::DeleteFromPageAtIndex | ( | const int | index,
|  | Page< KeyType, DataType, order > * | cur
| ) |  |

protected

Definition at line 166 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::data, if(), DataStructures::Page< KeyType, DataType, order >::isLeaf, DataStructures::Page< KeyType, DataType, order >::keys, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType, class DataType, int order>

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 230 of file DS_BPlusTree.h.

References DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::action, DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::data, DataStructures::Page< KeyType, DataType, order >::isLeaf, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::key1, DataStructures::Page< KeyType, DataType, order >::keys, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType, class DataType, int order>

bool DataStructures::BPlusTree< KeyType, DataType, order >::FixUnderflow | ( | int | branchIndex,
|  | Page< KeyType, DataType, order > * | cur,
|  | KeyType | rightRootKey,
|  | ReturnAction * | returnAction
| ) |  |

protected

Definition at line 305 of file DS_BPlusTree.h.

References _FILE_AND_LINE_, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::action, DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::data, DataStructures::Page< KeyType, DataType, order >::isLeaf, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::key1, DataStructures::Page< KeyType, DataType, order >::keys, DataStructures::Page< KeyType, DataType, order >::next, DataStructures::Page< KeyType, DataType, order >::previous, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType , class DataType, int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::ForEachData | ( | void(*)(DataType input, int index) | func | ) |

Definition at line 988 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::data, DataStructures::Page< KeyType, DataType, order >::next, and DataStructures::Page< KeyType, DataType, order >::size.

Referenced by DataStructures::Table::AddColumn(), and DataStructures::Table::Clear().

template<class KeyType, class DataType, int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::ForEachLeaf | ( | void(*)(Page< KeyType, DataType, order > *leaf, int index) | func | ) |

Definition at line 977 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::next.

template<class KeyType , class DataType , int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::FreePages | ( | void |  | ) |

protected

Definition at line 948 of file DS_BPlusTree.h.

References _FILE_AND_LINE_, DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::isLeaf, DataStructures::Queue< queue_type >::Pop(), DataStructures::Queue< queue_type >::Push(), DataStructures::Queue< queue_type >::Size(), and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType, class DataType, int order>

bool DataStructures::BPlusTree< KeyType, DataType, order >::Get | ( | const KeyType | key,
|  | DataType & | out
| ) |  | const

Definition at line 150 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::data.

Referenced by DataStructures::Table::GetRowByID(), and DataStructures::Table::QueryTable().

template<class KeyType , class DataType , int order>

DataType DataStructures::BPlusTree< KeyType, DataType, order >::GetDataHead | ( | void |  | ) | const

Definition at line 972 of file DS_BPlusTree.h.

template<class KeyType, class DataType, int order>

bool DataStructures::BPlusTree< KeyType, DataType, order >::GetIndexOf | ( | const KeyType | key,
|  | Page< KeyType, DataType, order > * | page,
|  | int * | out
| ) |  | const

protected

Definition at line 918 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::keys, RakAssert, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType, class DataType , int order>

Page< KeyType, DataType, order > * DataStructures::BPlusTree< KeyType, DataType, order >::GetLeafFromKey | ( | const KeyType | key | ) | const

protected

Definition at line 712 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::children, and DataStructures::Page< KeyType, DataType, order >::isLeaf.

template<class KeyType , class DataType , int order>

Page< KeyType, DataType, order > * DataStructures::BPlusTree< KeyType, DataType, order >::GetListHead | ( | void |  | ) | const

Definition at line 967 of file DS_BPlusTree.h.

Referenced by DataStructures::Table::GetAvailableRowId(), DataStructures::Table::GetListHead(), DataStructures::Table::GetRowByIndex(), DataStructures::Table::operator=(), DataStructures::Table::QueryTable(), DataStructures::Table::RemoveColumn(), DataStructures::Table::RemoveRows(), SLNet::TableSerializer::SerializeTable(), and DataStructures::Table::SortTable().

template<class KeyType, class DataType, int order>

bool DataStructures::BPlusTree< KeyType, DataType, order >::Insert | ( | const KeyType | key,
|  | const DataType & | data
| ) |  |

Definition at line 835 of file DS_BPlusTree.h.

References _FILE_AND_LINE_, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::action, DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::isLeaf, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::key1, DataStructures::Page< KeyType, DataType, order >::keys, RakAssert, and DataStructures::Page< KeyType, DataType, order >::size.

Referenced by DataStructures::Table::AddRow(), and DataStructures::Table::AddRowColumns().

template<class KeyType, class DataType, int order>

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 727 of file DS_BPlusTree.h.

References DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::action, DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::data, DataStructures::Page< KeyType, DataType, order >::isLeaf, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::key1, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::key2, DataStructures::Page< KeyType, DataType, order >::keys, RakAssert, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType, class DataType, int order>

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

Definition at line 522 of file DS_BPlusTree.h.

References _FILE_AND_LINE_, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::action, DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::data, for(), if(), DataStructures::Page< KeyType, DataType, order >::isLeaf, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::key1, DataStructures::Page< KeyType, DataType, order >::keys, DataStructures::Page< KeyType, DataType, order >::next, DataStructures::Page< KeyType, DataType, order >::previous, RakAssert, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType , class DataType , int order>

bool DataStructures::BPlusTree< KeyType, DataType, order >::IsEmpty | ( | void |  | ) | const

Definition at line 913 of file DS_BPlusTree.h.

template<class KeyType , class DataType , int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::PrintGraph | ( | void |  | ) |

Definition at line 1035 of file DS_BPlusTree.h.

References _FILE_AND_LINE_, DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::isLeaf, DataStructures::Page< KeyType, DataType, order >::keys, DataStructures::Queue< queue_type >::Pop(), DataStructures::Queue< queue_type >::Push(), RAKNET_DEBUG_PRINTF, DataStructures::Queue< queue_type >::Size(), and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType, class DataType, int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::PrintLeaf | ( | Page< KeyType, DataType, order > * | leaf,
|  | int | index
| ) |  |

staticprotected

Definition at line 1000 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::data, RAKNET_DEBUG_PRINTF, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType , class DataType , int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::PrintLeaves | ( | void |  | ) |

Definition at line 1009 of file DS_BPlusTree.h.

template<class KeyType, class DataType, int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::RotateLeft | ( | Page< KeyType, DataType, order > * | cur,
|  | int | childIndex,
|  | ReturnAction * | returnAction
| ) |  |

protected

Definition at line 668 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::data, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::key1, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::key2, DataStructures::Page< KeyType, DataType, order >::keys, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType, class DataType, int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::RotateRight | ( | Page< KeyType, DataType, order > * | cur,
|  | int | childIndex,
|  | ReturnAction * | returnAction
| ) |  |

protected

Definition at line 693 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::data, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::key1, DataStructures::BPlusTree< KeyType, DataType, order >::ReturnAction::key2, DataStructures::Page< KeyType, DataType, order >::keys, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType , class DataType , int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::SetPoolPageSize | ( | int | size | ) |

Definition at line 145 of file DS_BPlusTree.h.

template<class KeyType, class DataType, int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::ShiftKeysLeft | ( | Page< KeyType, DataType, order > * | cur | ) |

protected

Definition at line 883 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::keys, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType, class DataType, int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::ShiftNodeLeft | ( | Page< KeyType, DataType, order > * | cur | ) |

protected

Definition at line 504 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::data, if(), DataStructures::Page< KeyType, DataType, order >::isLeaf, DataStructures::Page< KeyType, DataType, order >::keys, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType, class DataType, int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::ShiftNodeRight | ( | Page< KeyType, DataType, order > * | cur | ) |

protected

Definition at line 485 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::data, DataStructures::Page< KeyType, DataType, order >::isLeaf, DataStructures::Page< KeyType, DataType, order >::keys, and DataStructures::Page< KeyType, DataType, order >::size.

template<class KeyType , class DataType , int order>

unsigned DataStructures::BPlusTree< KeyType, DataType, order >::Size | ( | void |  | ) | const

Definition at line 901 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::next, and DataStructures::Page< KeyType, DataType, order >::size.

Referenced by DataStructures::Table::GetRowCount(), and SLNet::TableSerializer::SerializeTable().

template<class KeyType, class DataType, int order>

void DataStructures::BPlusTree< KeyType, DataType, order >::ValidateTreeRecursive | ( | Page< KeyType, DataType, order > * | cur | ) |

protected

Definition at line 1015 of file DS_BPlusTree.h.

References DataStructures::Page< KeyType, DataType, order >::children, DataStructures::Page< KeyType, DataType, order >::isLeaf, DataStructures::Page< KeyType, DataType, order >::keys, RakAssert, and DataStructures::Page< KeyType, DataType, order >::size.

## Member Data Documentation

template<class KeyType, class DataType, int order>

Page<KeyType, DataType, order> * DataStructures::BPlusTree< KeyType, DataType, order >::leftmostLeaf

protected

Definition at line 129 of file DS_BPlusTree.h.

template<class KeyType, class DataType, int order>

MemoryPool<Page<KeyType, DataType, order> > DataStructures::BPlusTree< KeyType, DataType, order >::pagePool

protected

Definition at line 128 of file DS_BPlusTree.h.

template<class KeyType, class DataType, int order>

Page<KeyType, DataType, order>* DataStructures::BPlusTree< KeyType, DataType, order >::root

protected

Definition at line 129 of file DS_BPlusTree.h.

The documentation for this class was generated from the following file:

- Source/include/slikenet/DS_BPlusTree.h