WriteBuffer Class Template
Write-only buffer for accumulating messages in a double-buffered system. More...
Declaration
Friends Index
template <typename T> | |
| class | ReadWriteDoubleBuffer< T > |
Public Member Functions Index
template <typename... Args> | |
| WriteBuffer & | push (Args &&... args) |
|
Constructs and appends a message to the buffer. More... | |
template <typename T> | |
| WriteBuffer & | reserve (size_t size) |
|
Pre-allocates memory for the specified number of messages. More... | |
template <typename T> | |
| WriteBuffer & | clear () |
|
Removes all messages from the buffer. More... | |
Private Member Functions Index
template <typename T> | |
| auto | bufferData () -> std::vector< T > & |
|
Returns a mutable reference to the internal buffer. More... | |
Private Member Attributes Index
template <typename T> | |
| std::vector< T > | bufferData_ |
|
Internal storage for buffered messages. More... | |
Description
Write-only buffer for accumulating messages in a double-buffered system.
WriteBuffer is the producer-side of a double-buffered message system. Messages are pushed to this buffer during frame processing, then swapped with a ReadBuffer at frame boundaries. This separation enables lock-free, single-threaded producer-consumer patterns.
The internal storage is only accessible to ReadWriteDoubleBuffer for swap operations.
- Template Parameters
-
T The message type stored in the buffer. Must be move-constructible.
Definition at line 32 of file WriteBuffer.ixx.
Friends
ReadWriteDoubleBuffer< T >
|
Definition at line 1 of file WriteBuffer.ixx.
Public Member Functions
clear()
| inline |
Removes all messages from the buffer.
- Returns
Reference to this buffer for method chaining.
Definition at line 86 of file WriteBuffer.ixx.
Reference helios::core::container::buffer::WriteBuffer< T >::clear.
Referenced by helios::core::container::buffer::WriteBuffer< T >::clear.
push()
| inline |
Constructs and appends a message to the buffer.
- Template Parameters
-
Args Constructor argument types for T.
- Parameters
-
args Arguments forwarded to T's constructor.
- Returns
Reference to this buffer for method chaining.
Definition at line 64 of file WriteBuffer.ixx.
reserve()
| inline |
Pre-allocates memory for the specified number of messages.
- Parameters
-
size The number of messages to reserve capacity for.
- Returns
Reference to this buffer for method chaining.
Definition at line 76 of file WriteBuffer.ixx.
Reference helios::core::container::buffer::WriteBuffer< T >::reserve.
Referenced by helios::core::container::buffer::WriteBuffer< T >::reserve.
Private Member Functions
bufferData()
| inline nodiscard |
Returns a mutable reference to the internal buffer.
Only accessible to ReadWriteDoubleBuffer for swap operations.
- Returns
Reference to the internal vector.
Definition at line 48 of file WriteBuffer.ixx.
Private Member Attributes
bufferData_
|
Internal storage for buffered messages.
Definition at line 39 of file WriteBuffer.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.