arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
PriorityQueue< T > Class Template Reference

Priority Queue which is based on a List. The order of the elements is defined by a compare function which is provided in the constructor. If the function returns > 0 if v1 > v2, the data will be provided in increasing order. More...

#include <PriorityQueue.h>

Public Member Functions

 PriorityQueue (int(*compare)(T &v1, T &v2))
 
bool clear ()
 
bool dequeue (T &data)
 
bool empty ()
 
bool enqueue (T &&data)
 
bool peek (T &data)
 
void setAllocator (Allocator &allocator)
 
size_t size ()
 

Protected Attributes

int(* compare_cb )(T &v1, T &v2)
 
List< Tl
 

Detailed Description

template<class T>
class audio_tools::PriorityQueue< T >

Priority Queue which is based on a List. The order of the elements is defined by a compare function which is provided in the constructor. If the function returns > 0 if v1 > v2, the data will be provided in increasing order.

Author
Phil Schatzmann
Template Parameters
T

Constructor & Destructor Documentation

◆ PriorityQueue()

template<class T >
PriorityQueue ( int(*)(T &v1, T &v2 compare)
inline

Member Function Documentation

◆ clear()

template<class T >
bool clear ( )
inline

◆ dequeue()

template<class T >
bool dequeue ( T data)
inline

◆ empty()

template<class T >
bool empty ( )
inline

◆ enqueue()

template<class T >
bool enqueue ( T &&  data)
inline

◆ peek()

template<class T >
bool peek ( T data)
inline

◆ setAllocator()

template<class T >
void setAllocator ( Allocator allocator)
inline

◆ size()

template<class T >
size_t size ( )
inline

Member Data Documentation

◆ compare_cb

template<class T >
int(* compare_cb) (T &v1, T &v2)
protected

◆ l

template<class T >
List<T> l
protected

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