Loading...
Searching...
No Matches
etl::icircular_buffer< T > Class Template Reference

## Classes

class | iterator
| Iterator iterating through the circular buffer. More...
class | const_iterator
| Iterator iterating through the circular buffer. More...

## Public Types

typedef T | value_type
typedef T & | reference
typedef const T & | const_reference
typedef T * | pointer
typedef const T * | const_pointer
typedef etl::iterator_traits< pointer >::difference_type | difference_type
typedef etl::reverse_iterator< iterator > | reverse_iterator
typedef etl::reverse_iterator< const_iterator > | const_reverse_iterator
Public Types inherited from etl::circular_buffer_base
typedef size_t | size_type
| The type used for determining the size of queue.

## Public Member Functions

iterator | begin ()
| Gets an iterator to the start of the buffer.
const_iterator | begin () const
| Gets a const iterator to the start of the buffer.
const_iterator | cbegin () const
| Gets a const iterator to the start of the buffer.
iterator | end ()
| Gets an iterator to the end of the buffer.
const_iterator | end () const
| Gets a const iterator to the end of the buffer.
const_iterator | cend () const
| Gets a const iterator to the end of the buffer.
reverse_iterator | rbegin ()
| Gets a reverse iterator to the start of the buffer.
const_reverse_iterator | rbegin () const
| Gets a const reverse iterator to the start of the buffer.
const_reverse_iterator | crbegin () const
| Gets a const reverse iterator to the start of the buffer.
reverse_iterator | rend ()
| Gets a reverse iterator to the end of the buffer.
const_reverse_iterator | rend () const
| Gets a const reverse iterator to the end of the buffer.
const_reverse_iterator | crend () const
| Gets a const reverse iterator to the end of the buffer.
reference | front ()
const_reference | front () const
reference | back ()
const_reference | back () const
reference | operator[] (size_t index)
| Get a reference to the item.
const_reference | operator[] (size_t index) const
void | push (const_reference item)
template<typename TIterator>
void | push (TIterator first, const TIterator &last)
| Push a buffer from an iterator range.
void | pop ()
| pop
void | pop (size_type n)
| pop(n)
void | clear ()
| Clears the buffer.
void | fill (const T &value)
| Fills the buffer.
Public Member Functions inherited from etl::circular_buffer_base
size_type | size () const
bool | empty () const
bool | full () const
size_type | available () const
size_type | max_size () const
size_type | capacity () const

## Protected Member Functions

| icircular_buffer (pointer pbuffer_, size_type max_length)
| Protected constructor.
void | repair_buffer (T *pbuffer_)
| Fix the internal pointers after a low level memory copy.
| ~icircular_buffer ()
| Destructor.
Protected Member Functions inherited from etl::circular_buffer_base
| circular_buffer_base (size_type buffer_size_)
void | increment_in ()
void | increment_out ()

## Static Protected Member Functions

template<typename TIterator1, typename TIterator2>
static difference_type | distance (const TIterator1 &range_begin, const TIterator2 &range_end)
| Measures the distance between two iterators.
template<typename TIterator>
static difference_type | distance (const TIterator &other)

## Protected Attributes

pointer | pbuffer
Protected Attributes inherited from etl::circular_buffer_base
size_type | buffer_size
size_type | in
| Index to the next write.
size_type | out
| Index to the next read.
| ETL_DECLARE_DEBUG_COUNT
| Internal debugging.

## Friends

class | iterator
class | const_iterator
difference_type | operator- (const iterator &lhs, const iterator &rhs)
difference_type | operator- (const const_iterator &lhs, const const_iterator &rhs)

## Member Function Documentation

## back() [1/2]

template<typename T>

reference etl::icircular_buffer< T >::back | ( |  | ) |

inline

Get a reference to the item at the back of the buffer. Asserts an error if the buffer is empty.

## back() [2/2]

template<typename T>

const_reference etl::icircular_buffer< T >::back | ( |  | ) | const

inline

Get a const reference to the item at the back of the buffer. Asserts an error if the buffer is empty.

## distance()

template<typename T>
template<typename TIterator>

difference_type etl::icircular_buffer< T >::distance | ( | const TIterator & | other | ) |

inline static protected

Measures the distance from the _begin iterator to the specified iterator.

## front() [1/2]

template<typename T>

reference etl::icircular_buffer< T >::front | ( |  | ) |

inline

Get a const reference to the item at the front of the buffer. Asserts an error if the buffer is empty.

## front() [2/2]

template<typename T>

const_reference etl::icircular_buffer< T >::front | ( |  | ) | const

inline

Get a const reference to the item at the front of the buffer. Asserts an error if the buffer is empty.

## operator[]()

template<typename T>

const_reference etl::icircular_buffer< T >::operator[] | ( | size_t | index | ) | const

inline

Get a const reference to the item at the back of the buffer. Asserts an error if the buffer is empty.

## push()

template<typename T>

void etl::icircular_buffer< T >::push | ( | const_reference | item | ) |

inline

push. Adds an item to the buffer. If the buffer is filled then the oldest item is overwritten.

## Friends And Related Symbol Documentation

## operator- [1/2]

template<typename T>

difference_type operator- | ( | const const_iterator & | lhs,
|  | const const_iterator & | rhs )

friend

- operator for const_iterator

## operator- [2/2]

template<typename T>

difference_type operator- | ( | const iterator & | lhs,
|  | const iterator & | rhs )

friend

- operator for iterator

The documentation for this class was generated from the following file:

- include/etl/circular_buffer.h