gem5
v20.1.0.0
|
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, uint32_t idx, uint32_t round) | |
iterator () | |
Trait reference type iterator satisfies OutputIterator, therefore reference must be T&. More... | |
iterator (const iterator &it) | |
iterator & | operator= (const iterator &it) |
~iterator () | |
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 |
iterator & | operator++ () |
Pre-increment operator. More... | |
iterator | operator++ (int) |
Post-increment operator. More... | |
iterator & | operator-- () |
Pre-decrement operator. More... | |
iterator | operator-- (int) |
Post-decrement operator. More... | |
iterator & | operator+= (const difference_type &t) |
RandomAccessIterator requirements. More... | |
iterator & | operator-= (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< std::is_integral< Idx >::value, reference >::type | operator[] (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 |
uint32_t | _idx |
uint32_t | _round |
Private Member Functions | |
bool | decrementable () const |
ForwardIterator The multipass guarantee is provided by the reliance on _idx. More... | |
Friends | |
iterator | operator+ (const difference_type &t, iterator &it) |
iterator | operator- (const difference_type &t, iterator &it) |
Iterator to the circular queue.
iterator implementation to provide the circular-ness that the standard std::vector<T>::iterator does not implement. Iterators to a queue are represented by a pair of a character and the round counter. For the character, '*' denotes the element pointed to by the iterator if it is valid. 'x' denotes the element pointed to by the iterator when it is BTB or PTE. E.g.:
Definition at line 155 of file circular_queue.hh.
|
inlineprivate |
ForwardIterator The multipass guarantee is provided by the reliance on _idx.
BidirectionalIterator requirements. Test decrementability. An iterator to a non-null circular queue is not-decrementable if it is pointing to the head element, unless the queue is full and we are talking about the past-the-end iterator. In that case, the iterator round equals the cq round unless the head is at the zero position and the round is one more than the cq round.
Definition at line 347 of file circular_queue.hh.
References CircularQueue< T >::iterator::_cq, CircularQueue< T >::iterator::_idx, CircularQueue< T >::_round, CircularQueue< T >::iterator::_round, CircularQueue< T >::empty(), and CircularQueue< T >::head().
Referenced by CircularQueue< T >::iterator::operator--().
|
inline |
OutputIterator has no extra requirements.
Definition at line 510 of file circular_queue.hh.
References CircularQueue< T >::iterator::_idx.
Referenced by LSQUnit< Impl >::completeStore(), and LSQUnit< Impl >::writebackStores().
CircularQueue* CircularQueue< T >::iterator::_cq |
Definition at line 156 of file circular_queue.hh.
Referenced by CircularQueue< T >::iterator::decrementable(), CircularQueue< T >::iterator::dereferenceable(), CircularQueue< T >::iterator::operator*(), CircularQueue< T >::iterator::operator++(), CircularQueue< T >::iterator::operator+=(), CircularQueue< T >::iterator::operator-(), CircularQueue< T >::iterator::operator--(), CircularQueue< T >::iterator::operator-=(), CircularQueue< T >::iterator::operator<(), CircularQueue< T >::iterator::operator=(), CircularQueue< T >::iterator::operator==(), and CircularQueue< T >::iterator::~iterator().
uint32_t CircularQueue< T >::iterator::_idx |
Definition at line 157 of file circular_queue.hh.
Referenced by CircularQueue< T >::iterator::decrementable(), CircularQueue< T >::iterator::dereferenceable(), CircularQueue< T >::iterator::idx(), CircularQueue< T >::iterator::operator*(), CircularQueue< T >::iterator::operator++(), CircularQueue< T >::iterator::operator+=(), CircularQueue< T >::iterator::operator-(), CircularQueue< T >::iterator::operator--(), CircularQueue< T >::iterator::operator-=(), CircularQueue< T >::iterator::operator->(), CircularQueue< T >::iterator::operator<(), CircularQueue< T >::iterator::operator=(), CircularQueue< T >::iterator::operator==(), and CircularQueue< T >::iterator::~iterator().
uint32_t CircularQueue< T >::iterator::_round |
Definition at line 158 of file circular_queue.hh.
Referenced by CircularQueue< T >::iterator::decrementable(), CircularQueue< T >::iterator::dereferenceable(), CircularQueue< T >::iterator::operator++(), CircularQueue< T >::iterator::operator+=(), CircularQueue< T >::iterator::operator-(), CircularQueue< T >::iterator::operator--(), CircularQueue< T >::iterator::operator-=(), CircularQueue< T >::iterator::operator<(), CircularQueue< T >::iterator::operator=(), CircularQueue< T >::iterator::operator==(), and CircularQueue< T >::iterator::~iterator().