TermOx
Classes | Public Types | Public Member Functions | List of all members
ox::Priority_queue< T, Priority > Class Template Reference

Wraps std::priority_queue to attach an int priority type to stored objects. More...

#include <priority_queue.hpp>

Public Types

using Priority_t = Priority
 

Public Member Functions

auto top () const -> T const &
 Returns a const reference to the element with the highest priority.
 
auto is_empty () const -> bool
 Returns true if no elements in queue.
 
auto size () const -> std::size_t
 Returns the number of elements currently in the queue.
 
void push (Priority p, T const &x)
 Copy an element into the queue with the given priority.
 
void push (Priority p, T &&x)
 Move an element into the queue with the given priority.
 
auto pop () -> T
 Moves top element from the queue and returns it, shrinking the queue.
 

Detailed Description

template<typename T, typename Priority = std::uint8_t>
class ox::Priority_queue< T, Priority >

Wraps std::priority_queue to attach an int priority type to stored objects.

Uses std::uint8_t as priority type, 0 is lowest priority, 255 is highest.


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