• Home
  • Raw
  • Download

Lines Matching refs:RingBuffer

31  * A RingBuffer class that maintains an array of objects that can grow up to a certain size.
32 * Elements added to the RingBuffer are inserted in the logical front of the buffer, and
33 * invalidate all current iterators for that RingBuffer object.
36 class RingBuffer final {
40 * Construct a RingBuffer that can grow up to the given length.
42 explicit RingBuffer(size_t length);
97 * Adds item to the front of this RingBuffer. If the RingBuffer is at its maximum length,
106 * Moves item to the front of this RingBuffer. Following a call to this, item should no
107 * longer be used. If the RingBuffer is at its maximum length, this will result in the
115 * Construct item in-place in the front of this RingBuffer using the given arguments. If
116 * the RingBuffer is at its maximum length, this will result in the last element being
125 * Get an iterator to the front of this RingBuffer.
130 * Get an iterator to the end of this RingBuffer.
135 * Get a const_iterator to the front of this RingBuffer.
140 * Get a const_iterator to the end of this RingBuffer.
157 * Return the current size of this RingBuffer.
162 * Remove all elements from this RingBuffer and set the size to 0.
170 }; // class RingBuffer
174 RingBuffer<T>::RingBuffer(size_t length) : mFrontIdx{0}, mMaxBufferSize{length} {}
177 RingBuffer<T>::iterator::iterator(T* ptr, size_t size, size_t pos, size_t ctr) :
181 typename RingBuffer<T>::iterator& RingBuffer<T>::iterator::operator++() {
194 typename RingBuffer<T>::iterator RingBuffer<T>::iterator::operator++(int) {
201 bool RingBuffer<T>::iterator::operator==(const iterator& rhs) {
206 bool RingBuffer<T>::iterator::operator!=(const iterator& rhs) {
211 T& RingBuffer<T>::iterator::operator*() {
216 T* RingBuffer<T>::iterator::operator->() {
221 RingBuffer<T>::const_iterator::const_iterator(const T* ptr, size_t size, size_t pos, size_t ctr) :
225 typename RingBuffer<T>::const_iterator& RingBuffer<T>::const_iterator::operator++() {
238 typename RingBuffer<T>::const_iterator RingBuffer<T>::const_iterator::operator++(int) {
245 bool RingBuffer<T>::const_iterator::operator==(const const_iterator& rhs) {
250 bool RingBuffer<T>::const_iterator::operator!=(const const_iterator& rhs) {
255 const T& RingBuffer<T>::const_iterator::operator*() {
260 const T* RingBuffer<T>::const_iterator::operator->() {
265 void RingBuffer<T>::add(const T& item) {
277 void RingBuffer<T>::add(T&& item) {
291 void RingBuffer<T>::emplace(Args&&... args) {
304 typename RingBuffer<T>::iterator RingBuffer<T>::begin() {
310 typename RingBuffer<T>::iterator RingBuffer<T>::end() {
316 typename RingBuffer<T>::const_iterator RingBuffer<T>::begin() const {
323 typename RingBuffer<T>::const_iterator RingBuffer<T>::end() const {
329 T& RingBuffer<T>::operator[](size_t index) {
338 const T& RingBuffer<T>::operator[](size_t index) const {
347 size_t RingBuffer<T>::size() const {
352 void RingBuffer<T>::clear() {