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 | Protected Attributes | List of all members
DataStructures::Heap< weight_type, data_type, isMaxHeap > Class Template Reference

`#include <slikenet/DS_Heap.h>`

Inheritance diagram for DataStructures::Heap< weight_type, data_type, isMaxHeap >:

## Classes

struct | HeapNode

## Public Member Functions

| Heap ()
| ~Heap ()
void | Push (const weight_type &weight, const data_type &data, const char *file, unsigned int line)
void | StartSeries (void)
| Call before calling PushSeries, for a new series of items.
void | PushSeries (const weight_type &weight, const data_type &data, const char *file, unsigned int line)
| If you are going to push a list of items, where the weights of the items on the list are in order and follow the heap order, PushSeries is faster than Push()
data_type | Pop (const unsigned startingIndex)
data_type | Peek (const unsigned startingIndex=0) const
weight_type | PeekWeight (const unsigned startingIndex=0) const
void | Clear (bool doNotDeallocateSmallBlocks, const char *file, unsigned int line)
data_type & | operator[] (const unsigned int position) const
unsigned | Size (void) const

## Protected Member Functions

unsigned | LeftChild (const unsigned i) const
unsigned | RightChild (const unsigned i) const
unsigned | Parent (const unsigned i) const
void | Swap (const unsigned i, const unsigned j)

## Protected Attributes

DataStructures::List< HeapNode > | heap
bool | optimizeNextSeriesPush

## Detailed Description

### template<class weight_type, class data_type, bool isMaxHeap>
class DataStructures::Heap< weight_type, data_type, isMaxHeap >

Definition at line 40 of file DS_Heap.h.

## Constructor & Destructor Documentation

template<class weight_type , class data_type , bool isMaxHeap>

DataStructures::Heap< weight_type, data_type, isMaxHeap >::Heap | ( |  | ) |

Definition at line 75 of file DS_Heap.h.

template<class weight_type , class data_type , bool isMaxHeap>

DataStructures::Heap< weight_type, data_type, isMaxHeap >::~Heap | ( |  | ) |

Definition at line 81 of file DS_Heap.h.

## Member Function Documentation

template<class weight_type , class data_type , bool isMaxHeap>

void DataStructures::Heap< weight_type, data_type, isMaxHeap >::Clear | ( | bool | doNotDeallocateSmallBlocks,
|  | const char * | file,
|  | unsigned int | line
| ) |  |

Definition at line 259 of file DS_Heap.h.

Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GenerateDisjktraMatrix().

template<class weight_type , class data_type , bool isMaxHeap>

unsigned DataStructures::Heap< weight_type, data_type, isMaxHeap >::LeftChild | ( | const unsigned | i | ) | const

inlineprotected

Definition at line 276 of file DS_Heap.h.

template<class weight_type , class data_type , bool isMaxHeap>

data_type & DataStructures::Heap< weight_type, data_type, isMaxHeap >::operator[] | ( | const unsigned int | position | ) | const

inline

Definition at line 265 of file DS_Heap.h.

template<class weight_type , class data_type , bool isMaxHeap>

unsigned DataStructures::Heap< weight_type, data_type, isMaxHeap >::Parent | ( | const unsigned | i | ) | const

inlineprotected

Definition at line 288 of file DS_Heap.h.

References RakAssert.

template<class weight_type , class data_type , bool isMaxHeap>

data_type DataStructures::Heap< weight_type, data_type, isMaxHeap >::Peek | ( | const unsigned | startingIndex = `0` | ) | const

inline

Definition at line 247 of file DS_Heap.h.

template<class weight_type , class data_type , bool isMaxHeap>

weight_type DataStructures::Heap< weight_type, data_type, isMaxHeap >::PeekWeight | ( | const unsigned | startingIndex = `0` | ) | const

inline

Definition at line 253 of file DS_Heap.h.

Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GenerateDisjktraMatrix().

template<class weight_type , class data_type , bool isMaxHeap>

data_type DataStructures::Heap< weight_type, data_type, isMaxHeap >::Pop | ( | const unsigned | startingIndex | ) |

Definition at line 170 of file DS_Heap.h.

Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GenerateDisjktraMatrix().

template<class weight_type, class data_type, bool isMaxHeap>

void DataStructures::Heap< weight_type, data_type, isMaxHeap >::Push | ( | const weight_type & | weight,
|  | const data_type & | data,
|  | const char * | file,
|  | unsigned int | line
| ) |  |

Definition at line 135 of file DS_Heap.h.

Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GenerateDisjktraMatrix().

template<class weight_type, class data_type, bool isMaxHeap>

void DataStructures::Heap< weight_type, data_type, isMaxHeap >::PushSeries | ( | const weight_type & | weight,
|  | const data_type & | data,
|  | const char * | file,
|  | unsigned int | line
| ) |  |

If you are going to push a list of items, where the weights of the items on the list are in order and follow the heap order, PushSeries is faster than Push()

Definition at line 87 of file DS_Heap.h.

template<class weight_type , class data_type , bool isMaxHeap>

unsigned DataStructures::Heap< weight_type, data_type, isMaxHeap >::RightChild | ( | const unsigned | i | ) | const

inlineprotected

Definition at line 282 of file DS_Heap.h.

template<class weight_type , class data_type , bool isMaxHeap>

unsigned DataStructures::Heap< weight_type, data_type, isMaxHeap >::Size | ( | void |  | ) | const

Definition at line 270 of file DS_Heap.h.

Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::GenerateDisjktraMatrix().

template<class weight_type, class data_type, bool isMaxHeap>

void DataStructures::Heap< weight_type, data_type, isMaxHeap >::StartSeries | ( | void |  | ) |

inline

Call before calling PushSeries, for a new series of items.

Definition at line 55 of file DS_Heap.h.

template<class weight_type , class data_type , bool isMaxHeap>

void DataStructures::Heap< weight_type, data_type, isMaxHeap >::Swap | ( | const unsigned | i,
|  | const unsigned | j
| ) |  |

protected

Definition at line 297 of file DS_Heap.h.

## Member Data Documentation

template<class weight_type, class data_type, bool isMaxHeap>

DataStructures::List<HeapNode> DataStructures::Heap< weight_type, data_type, isMaxHeap >::heap

protected

Definition at line 70 of file DS_Heap.h.

template<class weight_type, class data_type, bool isMaxHeap>

bool DataStructures::Heap< weight_type, data_type, isMaxHeap >::optimizeNextSeriesPush

protected

Definition at line 71 of file DS_Heap.h.

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

- Source/include/slikenet/DS_Heap.h