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 >
Util::PriorityArray< TYPE >::PriorityArray ( int size)

constructor

◆ PriorityArray() [2/2]

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

copy constructor

◆ ~PriorityArray()

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

destructor

Member Function Documentation

◆ Add()

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

add element to array

◆ At()

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

return n'th array element

◆ Clear()

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

clear the array

◆ Copy()

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

copy content

◆ Delete()

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

delete content

◆ Destroy()

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

destroy an element (call destructor without freeing memory)

◆ IsEmpty()

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

return true if empty

◆ operator=()

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

assignment operator

◆ operator[]()

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

[] operator

◆ Size()

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

get number of elements in array

◆ UpdateMinPriElementIndex()

template<class TYPE >
void Util::PriorityArray< TYPE >::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: