|
RTOS Wrapper
API reference
|
#include <SeqlockSnapshot.h>
Public Member Functions | |
| SeqlockSnapshot () noexcept=default | |
| ~SeqlockSnapshot () override | |
| SeqlockSnapshot (const SeqlockSnapshot &)=delete | |
| SeqlockSnapshot & | operator= (const SeqlockSnapshot &)=delete |
| void | Publish (const T &value) noexcept override |
Atomically replace the published snapshot with value. | |
| uint32_t | Read (T &out) const noexcept override |
| Read the latest coherent snapshot. | |
| uint32_t | Seq () const noexcept override |
Monotonic change counter (each successful Publish adds 2). | |
| bool | WaitForChange (uint32_t timeout_ms) noexcept override |
Block up to timeout_ms waiting for any change since the last call to WaitForChange / ClearWaitEvent. | |
| bool | ClearWaitEvent () noexcept override |
| Drop any pending change-signal without waiting. | |
Public Member Functions inherited from hf::SnapshotReader< T > | |
| virtual | ~SnapshotReader () noexcept=default |
Public Member Functions inherited from hf::SnapshotWriter< T > | |
| virtual | ~SnapshotWriter () noexcept=default |
Private Member Functions | |
| void | SignalChange_ () noexcept |
| bool | EnsureEventGroup_ () noexcept |
Private Attributes | |
| std::atomic< uint32_t > | seq_ {0} |
| T | payload_ {} |
| OS_EventGroup | event_group_ {} |
| bool | event_group_created_ {false} |
Static Private Attributes | |
| static constexpr OS_Ulong | kEventBit_ = 0x1U |
|
defaultnoexcept |
|
inlineoverride |
|
delete |
|
inlineoverridevirtualnoexcept |
Drop any pending change-signal without waiting.
Implements hf::SnapshotReader< T >.
|
inlineprivatenoexcept |
|
delete |
|
inlineoverridevirtualnoexcept |
Atomically replace the published snapshot with value.
Single-writer only. Increments Seq() by 2 and signals waiters.
Implements hf::SnapshotWriter< T >.
|
inlineoverridevirtualnoexcept |
Read the latest coherent snapshot.
Implements hf::SnapshotReader< T >.
|
inlineoverridevirtualnoexcept |
Monotonic change counter (each successful Publish adds 2).
Implements hf::SnapshotReader< T >.
|
inlineprivatenoexcept |
|
inlineoverridevirtualnoexcept |
Block up to timeout_ms waiting for any change since the last call to WaitForChange / ClearWaitEvent.
Implements hf::SnapshotReader< T >.
|
private |
|
private |
|
staticconstexprprivate |
|
private |
|
mutableprivate |