Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl > Class Template Reference

Defines a queue for handling prioritized elements. More...

#include <ogdf/basic/PriorityQueue.h>

+ Inheritance diagram for ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl >:

Public Types

using Handle = typename SuperQueue::handle
 The type of handle for accessing the elements of this queue. More...
 
- Public Types inherited from ogdf::PriorityQueue< T, C, Impl >
using const_reference = const value_type &
 
using handle = typename SpecImpl::Handle
 
using reference = value_type &
 
using size_type = std::size_t
 
using value_type = T
 

Public Member Functions

 PrioritizedQueue (const C &cmp=C(), int initialSize=128)
 
void decrease (Handle pos, const P &priority)
 
Handle push (const E &element, const P &priority)
 Pushes a new element with the respective priority to the queue. More...
 
const E & topElement () const
 Returns the topmost element in the queue. More...
 
const P & topPriority () const
 Returns the priority of the topmost element in this queue. More...
 
- Public Member Functions inherited from ogdf::PriorityQueue< T, C, Impl >
 PriorityQueue (const C &cmp=C(), int initialSize=128)
 Creates empty priority queue. More...
 
 PriorityQueue (const PriorityQueue &other)
 Copy constructor. More...
 
template<class InputIt >
 PriorityQueue (InputIt first, InputIt last, const C &cmp=C())
 Creates priority queue with contents of the given range. More...
 
 PriorityQueue (PriorityQueue &&other)
 Move constructor. More...
 
 PriorityQueue (std::initializer_list< value_type > init, const C &cmp=C())
 Creates priority queue with contents of the given initializer list. More...
 
 ~PriorityQueue ()
 Destroys the underlying data structure. More...
 
void clear ()
 Removes all the entries from the queue. More...
 
const C & comparator () const
 Returns the comparator used for ordering elements. More...
 
void decrease (handle pos, const T &value)
 Decreases value of the element specified by handle to value. More...
 
bool empty () const
 Checks whether the queue is empty. More...
 
void merge (PriorityQueue &other)
 Merges in enqueued values of other queue. More...
 
PriorityQueueoperator= (PriorityQueue other)
 Copy and move assignment. More...
 
PriorityQueueoperator= (std::initializer_list< value_type > ilist)
 Assigns the priority queue contents of the given initializer list. More...
 
void pop ()
 Removes the top element from the heap. More...
 
handle push (const value_type &value)
 Inserts a new element with given value into the queue. More...
 
template<class InputIt >
void push (InputIt first, InputIt last)
 Inserts new elements specified by the given range. More...
 
void push (std::initializer_list< value_type > ilist)
 Inserts new elements specified by the given initializer list. More...
 
size_type size () const
 Returns the number of enqueued elements. More...
 
void swap (PriorityQueue &other)
 Swaps the contents. More...
 
const T & top () const
 Returns reference to the top element in the queue. More...
 
const T & value (handle pos) const
 Returns the priority of that handle. More...
 

Private Types

using Pair = PairTemplate< E, P >
 
using SuperQueue = SuperQueueTemplate< E, P, C, Impl >
 

Private Attributes

m_comp
 

Detailed Description

template<typename E, typename P, class C, template< typename, class > class Impl>
class ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl >

Defines a queue for handling prioritized elements.

Definition at line 269 of file PriorityQueue.h.

Member Typedef Documentation

◆ Handle

template<typename E , typename P , class C , template< typename, class > class Impl>
using ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl >::Handle = typename SuperQueue::handle

The type of handle for accessing the elements of this queue.

Definition at line 278 of file PriorityQueue.h.

◆ Pair

template<typename E , typename P , class C , template< typename, class > class Impl>
using ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl >::Pair = PairTemplate<E, P>
private

Definition at line 272 of file PriorityQueue.h.

◆ SuperQueue

template<typename E , typename P , class C , template< typename, class > class Impl>
using ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl >::SuperQueue = SuperQueueTemplate<E, P, C, Impl>
private

Definition at line 271 of file PriorityQueue.h.

Constructor & Destructor Documentation

◆ PrioritizedQueue()

template<typename E , typename P , class C , template< typename, class > class Impl>
ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl >::PrioritizedQueue ( const C &  cmp = C(),
int  initialSize = 128 
)
inline

Definition at line 280 of file PriorityQueue.h.

Member Function Documentation

◆ decrease()

template<typename E , typename P , class C , template< typename, class > class Impl>
void ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl >::decrease ( Handle  pos,
const P &  priority 
)
inline

Definition at line 301 of file PriorityQueue.h.

◆ push()

template<typename E , typename P , class C , template< typename, class > class Impl>
Handle ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl >::push ( const E &  element,
const P &  priority 
)
inline

Pushes a new element with the respective priority to the queue.

Parameters
elementthe element to be added
prioritythe priority of that element

Definition at line 295 of file PriorityQueue.h.

◆ topElement()

template<typename E , typename P , class C , template< typename, class > class Impl>
const E& ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl >::topElement ( ) const
inline

Returns the topmost element in the queue.

Definition at line 284 of file PriorityQueue.h.

◆ topPriority()

template<typename E , typename P , class C , template< typename, class > class Impl>
const P& ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl >::topPriority ( ) const
inline

Returns the priority of the topmost element in this queue.

Definition at line 287 of file PriorityQueue.h.

Member Data Documentation

◆ m_comp

template<typename E , typename P , class C , template< typename, class > class Impl>
C ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl >::m_comp
private

Definition at line 274 of file PriorityQueue.h.


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