|
RTOS Wrapper
API reference
|
Single-writer / many-reader coherent snapshot of a POD value. More...
#include <atomic>#include <climits>#include <cstddef>#include <cstdint>#include <cstring>#include <type_traits>#include "OsAbstraction.h"#include "OsUtility.h"Go to the source code of this file.
Classes | |
| class | hf::SnapshotReader< T > |
| class | hf::SnapshotWriter< T > |
| class | hf::SeqlockSnapshot< T > |
Namespaces | |
| namespace | hf |
Single-writer / many-reader coherent snapshot of a POD value.
Three types in one header:
hf::SnapshotReader<T> — pure-virtual read-side ABC.hf::SnapshotWriter<T> — pure-virtual write-side ABC.hf::SeqlockSnapshot<T> — concrete impl deriving from both.seq_ to odd → memcpy T payload → bumps seq_ to even. Reader: snapshots seq_ → memcpy payload → re-reads seq_; retry while the start seq was odd or the two reads differ.Publish not safe to call concurrently from multiple writers; protect externally if ever needed).Read is wait-free in the absence of writes and bounded-retry under contention.WaitForChange is task-context only.T storage; event group created on first WaitForChange / ClearWaitEvent use.T must be trivially copyable.