General circular buffer class. More...
#include <itpp/base/circular_buffer.h>
Public Member Functions | |
Circular_Buffer () | |
Default constructor. | |
Circular_Buffer (int n) | |
Create a Circular_Buffer of size n . | |
Circular_Buffer (const Circular_Buffer< T > &s) | |
Create a copy of s . | |
virtual | ~Circular_Buffer () |
Default destructor. | |
void | put (const T &in) |
Write the element in to the buffer. | |
void | put (const Vec< T > &in) |
Write the vector of elements in to the circular buffer. | |
void | put (const Array< T > &in) |
Write the vector of elements in to the circular buffer. | |
void | get (T &out) |
Get the oldest element in the circular buffer. | |
T | get () |
Get the oldest element in the circular buffer. | |
void | get (Vec< T > &out, const int N=-1) |
Get the N oldest element in the circular buffer. N=-1 returns all elements in the buffer. | |
void | get (Array< T > &out, const int N=-1) |
Get the N oldest element in the circular buffer. N=-1 returns all elements in the buffer. | |
void | peek (T &out) const |
Peek at the oldest element in the circular buffer, without removing it. | |
T | peek () const |
Peek at the oldest element in the circular buffer, without removing it. | |
void | peek (const int index, T &out) const |
Peek at the element with index index in the circular buffer, without removing it. | |
void | peek (Vec< T > &out, const int N=-1) const |
Peek at the N first elements of the circular buffer, without removing them. N=-1 peeks all elements in the buffer. | |
void | peek (const ivec &index, Vec< T > &out) const |
Peek at the elements with index index in the circular buffer, without removing them. | |
void | peek (Array< T > &out, const int N=-1) const |
Peek at the N first elements of the circular buffer, without removing them. N=-1 peeks all elements in the buffer. | |
void | peek (const ivec &index, Array< T > &out) const |
Peek at the elements with index index in the circular buffer, without removing them. | |
void | peek_reverse (T &out) const |
Peek at the latest element in the circular buffer, without removing it. | |
T | peek_reverse () const |
Peek at the latest element in the circular buffer, without removing it. | |
void | peek_reverse (Vec< T > &out, const int N=-1) const |
Peek at the N latest elements of the circular buffer in reverse order, without removing them. N=-1 returns all elements in the buffer. | |
void | peek_reverse (Array< T > &out, const int N=-1) const |
Peek at the N latest elements of the circular buffer in reverse order, without removing them. N=-1 returns all elements in the buffer. | |
void | clear () |
Empty the circular buffer. | |
void | operator= (const Circular_Buffer< T > &s) |
Assignment operator. | |
int | size () const |
Returns the maximum number of data elements the circular buffer can store. | |
int | nrof_elements () const |
Returns the number of data elements currently stored in the circular buffer. | |
void | set_size (int n, bool copy=false) |
Resizing a Circular_Buffer<T>. | |
General circular buffer class.
This class is a general circular buffer class for arbitrary types.
For rarely used types you will need to instantiate the class by
The following example shows how to define a Circular_Buffer of doubles:
Definition at line 92 of file circular_buffer.h.
Generated on Sat May 25 2013 16:32:29 for IT++ by Doxygen 1.8.2