REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
msg::ring_buffer< T > Class Template Reference

Poor man's ring buffer based on a STL list. More...

#include <jsonl_logging.h>

Public Member Functions

const std::list< T > & data () const
 Read-only access to the underlying data structure.
 
 ring_buffer (int max_size)
 
void push_back (T item)
 
void clear ()
 

Public Attributes

size_t max_size
 Maximum number of elements to hold.
 

Detailed Description

template<typename T>
class msg::ring_buffer< T >

Poor man's ring buffer based on a STL list.

Definition at line 19 of file jsonl_logging.h.

Constructor & Destructor Documentation

◆ ring_buffer()

template<typename T >
msg::ring_buffer< T >::ring_buffer ( int max_size)
inline

Definition at line 28 of file jsonl_logging.h.

Member Function Documentation

◆ clear()

template<typename T >
void msg::ring_buffer< T >::clear ( )
inline

Definition at line 36 of file jsonl_logging.h.

Referenced by msg::StartupLog::disable().

◆ data()

template<typename T >
const std::list< T > & msg::ring_buffer< T >::data ( ) const
inline

Read-only access to the underlying data structure.

Definition at line 24 of file jsonl_logging.h.

◆ push_back()

template<typename T >
void msg::ring_buffer< T >::push_back ( T item)
inline

Definition at line 30 of file jsonl_logging.h.

References msg::ring_buffer< T >::max_size.

Referenced by msg::StartupLog::write().

Member Data Documentation

◆ max_size

template<typename T >
size_t msg::ring_buffer< T >::max_size

Maximum number of elements to hold.

Definition at line 26 of file jsonl_logging.h.

Referenced by msg::StartupLog::disable(), msg::StartupLog::is_active(), and msg::ring_buffer< T >::push_back().


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