![]() |
L4Re Operating System Framework
Interface and Usage Documentation
|
Ring buffer. More...
#include <ring_buffer>
Static Public Member Functions | |
| static void | check_items (size_t const items) |
| Check that the number of items is a power of two. | |
| static void | check_mask (size_t const mask) |
| Check that the item mask is a power of two minus one. | |
Static Public Attributes | |
| static constexpr Sequence const | nil = 0U |
| Invalid (non-committed) items set their sequence counter to 0. | |
Ring buffer.
Base class of all ring buffer objects. Not directly usable by the user.
| SEQUENCE_TYPE | Numerical type for storing sequence and generation counters. Must be suitable for atomic access. |
Definition at line 66 of file ring_buffer.
|
inlinestatic |
Check that the number of items is a power of two.
This ring buffer implementation supports a non-zero power of two number of items.
| items | Number of items. |
| std::invalid_argument | If the number of items is zero or not a power of two. |
Definition at line 86 of file ring_buffer.
Referenced by utrace::Ring_buffer_producer< SEQUENCE_TYPE, ITEM_TYPE, GENERATION_PTR >::Ring_buffer_producer().
|
inlinestatic |
Check that the item mask is a power of two minus one.
This ring buffer implementation uses the bitwise AND for implementing a modulo operation with the number of items. Thus the item mask must be a power of two minus one.
| mask | Item mask. |
| td::length_error | If the item mask is not a power of two minus one. |
Definition at line 106 of file ring_buffer.
Referenced by utrace::Ring_buffer_consumer_raw< Sequence, Item, GENERATION_PTR >::Ring_buffer_consumer_raw().