scc  2022.4.0
SystemC components library
util::watchdog Class Reference

a watch dog based on https://github.com/didenko/TimeoutGuard More...

#include <watchdog.h>

Public Member Functions

 watchdog (std::chrono::system_clock::duration timeout, std::function< void(void)> alarm_cb, std::chrono::system_clock::duration sleep_duration)
 
 watchdog (std::chrono::system_clock::duration timeout, std::function< void(void)> alarm)
 
 ~watchdog ()
 
 watchdog (const watchdog &)=delete
 
watchdogoperator= (const watchdog &)=delete
 
 watchdog (watchdog &&)=delete
 
watchdogoperator= (watchdog &&)=delete
 
void arm ()
 
void re_arm ()
 

Detailed Description

a watch dog based on https://github.com/didenko/TimeoutGuard

Definition at line 37 of file watchdog.h.

Constructor & Destructor Documentation

◆ watchdog() [1/2]

util::watchdog::watchdog ( std::chrono::system_clock::duration  timeout,
std::function< void(void)>  alarm_cb,
std::chrono::system_clock::duration  sleep_duration 
)

constructor

Parameters
timeoutuntil the watch dog is going to expire
alarm_cbthe function to be called once the watch dog expires, upon expiration the watch dog goes into idle state
sleep_durationthe granularity to check expiration

◆ watchdog() [2/2]

util::watchdog::watchdog ( std::chrono::system_clock::duration  timeout,
std::function< void(void)>  alarm 
)
Parameters
timeouttimeout until the watch dog is going to expire
alarmthe function to be called once the watch dog expires, upon expiration the watch dog goes into idle state

◆ ~watchdog()

watchdog::~watchdog ( )

destructor

Definition at line 36 of file watchdog.cpp.

Member Function Documentation

◆ arm()

void watchdog::arm ( )

arms the watch dog

Definition at line 66 of file watchdog.cpp.

◆ re_arm()

void watchdog::re_arm ( )

re-arms the watch dog

Definition at line 72 of file watchdog.cpp.


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