Ring buffer control structure.

Manages a circular buffer of log events. The ring buffer provides efficient storage for log events with automatic wraparound when full. Newer events overwrite older ones when the buffer capacity is exceeded.

Note

  • This structure is designed for single-producer, single-consumer access patterns typical in logging systems.

Public Attributes#

uint32_t

Index where the next event will be written (0 to no_of_events-1)

uint32_t

Index of the oldest unread event (0 to no_of_events-1)

uint32_t

Current number of events stored in buffer (0 to no_of_events)

int32_t

Number of available event slots left in the buffer.

sl_log_event_t *

Pointer to the actual ring buffer storage array.

Public Attribute Documentation#

write_index#

uint32_t sl_log_ring_buffer_t::write_index

Index where the next event will be written (0 to no_of_events-1)


read_index#

uint32_t sl_log_ring_buffer_t::read_index

Index of the oldest unread event (0 to no_of_events-1)


event_count#

uint32_t sl_log_ring_buffer_t::event_count

Current number of events stored in buffer (0 to no_of_events)


available_event_slots#

int32_t sl_log_ring_buffer_t::available_event_slots

Number of available event slots left in the buffer.


buffer#

sl_log_event_t* sl_log_ring_buffer_t::buffer

Pointer to the actual ring buffer storage array.