RTOS Wrapper
API reference
Loading...
Searching...
No Matches
Classes | Namespaces
ErrorHistory.h File Reference

Fixed-capacity ring buffer of error / event records. More...

#include <cstddef>
#include <cstdint>
#include <cstring>
#include <mutex>
#include <type_traits>
#include "RtosMutex.h"

Go to the source code of this file.

Classes

class  hf::ErrorHistoryReader< Record >
 
class  hf::ErrorHistoryWriter< Record >
 
class  hf::ErrorHistory< Record, kCapacity >
 

Namespaces

namespace  hf
 

Detailed Description

Fixed-capacity ring buffer of error / event records.

Three types in one header:

Thread-safety
All operations take an internal RtosMutex; safe from any task context. Not ISR-safe — callers from ISR should buffer to a queue and drain from a task. Push returns false if it cannot acquire the mutex.
Allocation
No heap allocation. Backing storage is an inline Record[kCapacity]. When the ring is full, Push overwrites the oldest entry and bumps OverwriteCount().
Constraints
Record must be trivially copyable.