|
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 |
| PriorityArray::PriorityArray | ( | int | size | ) |
constructor
| PriorityArray::PriorityArray | ( | const PriorityArray< TYPE > & | rhs | ) |
copy constructor
| PriorityArray::~PriorityArray | ( | ) |
destructor
| void PriorityArray::Add | ( | const TYPE & | elm, |
| float | pri ) |
add element to array
| TYPE & PriorityArray::At | ( | int | index | ) |
return n'th array element
| void PriorityArray::Clear | ( | ) |
clear the array
|
private |
copy content
|
private |
delete content
|
private |
destroy an element (call destructor without freeing memory)
| bool PriorityArray::IsEmpty | ( | ) | const |
return true if empty
| PriorityArray< TYPE > & PriorityArray::operator= | ( | const PriorityArray< TYPE > & | rhs | ) |
assignment operator
| TYPE & PriorityArray::operator[] | ( | int | index | ) | const |
[] operator
| int PriorityArray::Size | ( | ) | const |
get number of elements in array
|
private |
update the min pri element index
|
private |
|
private |
|
private |
|
private |