The circular buffer container class (::picolibrary::Circular_Buffer
) is defined in the
include/picolibrary/circular_buffer.h
/source/picolibrary/circular_buffer.cc
header/source file pair.
The ::picolibrary::Circular_Buffer_Use_Case
enum class defines the supported circular
buffer use cases and is used to select the associated circular buffer implementation.
The following use cases are supported (these use cases assume that interrupts that
interact with a circular buffer cannot be interrupted by other interrupts that also
interact with the circular buffer):
::picolibrary::Circular_Buffer_Use_Case::MAIN_READS_MAIN_WRITES
:
The main thread of execution reads from and write to the circular buffer.
Interrupts do not interact with the circular buffer.::picolibrary::Circular_Buffer_Use_Case::MAIN_READS_INTERRUPTS_WRITE
:
The main thread of execution reads from the circular buffer.
One or more interrupts write to the circular buffer.::picolibrary::Circular_Buffer_Use_Case::INTERRUPT_READS_MAIN_WRITES
:
An interrupt reads from the circular buffer.
Other interrupts do not interact with the circular buffer.
The main thread of execution writes to the circular buffer.::picolibrary::Circular_Buffer_Use_Case::INTERRUPT_READS_INTERRUPTS_WRITE
:
An interrupt reads from the circular buffer.
One or more other interrupts write to the circular buffer.
The main thread of execution does not interrupt with the circular buffer.::picolibrary::Circular_Buffer
supports the following operations:
::picolibrary::Circular_Buffer::front()
member functions.::picolibrary::Circular_Buffer::front_from_interrupt()
member functions.::picolibrary::Circular_Buffer::back()
member functions.::picolibrary::Circular_Buffer::back_from_interrupt()
member function.::picolibrary::Circular_Buffer::empty()
member function.::picolibrary::Circular_Buffer::empty_from_interrupt()
member function.::picolibrary::Circular_Buffer::full()
member function.::picolibrary::Circular_Buffer::full_from_interrupt()
member function.::picolibrary::Circular_Buffer::size()
member function.::picolibrary::Circular_Buffer::size_from_interrupt()
member function.::picolibrary::Circular_Buffer::max_size()
member
function.::picolibrary::Circular_Buffer::max_size_from_interrupt()
member
function.::picolibrary::Circular_Buffer::push()
member functions.::picolibrary::Circular_Buffer::push_from_interrupt()
member functions.::picolibrary::Circular_Buffer::emplace()
member functions.::picolibrary::Circular_Buffer::emplace_from_interrupt()
member functions.::picolibrary::Circular_Buffer::pop()
member function.::picolibrary::Circular_Buffer::pop_from_interrupt()
member function.::picolibrary::Circular_Buffer::clear()
member function.::picolibrary::Circular_Buffer::clear_from_interrupt()
member function.