Corium 1.1.0
High-Performance Zero-Heap C++20 MPSC Application Runtime
Loading...
Searching...
No Matches
corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy > Class Template Reference

Dedicated safety supervisor monitoring subsystem heartbeats and controlling watchdog refresh. Compatible with hardware IWDG (STM32, ESP32, nRF), RTOS Task Watchdogs, and POSIX watchdogs. Zero dynamic heap allocations, zero threading overhead. More...

#include <WatchdogSupervisor.hpp>

+ Inheritance diagram for corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >:
+ Collaboration diagram for corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >:

Public Types

using KickCallbackFn = void(*)(void *userData)
 

Public Member Functions

void beat (uint32_t serviceId) noexcept
 Submit a heartbeat for a monitored service.
 
const HeartbeatMonitor< MaxServices > & heartbeatMonitor () const noexcept
 Access const reference to the internal HeartbeatMonitor.
 
HeartbeatMonitor< MaxServices > & heartbeatMonitor () noexcept
 Access reference to the internal HeartbeatMonitor.
 
bool registerService (uint32_t serviceId, uint64_t timeoutNs) noexcept
 Register a service for supervision.
 
void setWatchdogKickCallback (KickCallbackFn kickFn, void *userData=nullptr) noexcept
 Configure the physical hardware/software watchdog kick callback.
 
template<typename EventSinkType >
bool supervise (const EventSinkType &sink) noexcept
 Perform a supervisor check iteration. Kicks the hardware watchdog if healthy; suppresses the kick and dispatches WatchdogTimeoutEvent if failed.
 
uint64_t totalKicks () const noexcept
 Get total number of successful watchdog kicks.
 
uint64_t totalSuppressions () const noexcept
 Get total number of watchdog kick suppressions due to health violations.
 
 WatchdogSupervisor ()=default
 

Detailed Description

template<std::size_t MaxServices = 16, typename ClockPolicy = ChronoClockPolicy>
class corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >

Dedicated safety supervisor monitoring subsystem heartbeats and controlling watchdog refresh. Compatible with hardware IWDG (STM32, ESP32, nRF), RTOS Task Watchdogs, and POSIX watchdogs. Zero dynamic heap allocations, zero threading overhead.

Template Parameters
MaxServicesMaximum number of monitored services.
ClockPolicyTime source policy (defaults to ChronoClockPolicy).

Member Typedef Documentation

◆ KickCallbackFn

template<std::size_t MaxServices = 16, typename ClockPolicy = ChronoClockPolicy>
using corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >::KickCallbackFn = void (*)(void* userData)

Constructor & Destructor Documentation

◆ WatchdogSupervisor()

template<std::size_t MaxServices = 16, typename ClockPolicy = ChronoClockPolicy>
corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >::WatchdogSupervisor ( )
default

Member Function Documentation

◆ beat()

template<std::size_t MaxServices = 16, typename ClockPolicy = ChronoClockPolicy>
void corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >::beat ( uint32_t  serviceId)
inlinenoexcept

Submit a heartbeat for a monitored service.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ heartbeatMonitor() [1/2]

template<std::size_t MaxServices = 16, typename ClockPolicy = ChronoClockPolicy>
const HeartbeatMonitor< MaxServices > & corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >::heartbeatMonitor ( ) const
inlinenoexcept

Access const reference to the internal HeartbeatMonitor.

◆ heartbeatMonitor() [2/2]

template<std::size_t MaxServices = 16, typename ClockPolicy = ChronoClockPolicy>
HeartbeatMonitor< MaxServices > & corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >::heartbeatMonitor ( )
inlinenoexcept

Access reference to the internal HeartbeatMonitor.

◆ registerService()

template<std::size_t MaxServices = 16, typename ClockPolicy = ChronoClockPolicy>
bool corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >::registerService ( uint32_t  serviceId,
uint64_t  timeoutNs 
)
inlinenoexcept

Register a service for supervision.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setWatchdogKickCallback()

template<std::size_t MaxServices = 16, typename ClockPolicy = ChronoClockPolicy>
void corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >::setWatchdogKickCallback ( KickCallbackFn  kickFn,
void *  userData = nullptr 
)
inlinenoexcept

Configure the physical hardware/software watchdog kick callback.

Parameters
kickFnFunction called to refresh the watchdog timer.
userDataPointer passed to the kick function.
+ Here is the caller graph for this function:

◆ supervise()

template<std::size_t MaxServices = 16, typename ClockPolicy = ChronoClockPolicy>
template<typename EventSinkType >
bool corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >::supervise ( const EventSinkType &  sink)
inlinenoexcept

Perform a supervisor check iteration. Kicks the hardware watchdog if healthy; suppresses the kick and dispatches WatchdogTimeoutEvent if failed.

Template Parameters
EventSinkTypeEvent sink type to post failure events.
Parameters
sinkEvent sink handle to dispatch emergency events.
Returns
true if all services were healthy and watchdog was kicked; false if watchdog was suppressed.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ totalKicks()

template<std::size_t MaxServices = 16, typename ClockPolicy = ChronoClockPolicy>
uint64_t corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >::totalKicks ( ) const
inlinenoexcept

Get total number of successful watchdog kicks.

◆ totalSuppressions()

template<std::size_t MaxServices = 16, typename ClockPolicy = ChronoClockPolicy>
uint64_t corium::safety::WatchdogSupervisor< MaxServices, ClockPolicy >::totalSuppressions ( ) const
inlinenoexcept

Get total number of watchdog kick suppressions due to health violations.


The documentation for this class was generated from the following file: