aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > Class Template Reference

Sorted priority queue safe (w.r.t. More...

#include <agrum/base/core/sortedPriorityQueue.h>

Inherits SharedAVLTreeIteratorSafe< Val, SortedPriorityQueue< Val, int, std::less< Val > >::TreeCmp >.

Collaboration diagram for gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >:

Public Types

using iterator_category = std::bidirectional_iterator_tag
 Types for STL compliance.
using value_type = Val
 Types for STL compliance.
using reference = value_type&
 Types for STL compliance.
using const_reference = const value_type&
 Types for STL compliance.
using pointer = value_type*
 Types for STL compliance.
using const_pointer = const value_type*
 Types for STL compliance.
using TreeCmp = typename SortedPriorityQueue< Val, Priority, Cmp >::TreeCmp
 Types for STL compliance.

Public Member Functions

Constructors / Destructors
 SortedPriorityQueueReverseIteratorSafe (SortedPriorityQueue< Val, Priority, Cmp > &queue, const bool rbegin=true)
 constructor for rbegin safe iterators
 SortedPriorityQueueReverseIteratorSafe (const SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > &from)
 copy constructor
 SortedPriorityQueueReverseIteratorSafe (SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > &&from)
 move constructor
 ~SortedPriorityQueueReverseIteratorSafe () noexcept
 destructor
Operators
SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & operator= (const SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > &from)
 copy operator
SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & operator= (SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > &&from)
 move operator
bool operator== (const SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > &from) const
 indicates whether two iterator point to the same element
bool operator!= (const SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > &from) const
 indicates whether two iterator point to different element
SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & operator++ () noexcept
 move to the next element in the queue
SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & operator+= (const Size k) noexcept
 move to the next k element
SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & operator-- () noexcept
 move to the preceding element in the queue
SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & operator-= (const Size k) noexcept
 move to the preceding k element
const_reference operator* () const
 returns the value pointed to by the iterator
const_pointer operator-> () const
 returns a pointer on the value pointed to by the iterator

Protected Attributes

friend AVLTree< Val, Cmp >
 allow AVL trees to access the content of the iterators
friend SortedPriorityQueue< Val, Cmp >

Detailed Description

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
class gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >

Sorted priority queue safe (w.r.t.

erasures) reverse iterator

Template Parameters
ValThe type of the elements stored into the queue.
PriorityThe type of the priorities assigned to the elements.
CmpThe function used for sorting the priorities.

Definition at line 911 of file sortedPriorityQueue.h.

Member Typedef Documentation

◆ const_pointer

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
using gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::const_pointer = const value_type*

Types for STL compliance.

Definition at line 923 of file sortedPriorityQueue.h.

◆ const_reference

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
using gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::const_reference = const value_type&

Types for STL compliance.

Definition at line 921 of file sortedPriorityQueue.h.

◆ iterator_category

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
using gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::iterator_category = std::bidirectional_iterator_tag

Types for STL compliance.

Definition at line 918 of file sortedPriorityQueue.h.

◆ pointer

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
using gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::pointer = value_type*

Types for STL compliance.

Definition at line 922 of file sortedPriorityQueue.h.

◆ reference

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
using gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::reference = value_type&

Types for STL compliance.

Definition at line 920 of file sortedPriorityQueue.h.

◆ TreeCmp

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
using gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::TreeCmp = typename SortedPriorityQueue< Val, Priority, Cmp >::TreeCmp

Types for STL compliance.

Definition at line 924 of file sortedPriorityQueue.h.

◆ value_type

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
using gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::value_type = Val

Types for STL compliance.

Definition at line 919 of file sortedPriorityQueue.h.

Constructor & Destructor Documentation

◆ SortedPriorityQueueReverseIteratorSafe() [1/3]

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::SortedPriorityQueueReverseIteratorSafe ( SortedPriorityQueue< Val, Priority, Cmp > & queue,
const bool rbegin = true )
explicit

constructor for rbegin safe iterators

Parameters
queuethe sorted priority queue which parses the iterator
beginif true, the iterator points to the lowest value in the queue, else it points to the highest value

◆ SortedPriorityQueueReverseIteratorSafe() [2/3]

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::SortedPriorityQueueReverseIteratorSafe ( const SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & from)

copy constructor

◆ SortedPriorityQueueReverseIteratorSafe() [3/3]

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::SortedPriorityQueueReverseIteratorSafe ( SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > && from)

move constructor

◆ ~SortedPriorityQueueReverseIteratorSafe()

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::~SortedPriorityQueueReverseIteratorSafe ( )
noexcept

destructor

Member Function Documentation

◆ operator!=()

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
bool gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::operator!= ( const SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & from) const

indicates whether two iterator point to different element

◆ operator*()

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
const_reference gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::operator* ( ) const

returns the value pointed to by the iterator

Returns
the value pointed to by the iterator, if the iterator actually points to an element
Exceptions
NotFoundis raised if the iterator points to nothing

◆ operator++()

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::operator++ ( )
noexcept

move to the next element in the queue

Warning
Applying this operator to an iterator equal to the rend iterator has no effect. In particular, it does not raise any exception.

◆ operator+=()

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::operator+= ( const Size k)
noexcept

move to the next k element

Warning
Applying this operator to an iterator equal to the rend iterator has no effect. In particular, it does not raise any exception.

◆ operator--()

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::operator-- ( )
noexcept

move to the preceding element in the queue

Warning
Applying this operator to an iterator equal to the rbegin iterator has no effect. In particular, it does not raise any exception.

◆ operator-=()

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::operator-= ( const Size k)
noexcept

move to the preceding k element

Warning
Applying this operator to an iterator equal to the rbegin iterator has no effect. In particular, it does not raise any exception.

◆ operator->()

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
const_pointer gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::operator-> ( ) const

returns a pointer on the value pointed to by the iterator

◆ operator=() [1/2]

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::operator= ( const SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & from)

copy operator

◆ operator=() [2/2]

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::operator= ( SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > && from)

move operator

◆ operator==()

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
bool gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::operator== ( const SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp > & from) const

indicates whether two iterator point to the same element

Member Data Documentation

◆ AVLTree< Val, Cmp >

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
friend gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::AVLTree< Val, Cmp >
protected

allow AVL trees to access the content of the iterators

Definition at line 1017 of file sortedPriorityQueue.h.

◆ SortedPriorityQueue< Val, Cmp >

template<typename Val, typename Priority = int, typename Cmp = std::less< Val >>
friend gum::SortedPriorityQueueReverseIteratorSafe< Val, Priority, Cmp >::SortedPriorityQueue< Val, Cmp >
protected

Definition at line 1018 of file sortedPriorityQueue.h.


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