Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Random_Set< T >::Iterator Struct Reference

Iterator of the items of the queue. More...

#include <tpl_random_queue.H>

Inheritance diagram for Aleph::Random_Set< T >::Iterator:
[legend]
Collaboration diagram for Aleph::Random_Set< T >::Iterator:
[legend]

Public Types

using Base = typename DynArray< T >::Iterator
 
- Public Types inherited from Aleph::DynArray< T >::Iterator
using Set_Type = DynArray
 
using aleph_random_access_iterator = Iterator
 Opt-in marker for StlIterator random-access promotion.
 

Public Member Functions

 Iterator () noexcept=default
 Default constructor creates an "end" iterator.
 
 Iterator (Random_Set &q) noexcept
 Iterator on a modifiable queue.
 
 Iterator (const Random_Set &)=delete
 A constant set is iterated through Const_Iterator.
 
- Public Member Functions inherited from Aleph::DynArray< T >::Iterator
 Iterator () noexcept=default
 Default constructor creates an "end" iterator.
 
 Iterator (DynArray &array) noexcept
 Iterator on a modifiable array.
 
bool has_curr () const noexcept
 Check whether the iterator refers to an item.
 
bool is_last () const noexcept
 Check whether the current item is the last item.
 
T & get_curr_ne () const
 Return the current item without checking the position.
 
T & get_curr () const
 Return the current item.
 
long get_pos () const noexcept
 Return the ordinal position of current item.
 
void next_ne () noexcept
 Move the iterator one position forward guaranteeing no exception.
 
void next ()
 Advance one position, from the last item to the end if needed.
 
void prev_ne () noexcept
 Move the iterator one position backward guaranteeing no exception.
 
void prev ()
 Move the current a position backward.
 
void reset_last () noexcept
 Reset the iterator to the last item.
 
void end () noexcept
 Put the iterator in the end state.
 
void reset_first () noexcept
 Reset the iterator to the first item.
 
void set_pos (const long pos) noexcept
 Put the iterator on position pos, without checking it.
 

Additional Inherited Members

- Protected Member Functions inherited from Aleph::DynArray< T >::Iterator
 Iterator (const DynArray &array) noexcept
 Iterator on a constant array; it never allocates.
 
- Protected Attributes inherited from Aleph::DynArray< T >::Iterator
DynArray * array_ptr = nullptr
 
long curr_idx = 0
 
bool modifiable = false
 built on a modifiable array: reading an unwritten entry allocates it
 

Detailed Description

template<class T>
struct Aleph::Random_Set< T >::Iterator

Iterator of the items of the queue.

The order will be random if the insertion were performed with append(): otherwise, the order will be the same that the put order.

Definition at line 349 of file tpl_random_queue.H.

Member Typedef Documentation

◆ Base

template<class T >
using Aleph::Random_Set< T >::Iterator::Base = typename DynArray<T>::Iterator

Definition at line 351 of file tpl_random_queue.H.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

template<class T >
Aleph::Random_Set< T >::Iterator::Iterator ( )
defaultnoexcept

Default constructor creates an "end" iterator.

◆ Iterator() [2/3]

template<class T >
Aleph::Random_Set< T >::Iterator::Iterator ( Random_Set &  q)
inlinenoexcept

Iterator on a modifiable queue.

Parameters
[in]qqueue to iterate.

Definition at line 359 of file tpl_random_queue.H.

◆ Iterator() [3/3]

template<class T >
Aleph::Random_Set< T >::Iterator::Iterator ( const Random_Set &  )
delete

A constant set is iterated through Const_Iterator.


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