Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

DataStructures::BPlusTree< KeyType, DataType, order > Class Template Reference

#include <DS_BPlusTree.h>

Collaboration diagram for DataStructures::BPlusTree< KeyType, DataType, order >:
Collaboration graph
[legend]

List of all members.

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


Constructor & Destructor Documentation

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

Definition at line 98 of file DS_BPlusTree.h.

template<class KeyType , class DataType , int order>
DataStructures::BPlusTree< KeyType, DataType, order >::~BPlusTree (  ) 

Definition at line 105 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 627 of file DS_BPlusTree.h.

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

template<class KeyType , class DataType , int order>
void DataStructures::BPlusTree< KeyType, DataType, order >::Clear ( void   ) 

Definition at line 855 of file DS_BPlusTree.h.

Here is the caller graph for this function:

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

Definition at line 155 of file DS_BPlusTree.h.

template<class KeyType, class DataType , int order>
bool DataStructures::BPlusTree< KeyType, DataType, order >::Delete ( const KeyType  key  ) 

Definition at line 149 of file DS_BPlusTree.h.

Here is the caller graph for this function:

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

Here is the call graph for this function:

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

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

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

Definition at line 956 of file DS_BPlusTree.h.

Here is the caller graph for this function:

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

Here is the call graph for this function:

template<class KeyType , class DataType , int order>
void DataStructures::BPlusTree< KeyType, DataType, order >::FreePages ( void   )  [protected]

Definition at line 916 of file DS_BPlusTree.h.

Here is the caller graph for this function:

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

Definition at line 115 of file DS_BPlusTree.h.

Here is the caller graph for this function:

template<class KeyType , class DataType , int order>
DataType DataStructures::BPlusTree< KeyType, DataType, order >::GetDataHead ( void   )  const

Definition at line 940 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 883 of file DS_BPlusTree.h.

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

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

Definition at line 935 of file DS_BPlusTree.h.

Here is the caller graph for this function:

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

Definition at line 800 of file DS_BPlusTree.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

template<class KeyType , class DataType , int order>
bool DataStructures::BPlusTree< KeyType, DataType, order >::IsEmpty ( void   )  const

Definition at line 878 of file DS_BPlusTree.h.

Here is the call graph for this function:

template<class KeyType , class DataType , int order>
void DataStructures::BPlusTree< KeyType, DataType, order >::PrintGraph ( void   ) 

Definition at line 1002 of file DS_BPlusTree.h.

Here is the call graph for this function:

template<class KeyType, class DataType, int order>
void DataStructures::BPlusTree< KeyType, DataType, order >::PrintLeaf ( Page< KeyType, DataType, order > *  leaf,
int  index 
) [static, protected]

Definition at line 968 of file DS_BPlusTree.h.

Here is the call graph for this function:

template<class KeyType , class DataType , int order>
void DataStructures::BPlusTree< KeyType, DataType, order >::PrintLeaves ( void   ) 

Definition at line 976 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 633 of file DS_BPlusTree.h.

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

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

Definition at line 110 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 848 of file DS_BPlusTree.h.

template<class KeyType, class DataType, int order>
void DataStructures::BPlusTree< KeyType, DataType, order >::ShiftNodeLeft ( Page< KeyType, DataType, order > *  cur  )  [protected]

Definition at line 469 of file DS_BPlusTree.h.

template<class KeyType, class DataType, int order>
void DataStructures::BPlusTree< KeyType, DataType, order >::ShiftNodeRight ( Page< KeyType, DataType, order > *  cur  )  [protected]

Definition at line 450 of file DS_BPlusTree.h.

template<class KeyType , class DataType , int order>
unsigned DataStructures::BPlusTree< KeyType, DataType, order >::Size ( void   )  const

Definition at line 866 of file DS_BPlusTree.h.

Here is the caller graph for this function:

template<class KeyType, class DataType, int order>
void DataStructures::BPlusTree< KeyType, DataType, order >::ValidateTreeRecursive ( Page< KeyType, DataType, order > *  cur  )  [protected]

Definition at line 982 of file DS_BPlusTree.h.

Here is the caller graph for this function:


Member Data Documentation

template<class KeyType, class DataType, int order>
Page<KeyType, DataType, order> * DataStructures::BPlusTree< KeyType, DataType, order >::leftmostLeaf [protected]

Definition at line 94 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 93 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 94 of file DS_BPlusTree.h.


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