gem5  v21.1.0.2
Public Member Functions | Public Attributes | Friends | List of all members
gem5::CircularQueue< T >::iterator Struct Reference

Iterator to the circular queue. More...

#include <circular_queue.hh>

Public Types

using value_type = T
 Iterator Traits. More...
 
using difference_type = std::ptrdiff_t
 
using reference = value_type &
 
using const_reference = const value_type &
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
using iterator_category = std::random_access_iterator_tag
 

Public Member Functions

 iterator (CircularQueue *cq, size_t idx)
 
 iterator ()=default
 
 iterator (const iterator &it)
 Trait reference type iterator satisfies OutputIterator, therefore reference must be T&. More...
 
iteratoroperator= (const iterator &it)
 
bool dereferenceable () const
 Test dereferenceability. More...
 
bool operator== (const iterator &that) const
 InputIterator. More...
 
bool operator!= (const iterator &that)
 Inequality operator. More...
 
reference operator* ()
 Dereference operator. More...
 
const_reference operator* () const
 
pointer operator-> ()
 Dereference operator. More...
 
const_pointer operator-> () const
 
iteratoroperator++ ()
 Pre-increment operator. More...
 
iterator operator++ (int)
 Post-increment operator. More...
 
iteratoroperator-- ()
 ForwardIterator The multipass guarantee is provided by the reliance on _idx. More...
 
iterator operator-- (int)
 Post-decrement operator. More...
 
iteratoroperator+= (const difference_type &t)
 RandomAccessIterator requirements. More...
 
iteratoroperator-= (const difference_type &t)
 
iterator operator+ (const difference_type &t)
 Addition operator. More...
 
iterator operator- (const difference_type &t)
 Substraction operator. More...
 
difference_type operator- (const iterator &that)
 Difference operator. More...
 
template<typename Idx >
std::enable_if_t< std::is_integral< Idx >::value, referenceoperator[] (const Idx &index)
 Index operator. More...
 
bool operator< (const iterator &that) const
 Comparisons. More...
 
bool operator> (const iterator &that) const
 
bool operator>= (const iterator &that) const
 
bool operator<= (const iterator &that) const
 
size_t idx () const
 OutputIterator has no extra requirements. More...
 

Public Attributes

CircularQueue_cq = nullptr
 
size_t _idx = 0
 

Friends

iterator operator+ (const difference_type &t, iterator &it)
 
iterator operator- (const difference_type &t, iterator &it)
 

Detailed Description

template<typename T>
struct gem5::CircularQueue< T >::iterator

Iterator to the circular queue.

iterator implementation to provide wrap around indexing which the vector iterator does not.

Definition at line 85 of file circular_queue.hh.

Constructor & Destructor Documentation

◆ iterator()

template<typename T >
gem5::CircularQueue< T >::iterator::iterator ( )
default

Member Function Documentation

◆ idx()

template<typename T >
size_t gem5::CircularQueue< T >::iterator::idx ( ) const
inline

OutputIterator has no extra requirements.

Definition at line 386 of file circular_queue.hh.

References gem5::CircularQueue< T >::iterator::_idx.

Member Data Documentation

◆ _cq

template<typename T >
CircularQueue* gem5::CircularQueue< T >::iterator::_cq = nullptr

◆ _idx

template<typename T >
size_t gem5::CircularQueue< T >::iterator::_idx = 0

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

Generated on Tue Sep 21 2021 12:27:23 for gem5 by doxygen 1.8.17