Go to the documentation of this file.
38 #ifndef __BASE_CIRCULAR_QUEUE_HH__
39 #define __BASE_CIRCULAR_QUEUE_HH__
45 #include <type_traits>
112 static_assert(std::is_same<reference, T&>::value,
113 "reference type is not assignable as required");
338 return (ssize_t)
_idx - (ssize_t)that.
_idx;
347 template<
typename Idx>
348 typename std::enable_if_t<std::is_integral<Idx>::value,
reference>
351 return *(*
this +
index);
390 template <
typename Idx>
391 typename std::enable_if_t<std::is_integral<Idx>::value,
reference>
398 template <
typename Idx>
399 typename std::enable_if_t<std::is_integral<Idx>::value,
const_reference>
476 assert(num_elem <=
size());
532 if (
len > remaining) {
577 iterator
end() {
return iterator(
this,
tail() + 1); }
pointer operator->()
Dereference operator.
std::ptrdiff_t difference_type
const value_type & const_reference
void advance_tail()
Increases the tail by one.
bool dereferenceable() const
Test dereferenceability.
iterator operator+(const difference_type &t)
Addition operator.
difference_type operator-(const iterator &that)
Difference operator.
friend iterator operator+(const difference_type &t, iterator &it)
iterator getIterator(size_t idx)
Return an iterator to an index in the queue.
iterator operator++(int)
Post-increment operator.
iterator & operator--()
ForwardIterator The multipass guarantee is provided by the reliance on _idx.
const_reference operator*() const
std::enable_if_t< std::is_integral< Idx >::value, reference > operator[](const Idx &index)
Index operator.
T value_type
Iterator Traits.
static void overflow(double &c, const scfx_params ¶ms, bool &o_flag)
void pop_back()
Circularly decrease the tail pointer.
iterator operator-(const difference_type &t)
Substraction operator.
iterator begin()
Iterators.
void flush()
Remove all the elements in the queue.
Iterator to the circular queue.
iterator & operator++()
Pre-increment operator.
bool full() const
Is the queue full? A queue is full if the head is the 0^{th} element and the tail is the (size-1)^{th...
void advance_tail(size_t len)
Increases the tail by a specified number of steps.
bool operator>(const iterator &that) const
iterator & operator+=(const difference_type &t)
RandomAccessIterator requirements.
const value_type * const_pointer
iterator(CircularQueue *cq, size_t idx)
iterator operator--(int)
Post-decrement operator.
iterator(const iterator &it)
Trait reference type iterator satisfies OutputIterator, therefore reference must be T&.
size_t idx() const
OutputIterator has no extra requirements.
void push_back(typename std::vector< T >::value_type val)
Pushes an element at the end of the queue.
std::enable_if_t< std::is_integral< Idx >::value, reference > operator[](const Idx &index)
iterator & operator-=(const difference_type &t)
bool operator>=(const iterator &that) const
void pop_front(size_t num_elem=1)
Circularly increase the head pointer.
bool operator<=(const iterator &that) const
bool operator<(const iterator &that) const
Comparisons.
reference operator*()
Dereference operator.
bool empty() const
Is the queue empty?
friend iterator operator-(const difference_type &t, iterator &it)
std::random_access_iterator_tag iterator_category
bool operator==(const iterator &that) const
InputIterator.
bool operator!=(const iterator &that)
Inequality operator.
typename std::vector< Prefetcher::STeMS::RegionMissOrderBufferEntry >::reference reference
const_pointer operator->() const
iterator & operator=(const iterator &it)
bool isValidIdx(size_t idx) const
Test if the index is in the range of valid elements.
typename std::vector< Prefetcher::STeMS::RegionMissOrderBufferEntry >::const_reference const_reference
CircularQueue(size_t size=0)
std::enable_if_t< std::is_integral< Idx >::value, const_reference > operator[](const Idx &index) const
Generated on Tue Jun 22 2021 15:28:25 for gem5 by doxygen 1.8.17