Nebula
|
#include <priorityarray.h>
Classes | |
struct | Element |
an element class More... | |
Public Member Functions | |
PriorityArray (int size) | |
constructor | |
PriorityArray (const PriorityArray< TYPE > &rhs) | |
copy constructor | |
~PriorityArray () | |
destructor | |
PriorityArray< TYPE > & | operator= (const PriorityArray< TYPE > &rhs) |
assignment operator | |
TYPE & | operator[] (int index) const |
[] operator | |
void | Clear () |
clear the array | |
void | Add (const TYPE &elm, float pri) |
add element to array | |
int | Size () const |
get number of elements in array | |
TYPE & | At (int index) |
return n'th array element | |
bool | IsEmpty () const |
return true if empty | |
Private Member Functions | |
void | UpdateMinPriElementIndex () |
update the min pri element index | |
void | Copy (const PriorityArray< TYPE > &src) |
copy content | |
void | Delete () |
delete content | |
void | Destroy (TYPE *elm) |
destroy an element (call destructor without freeing memory) | |
Private Attributes | |
int | numElements |
int | maxElements |
int | minPriElementIndex |
Element * | elements |
Util::PriorityArray< TYPE >::PriorityArray | ( | int | size | ) |
constructor
Util::PriorityArray< TYPE >::PriorityArray | ( | const PriorityArray< TYPE > & | rhs | ) |
copy constructor
Util::PriorityArray< TYPE >::~PriorityArray | ( | ) |
destructor
void Util::PriorityArray< TYPE >::Add | ( | const TYPE & | elm, |
float | pri ) |
add element to array
TYPE & Util::PriorityArray< TYPE >::At | ( | int | index | ) |
return n'th array element
void Util::PriorityArray< TYPE >::Clear | ( | ) |
clear the array
|
private |
copy content
|
private |
delete content
|
private |
destroy an element (call destructor without freeing memory)
bool Util::PriorityArray< TYPE >::IsEmpty | ( | ) | const |
return true if empty
PriorityArray< TYPE > & Util::PriorityArray< TYPE >::operator= | ( | const PriorityArray< TYPE > & | rhs | ) |
assignment operator
TYPE & Util::PriorityArray< TYPE >::operator[] | ( | int | index | ) | const |
[] operator
int Util::PriorityArray< TYPE >::Size | ( | ) | const |
get number of elements in array
|
private |
update the min pri element index
|
private |
|
private |
|
private |
|
private |