F´ Flight Software - C/C++ Documentation
NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Utils/Types/CircularBuffer.hpp>
Public Member Functions | |
CircularBuffer (U8 *const buffer, const NATIVE_UINT_TYPE size) | |
Fw::SerializeStatus | serialize (const U8 *const buffer, const NATIVE_UINT_TYPE size) |
Fw::SerializeStatus | peek (char &value, NATIVE_UINT_TYPE offset=0) |
Fw::SerializeStatus | peek (U8 &value, NATIVE_UINT_TYPE offset=0) |
Fw::SerializeStatus | peek (U32 &value, NATIVE_UINT_TYPE offset=0) |
Fw::SerializeStatus | peek (U8 *buffer, NATIVE_UINT_TYPE size, NATIVE_UINT_TYPE offset=0) |
Fw::SerializeStatus | rotate (NATIVE_UINT_TYPE amount) |
NATIVE_UINT_TYPE | get_remaining_size (bool serialization=false) |
Definition at line 31 of file CircularBuffer.hpp.
Types::CircularBuffer::CircularBuffer | ( | U8 *const | buffer, |
const NATIVE_UINT_TYPE | size | ||
) |
Circular buffer constructor. Wraps the supplied buffer as the new data store. Buffer size is supplied in the 'size' argument.
Note: ownership of the supplied buffer is held until the circular buffer is destructed.
const | U8* buffer: supplied buffer used as a data store. |
NATIVE_UINT_TYPE | size: size of the supplied data store. |
Definition at line 26 of file CircularBuffer.cpp.
NATIVE_UINT_TYPE Types::CircularBuffer::get_remaining_size | ( | bool | serialization = false | ) |
Get the remaining size in this circular buffer.
bool | serialization: is this serialization (opposed to deserialization) |
Definition at line 33 of file CircularBuffer.cpp.
Fw::SerializeStatus Types::CircularBuffer::peek | ( | char & | value, |
NATIVE_UINT_TYPE | offset = 0 |
||
) |
Deserialize data into the given variable without moving the head pointer
U8& | value: value to fill |
Definition at line 76 of file CircularBuffer.cpp.
Fw::SerializeStatus Types::CircularBuffer::peek | ( | U32 & | value, |
NATIVE_UINT_TYPE | offset = 0 |
||
) |
Deserialize data into the given variable without moving the head pointer
U32& | value: value to fill |
Definition at line 94 of file CircularBuffer.cpp.
Fw::SerializeStatus Types::CircularBuffer::peek | ( | U8 & | value, |
NATIVE_UINT_TYPE | offset = 0 |
||
) |
Deserialize data into the given variable without moving the head pointer
U8& | value: value to fill |
Definition at line 80 of file CircularBuffer.cpp.
Fw::SerializeStatus Types::CircularBuffer::peek | ( | U8 * | buffer, |
NATIVE_UINT_TYPE | size, | ||
NATIVE_UINT_TYPE | offset = 0 |
||
) |
Deserialize data into the given buffer without moving the head variable.
U32& | value: value to fill |
Definition at line 115 of file CircularBuffer.cpp.
Fw::SerializeStatus Types::CircularBuffer::rotate | ( | NATIVE_UINT_TYPE | amount | ) |
Rotate the head pointer effectively erasing data from the circular buffer and making space. Cannot rotate more than the available space.
NATIVE_UINT_TYPE | amount: amount to rotate by (in bytes) |
Definition at line 136 of file CircularBuffer.cpp.
Fw::SerializeStatus Types::CircularBuffer::serialize | ( | const U8 *const | buffer, |
const NATIVE_UINT_TYPE | size | ||
) |
Serialize a given buffer into this this circular buffer. Will not accept more data then space available. This means it will not overwrite existing data.
const | U8* buffer: supplied buffer to be serialized. |
NATIVE_UINT_TYPE | size: size of the supplied buffer. |
Definition at line 54 of file CircularBuffer.cpp.