IQRF Gateway Daemon
Public Member Functions | List of all members
WatchDog< T > Class Template Reference

Provides watch dog feature. More...

#include <WatchDog.h>

Public Member Functions

 WatchDog ()
 
 WatchDog (unsigned int millis, T callback)
 parametric constructor More...
 
virtual ~WatchDog ()
 
void start (unsigned int millis, T callback)
 Start watching thread. More...
 
void stop ()
 Stop watching thread. More...
 
void pet ()
 Pet watch dog. More...
 

Detailed Description

template<typename T>
class WatchDog< T >

Provides watch dog feature.

It starts dedicated monitor thread and waits for calling pet(). If pet() is not called at predefined time interval it calls callback.

Constructor & Destructor Documentation

◆ WatchDog() [1/2]

template<typename T >
WatchDog< T >::WatchDog ( )
inline

◆ WatchDog() [2/2]

template<typename T >
WatchDog< T >::WatchDog ( unsigned int  millis,
callback 
)
inline

parametric constructor

Parameters
[in]millistime to wait for pet()
[in]callbackfunctional called when time without pet() elapsed

Construc and start watching thread. If pet() is not called at predefined time it calls callback.

◆ ~WatchDog()

template<typename T >
virtual WatchDog< T >::~WatchDog ( )
inlinevirtual

Member Function Documentation

◆ pet()

template<typename T >
void WatchDog< T >::pet ( )
inline

Pet watch dog.

Satisfy watch dog for time interval

◆ start()

template<typename T >
void WatchDog< T >::start ( unsigned int  millis,
callback 
)
inline

Start watching thread.

Parameters
[in]millistime to wait for pet()
[in]callbackfunctional called when time without pet() elapsed

Start watching thread if not running yet. If pet() is not called at predefined time it calls callback.

◆ stop()

template<typename T >
void WatchDog< T >::stop ( )
inline

Stop watching thread.

Stop watching thread if running


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