Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
round_robin_util::round_robin_t< V, It > Class Template Reference

Iterator that cycles indefinitely over a fixed begin/end range. More...

#include <src/round_robin.h>

Inheritance diagram for round_robin_util::round_robin_t< V, It >:
Collaboration diagram for round_robin_util::round_robin_t< V, It >:

Public Types

using iterator = It
 Underlying iterator type for the cycled range.
using pointer = V *
 Mutable pointer to values in the cycled range.
Public Types inherited from round_robin_util::it_wrap_t< V, round_robin_t< V, It > >
using const_pointer
 Const pointer to a value in the cycled range.
using const_reference
 Const reference to a value in the cycled range.
using diff_t
 Signed offset type used when moving through the range.
using difference_type
 Difference type used for iterator movement.
using iterator
 Concrete iterator type supplied by the CRTP child.
using iterator_category
 Iterator category advertised to standard algorithms.
using pointer
 Mutable pointer to a value in the cycled range.
using reference
 Mutable reference to a value in the cycled range.
using value_type
 Value type exposed by the wrapped iterator.

Public Member Functions

void dec ()
 Move the iterator to the previous element.
bool eq (const round_robin_t &other) const
 Compare two iterators for equality.
pointer get () const
 Return the currently wrapped value or handle.
bool gt (const round_robin_t &other) const
 Compare two iterators by their positions in the wrapped range.
void inc ()
 Advance the iterator to the next element.
 round_robin_t (iterator begin, iterator end)
 Construct a round-robin iterator over a fixed range.
Public Member Functions inherited from round_robin_util::it_wrap_t< V, round_robin_t< V, It > >
bool operator!= (const iterator &other) const
 Compare whether two wrapped iterator positions differ.
reference operator* ()
 Dereference the current element in the cycled range.
iterator operator+ (diff_t step)
 Return a copy advanced by a wrapped offset.
iterator operator++ ()
 Advance to the next element, wrapping back to the beginning when needed.
iterator operator+= (diff_t step)
 Advance this iterator by repeatedly wrapping at the end of the range.
iterator operator- (diff_t step)
 Return a copy moved backward by a wrapped offset.
iterator operator-- ()
 Move to the previous element, wrapping to the end when needed.
iterator operator-= (diff_t step)
 Move this iterator backward by repeatedly wrapping at the beginning of the range.
pointer operator-> ()
 Access the current element in the cycled range.
bool operator< (const iterator &other) const
 Compare whether this wrapped position sorts before another one.
bool operator<= (const iterator &other) const
 Compare whether this wrapped position sorts at or before another one.
bool operator== (const iterator &other) const
 Compare whether two wrapped iterator positions are equal.
bool operator> (const iterator &other) const
 Compare whether this wrapped position sorts after another one.
bool operator>= (const iterator &other) const
 Compare whether this wrapped position sorts at or after another one.

Detailed Description

template<class V, std::random_access_iterator It>
class round_robin_util::round_robin_t< V, It >

Iterator that cycles indefinitely over a fixed begin/end range.

Constructor & Destructor Documentation

◆ round_robin_t()

template<class V, std::random_access_iterator It>
round_robin_util::round_robin_t< V, It >::round_robin_t ( iterator begin,
iterator end )
inline

Construct a round-robin iterator over a fixed range.

Parameters
beginFirst element in the range to cycle through.
endOne-past-the-end iterator for the range to cycle through.

Member Function Documentation

◆ eq()

template<class V, std::random_access_iterator It>
bool round_robin_util::round_robin_t< V, It >::eq ( const round_robin_t< V, It > & other) const
inline

Compare two iterators for equality.

Parameters
otherIterator to compare against.
Returns
True when both iterators refer to the same position.

◆ get()

template<class V, std::random_access_iterator It>
pointer round_robin_util::round_robin_t< V, It >::get ( ) const
inline

Return the currently wrapped value or handle.

Returns
Underlying native handle or object pointer.

◆ gt()

template<class V, std::random_access_iterator It>
bool round_robin_util::round_robin_t< V, It >::gt ( const round_robin_t< V, It > & other) const
inline

Compare two iterators by their positions in the wrapped range.

Parameters
otherIterator to compare against.
Returns
True when this iterator follows other in the wrapped range.

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