HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_PriorityQueue< utPtr, utCompare, need_changed_position > Class Template Reference

#include <UT_PriorityQueue.h>

Public Member Functions

 UT_PriorityQueue (unsigned int sz=0, const utCompare &compare=utCompare())
 Trivial constructor and destructor: More...
 
virtual ~UT_PriorityQueue ()
 
 UT_PriorityQueue (const UT_PriorityQueue< utPtr, utCompare, need_changed_position > &a)
 
unsigned int insert (utPtr t)
 
unsigned int append (utPtr t)
 
void destroy (unsigned int entry)
 calls remove before destroying More...
 
void remove (unsigned int entry)
 
void clear ()
 
exint size () const
 
exint entries () const
 
int64 getMemoryUsage (bool inclusive) const
 
bool isEmpty () const
 
const utPtr & head () const
 
const utPtr & getEntry (int idx) const
 
virtual void changedPosition (utPtr, unsigned int) const
 
unsigned int bubbleDown (unsigned int entry)
 
unsigned int bubbleUp (unsigned int entry)
 

Protected Attributes

UT_Array< utPtr > myArray
 
const utCompare comparator
 

Detailed Description

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
class UT_PriorityQueue< utPtr, utCompare, need_changed_position >

NOTE: UT_PriorityQueue and std::priority_queue are max heaps, so the comparison direction must be opposite that for sorting an array.

Definition at line 27 of file UT_PriorityQueue.h.

Constructor & Destructor Documentation

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
UT_PriorityQueue< utPtr, utCompare, need_changed_position >::UT_PriorityQueue ( unsigned int  sz = 0,
const utCompare &  compare = utCompare() 
)
inlineexplicit

Trivial constructor and destructor:

Definition at line 31 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
virtual UT_PriorityQueue< utPtr, utCompare, need_changed_position >::~UT_PriorityQueue ( )
inlinevirtual

Definition at line 36 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
UT_PriorityQueue< utPtr, utCompare, need_changed_position >::UT_PriorityQueue ( const UT_PriorityQueue< utPtr, utCompare, need_changed_position > &  a)
inline

Copy constructor that uses operator '=' to assign each of a's Things to this array.

Definition at line 40 of file UT_PriorityQueue.h.

Member Function Documentation

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
unsigned int UT_PriorityQueue< utPtr, utCompare, need_changed_position >::append ( utPtr  t)
inline

Definition at line 54 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
unsigned int UT_PriorityQueue< utPtr, utCompare, need_changed_position >::bubbleDown ( unsigned int  entry)
inline

Definition at line 117 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
unsigned int UT_PriorityQueue< utPtr, utCompare, need_changed_position >::bubbleUp ( unsigned int  entry)
inline

Definition at line 159 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
virtual void UT_PriorityQueue< utPtr, utCompare, need_changed_position >::changedPosition ( utPtr  ,
unsigned  int 
) const
inlinevirtual

Reimplemented in gu_sdf_queue.

Definition at line 113 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
void UT_PriorityQueue< utPtr, utCompare, need_changed_position >::clear ( void  )
inline

Definition at line 84 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
void UT_PriorityQueue< utPtr, utCompare, need_changed_position >::destroy ( unsigned int  entry)
inline

calls remove before destroying

Definition at line 61 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
exint UT_PriorityQueue< utPtr, utCompare, need_changed_position >::entries ( ) const
inline

Definition at line 90 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
const utPtr& UT_PriorityQueue< utPtr, utCompare, need_changed_position >::getEntry ( int  idx) const
inline

Definition at line 107 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
int64 UT_PriorityQueue< utPtr, utCompare, need_changed_position >::getMemoryUsage ( bool  inclusive) const
inline

Definition at line 92 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
const utPtr& UT_PriorityQueue< utPtr, utCompare, need_changed_position >::head ( ) const
inline

Definition at line 102 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
unsigned int UT_PriorityQueue< utPtr, utCompare, need_changed_position >::insert ( utPtr  t)
inline

Definition at line 46 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
bool UT_PriorityQueue< utPtr, utCompare, need_changed_position >::isEmpty ( ) const
inline

Definition at line 99 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
void UT_PriorityQueue< utPtr, utCompare, need_changed_position >::remove ( unsigned int  entry)
inline

Definition at line 68 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
exint UT_PriorityQueue< utPtr, utCompare, need_changed_position >::size ( void  ) const
inline

Definition at line 89 of file UT_PriorityQueue.h.

Member Data Documentation

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
const utCompare UT_PriorityQueue< utPtr, utCompare, need_changed_position >::comparator
protected

Definition at line 218 of file UT_PriorityQueue.h.

template<class utPtr, class utCompare = std::less<utPtr>, bool need_changed_position = false>
UT_Array<utPtr> UT_PriorityQueue< utPtr, utCompare, need_changed_position >::myArray
protected

Definition at line 217 of file UT_PriorityQueue.h.


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