Struct timeout_queue_t::const_iterator
Defined in File timeout_queue.hpp
Nested Relationships
This struct is a nested type of Template Class timeout_queue_t.
Struct Documentation
-
struct const_iterator
Const iterator that yields only non-expired elements in the queue.
Public Types
-
using base_iter = typename base_t::const_iterator
-
using iterator_category = std::forward_iterator_tag
-
using value_type = type
-
using reference = const type&
-
using pointer = const type*
Public Functions
-
const_iterator() = default
Default constructor.
-
inline const_iterator(const timeout_queue_t *o_, base_iter i_, base_iter e_)
Construct a const_iterator.
- Parameters:
o_ – Queue instance that owns this iterator.
i_ – Current list iterator position.
e_ – Sentinel iterator marking the end position.
-
inline const_iterator(const iterator &other_)
Allow converting iterator to const_iterator.
- Parameters:
other_ – Mutable iterator whose state is copied.
-
inline const_iterator &operator++()
Pre-increment operator.
-
inline const_iterator operator++(int int_)
Post-increment operator.
- Parameters:
int_ – Dummy integer used to select postfix increment syntax.
- Returns:
Iterator snapshot before incrementing.
Public Members
-
const timeout_queue_t *owner = nullptr
Pointer to the owning queue.
Private Functions
-
inline void __skip_expired()
Skip expired elements and collect them in timedOutItems.
Friends
-
inline friend bool operator==(const const_iterator &a_, const const_iterator &b_)
Equality comparison.
- Parameters:
a_ – Left iterator in the comparison.
b_ – Right iterator in the comparison.
- Returns:
truewhen both iterators point to the same list position.
-
inline friend bool operator!=(const const_iterator &a_, const const_iterator &b_)
Inequality comparison.
- Parameters:
a_ – Left iterator in the comparison.
b_ – Right iterator in the comparison.
- Returns:
truewhen iterators point to different list positions.
-
using base_iter = typename base_t::const_iterator