LeviLamina
Loading...
Searching...
No Matches
ll::data::detail::concurrent_priority_queue< T, Compare, Allocator > Class Template Reference

Public Types

using value_type = T
 
using reference = T&
 
using const_reference = T const&
 
using size_type = std::size_t
 
using difference_type = std::ptrdiff_t
 
using allocator_type = Allocator
 

Public Member Functions

 concurrent_priority_queue (allocator_type const &alloc)
 
 concurrent_priority_queue (Compare const &compare, allocator_type const &alloc=allocator_type())
 
 concurrent_priority_queue (size_type init_capacity, allocator_type const &alloc=allocator_type())
 
 concurrent_priority_queue (size_type init_capacity, Compare const &compare, allocator_type const &alloc=allocator_type())
 
template<typename InputIterator >
 concurrent_priority_queue (InputIterator begin, InputIterator end, Compare const &compare, allocator_type const &alloc=allocator_type())
 
template<typename InputIterator >
 concurrent_priority_queue (InputIterator begin, InputIterator end, allocator_type const &alloc=allocator_type())
 
 concurrent_priority_queue (std::initializer_list< value_type > init, Compare const &compare, allocator_type const &alloc=allocator_type())
 
 concurrent_priority_queue (std::initializer_list< value_type > init, allocator_type const &alloc=allocator_type())
 
 concurrent_priority_queue (concurrent_priority_queue const &other)
 
 concurrent_priority_queue (concurrent_priority_queue const &other, allocator_type const &alloc)
 
 concurrent_priority_queue (concurrent_priority_queue &&other)
 
 concurrent_priority_queue (concurrent_priority_queue &&other, allocator_type const &alloc)
 
concurrent_priority_queueoperator= (concurrent_priority_queue const &other)
 
concurrent_priority_queueoperator= (concurrent_priority_queue &&other)
 
concurrent_priority_queueoperator= (std::initializer_list< value_type > init)
 
template<typename InputIterator >
void assign (InputIterator begin, InputIterator end)
 
void assign (std::initializer_list< value_type > init)
 
concurrent_priority_queueoperator= (vector_type &&vec)
 
bool empty () const
 
size_type size () const
 
void push (value_type const &value)
 
void push (value_type &&value)
 
template<typename... Args>
void emplace (Args &&... args)
 
bool try_pop (value_type &value)
 
template<class F >
bool try_pop_if (F &&fn)
 
void clear ()
 
void swap (concurrent_priority_queue &other)
 
allocator_type get_allocator () const
 

Protected Types

using vector_type = std::vector<value_type, allocator_type>
 

Protected Attributes

vector_type c
 Storage for the heap of elements in queue, plus unheapified elements.
 

Friends

bool operator== (concurrent_priority_queue const &lhs, concurrent_priority_queue const &rhs)
 

Member Data Documentation

◆ c

template<typename T , typename Compare = std::less<T>, typename Allocator = std::allocator<T>>
vector_type ll::data::detail::concurrent_priority_queue< T, Compare, Allocator >::c
protected

Storage for the heap of elements in queue, plus unheapified elements.

data has the following structure:

binary unheapified heap elements ____|_______|____ | | | v v v [_|...|_|_|...|_| |...| ] 0 ^ ^ ^ | | |__capacity | |__my_size |__mark

Thus, data stores the binary heap starting at position 0 through mark-1 (it may be empty). Then there are 0 or more elements that have not yet been inserted into the heap, in positions mark through my_size-1.


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