Sunshine master
Self-hosted game stream host for Moonlight.
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 >:
[legend]
Collaboration diagram for round_robin_util::round_robin_t< V, It >:
[legend]

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.
 
typedef std::ptrdiff_t diff_t
 Signed offset type used when moving through the range.
 
using difference_type
 Difference type used for iterator movement.
 
typedef round_robin_t< V, It > 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.
 
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.
 
const_reference operator* () const
 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++ (int)
 Advance to the next element and return the previous iterator position.
 
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.
 
diff_t operator- (iterator first)
 Count wrapped increments needed to reach this iterator from another one.
 
iterator operator-- ()
 Move to the previous element, wrapping to the end when needed.
 
iterator operator-- (int)
 Move to the previous element and return the previous iterator position.
 
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.
 
const_pointer operator-> () const
 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, class 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 , class 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 , class 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 or container to compare against.
Returns
True when both iterators point to equivalent values.

◆ get()

template<class V , class 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.

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