Classes | Public Member Functions | List of all members
spore::CircularBuffer< T > Class Template Reference

An iterable circular buffer. More...

#include <circular_buffer.h>

Classes

class  const_iterator
 Constant iterator class. More...
 

Public Member Functions

 CircularBuffer ()
 
 CircularBuffer (const CircularBuffer &src)
 
 ~CircularBuffer ()
 
void resize (size_t new_size, T v)
 
T & operator[] (size_t at)
 
const_iterator get (size_t at) const
 
size_t size () const
 

Detailed Description

template<typename T>
class spore::CircularBuffer< T >

An iterable circular buffer.

This class provides the buffer that is used by TracingNode to hold traces.

Note
resize erases all values and sets the whole vector to defaults.

Constructor & Destructor Documentation

◆ CircularBuffer() [1/2]

template<typename T >
spore::CircularBuffer< T >::CircularBuffer ( )
inline

Default constructor.

◆ CircularBuffer() [2/2]

template<typename T >
spore::CircularBuffer< T >::CircularBuffer ( const CircularBuffer< T > &  src)
inline

Copy constructor.

◆ ~CircularBuffer()

template<typename T >
spore::CircularBuffer< T >::~CircularBuffer ( )
inline

Destructor.

Member Function Documentation

◆ get()

template<typename T >
const_iterator spore::CircularBuffer< T >::get ( size_t  at) const
inline

Returns a constant iterator to read from the buffer at the given location. Location index wraps around at the limits of the buffer.

◆ operator[]()

template<typename T >
T& spore::CircularBuffer< T >::operator[] ( size_t  at)
inline

Returns the value of the buffer at the given location. Location index wraps around at the limits of the buffer.

◆ resize()

template<typename T >
void spore::CircularBuffer< T >::resize ( size_t  new_size,
v 
)
inline

Change the size of the buffer to new value. All its content gets overwritten with v.

◆ size()

template<typename T >
size_t spore::CircularBuffer< T >::size ( ) const
inline

Returns the current size of the buffer.


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