Go to the documentation of this file.
38 #ifndef __BASE_CIRCLEBUF_HH__
39 #define __BASE_CIRCLEBUF_HH__
76 template <
class OutputIterator>
77 void peek(OutputIterator out,
size_t len)
const {
88 template <
class OutputIterator>
91 "Trying to read past end of circular buffer.\n");
102 template <
class OutputIterator>
114 template <
class InputIterator>
123 std::copy(in, in +
len,
end());
155 template <
class OutputIterator>
157 template <
class OutputIterator>
160 template <
class InputIterator>
163 "Trying to overfill FIFO buffer.\n");
172 template <
typename T>
178 param.
peek(temp.begin(), temp.size());
182 template <
typename T>
191 param.
write(temp.cbegin(), temp.size());
194 template <
typename T>
200 param.
peek(temp.begin(), temp.size());
204 template <
typename T>
213 "Trying to unserialize data into too small FIFO\n");
216 param.
write(temp.cbegin(), temp.size());
219 #endif // __BASE_CIRCLEBUF_HH__
void advance_tail()
Increases the tail by one.
void peek(OutputIterator out, off_t offset, size_t len) const
Copy buffer contents without advancing the read pointer.
iterator begin()
Iterators.
void flush()
Remove all the elements in the queue.
void write(InputIterator in, size_t len)
void read(OutputIterator out, size_t len)
Simple FIFO implementation backed by a circular buffer.
void peek(OutputIterator out, size_t len) const
void arrayParamOut(CheckpointOut &cp, const std::string &name, const CircleBuf< T > ¶m)
const std::string & name()
void write(InputIterator in, size_t len)
Add elements to the end of the ring buffers and advance.
void pop_front(size_t num_elem=1)
Circularly increase the head pointer.
void peek(OutputIterator out, size_t len) const
Copy buffer contents without advancing the read pointer.
void read(OutputIterator out, size_t len)
Copy buffer contents and advance the read pointer.
bool empty() const
Is the queue empty?
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
std::ostream CheckpointOut
void arrayParamIn(CheckpointIn &cp, const std::string &name, CircleBuf< T > ¶m)
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Circular buffer backed by a vector though a CircularQueue.
CircleBuf< value_type > buf
Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17