Nebula
Loading...
Searching...
No Matches
Util::PriorityArray< TYPE > Class Template Reference

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

Constructor & Destructor Documentation

◆ PriorityArray() [1/2]

template<class TYPE >
PriorityArray::PriorityArray ( int size)

constructor

◆ PriorityArray() [2/2]

template<class TYPE >
PriorityArray::PriorityArray ( const PriorityArray< TYPE > & rhs)

copy constructor

◆ ~PriorityArray()

template<class TYPE >
PriorityArray::~PriorityArray ( )

destructor

Member Function Documentation

◆ Add()

template<class TYPE >
void PriorityArray::Add ( const TYPE & elm,
float pri )

add element to array

◆ At()

template<class TYPE >
TYPE & PriorityArray::At ( int index)

return n'th array element

◆ Clear()

template<class TYPE >
void PriorityArray::Clear ( )

clear the array

◆ Copy()

template<class TYPE >
void PriorityArray::Copy ( const PriorityArray< TYPE > & src)
private

copy content

◆ Delete()

template<class TYPE >
void PriorityArray::Delete ( )
private

delete content

◆ Destroy()

template<class TYPE >
void PriorityArray::Destroy ( TYPE * elm)
private

destroy an element (call destructor without freeing memory)

◆ IsEmpty()

template<class TYPE >
bool PriorityArray::IsEmpty ( ) const

return true if empty

◆ operator=()

template<class TYPE >
PriorityArray< TYPE > & PriorityArray::operator= ( const PriorityArray< TYPE > & rhs)

assignment operator

◆ operator[]()

template<class TYPE >
TYPE & PriorityArray::operator[] ( int index) const

[] operator

◆ Size()

template<class TYPE >
int PriorityArray::Size ( ) const

get number of elements in array

◆ UpdateMinPriElementIndex()

template<class TYPE >
void PriorityArray::UpdateMinPriElementIndex ( )
private

update the min pri element index

Member Data Documentation

◆ elements

template<class TYPE >
Element* Util::PriorityArray< TYPE >::elements
private

◆ maxElements

template<class TYPE >
int Util::PriorityArray< TYPE >::maxElements
private

◆ minPriElementIndex

template<class TYPE >
int Util::PriorityArray< TYPE >::minPriElementIndex
private

◆ numElements

template<class TYPE >
int Util::PriorityArray< TYPE >::numElements
private

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