Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::pq_internal::PrioritizedArrayQueueBase< E, P, C, Impl, Map > Class Template Reference

#include <ogdf/basic/PriorityQueue.h>

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

Public Member Functions

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

Protected Types

using Handle = typename PrioritizedQueue< E, P, C, Impl >::Handle
 
using SuperQueue = PrioritizedQueue< E, P, C, Impl >
 

Protected Member Functions

 PrioritizedArrayQueueBase (const C &cmp, int initialSize, const Map &map)
 

Protected Attributes

Map m_handles
 

Additional Inherited Members

- Public Types inherited from ogdf::pq_internal::PrioritizedQueue< E, P, C, Impl >
using Handle = typename SuperQueue::handle
 The type of handle for accessing the elements of this queue.
 
- 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
 

Detailed Description

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

Definition at line 307 of file PriorityQueue.h.

Member Typedef Documentation

◆ Handle

template<typename E , typename P , class C , template< typename, class > class Impl, typename Map >
using ogdf::pq_internal::PrioritizedArrayQueueBase< E, P, C, Impl, Map >::Handle = typename PrioritizedQueue<E, P, C, Impl>::Handle
protected

Definition at line 310 of file PriorityQueue.h.

◆ SuperQueue

template<typename E , typename P , class C , template< typename, class > class Impl, typename Map >
using ogdf::pq_internal::PrioritizedArrayQueueBase< E, P, C, Impl, Map >::SuperQueue = PrioritizedQueue<E, P, C, Impl>
protected

Definition at line 309 of file PriorityQueue.h.

Constructor & Destructor Documentation

◆ PrioritizedArrayQueueBase()

template<typename E , typename P , class C , template< typename, class > class Impl, typename Map >
ogdf::pq_internal::PrioritizedArrayQueueBase< E, P, C, Impl, Map >::PrioritizedArrayQueueBase ( const C &  cmp,
int  initialSize,
const Map &  map 
)
inlineprotected

Definition at line 359 of file PriorityQueue.h.

Member Function Documentation

◆ clear()

template<typename E , typename P , class C , template< typename, class > class Impl, typename Map >
void ogdf::pq_internal::PrioritizedArrayQueueBase< E, P, C, Impl, Map >::clear ( )
inline

Removes all elements from this queue.

Definition at line 353 of file PriorityQueue.h.

◆ contains()

template<typename E , typename P , class C , template< typename, class > class Impl, typename Map >
bool ogdf::pq_internal::PrioritizedArrayQueueBase< E, P, C, Impl, Map >::contains ( const E &  element) const
inline

Returns whether this queue contains that key.

Definition at line 314 of file PriorityQueue.h.

◆ decrease()

template<typename E , typename P , class C , template< typename, class > class Impl, typename Map >
void ogdf::pq_internal::PrioritizedArrayQueueBase< E, P, C, Impl, Map >::decrease ( const E &  element,
const P priority 
)
inline

Decreases the priority of the given element.

Note, that the behaviour is undefined if the key is not present or the given priority is greater than the former one.

Definition at line 347 of file PriorityQueue.h.

◆ pop()

template<typename E , typename P , class C , template< typename, class > class Impl, typename Map >
void ogdf::pq_internal::PrioritizedArrayQueueBase< E, P, C, Impl, Map >::pop ( )
inline

Removes the topmost element from the queue.

Definition at line 337 of file PriorityQueue.h.

◆ priority()

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

Definition at line 320 of file PriorityQueue.h.

◆ push()

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

Adds a new element to the queue.

Note, that the behaviour is undefined if the key is already present.

Definition at line 329 of file PriorityQueue.h.

Member Data Documentation

◆ m_handles

template<typename E , typename P , class C , template< typename, class > class Impl, typename Map >
Map ogdf::pq_internal::PrioritizedArrayQueueBase< E, P, C, Impl, Map >::m_handles
protected

Definition at line 362 of file PriorityQueue.h.


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