Public Member Functions | Private Member Functions | Private Attributes
labust::tools::watchdog Struct Reference

#include <TimingTools.hpp>

List of all members.

Public Member Functions

void reset ()
 watchdog (const boost::function< void(void)> &func, size_t timeout_ms=500, size_t loop_ms=100)
 ~watchdog ()

Private Member Functions

void run ()

Private Attributes

boost::mutex cntMutex
volatile size_t counter
boost::function< void(void)> func
size_t loop_ms
boost::thread runner
size_t timeout_ms

Detailed Description

This structure is used to perform watchdog operations. The watchdog timer triggers the user defined function.

Definition at line 143 of file TimingTools.hpp.


Constructor & Destructor Documentation

labust::tools::watchdog::watchdog ( const boost::function< void(void)> &  func,
size_t  timeout_ms = 500,
size_t  loop_ms = 100 
) [inline]

Main constructor. Takes the user desired function and timing.

Parameters:
funcThe user defined functor to be called when the watchdog triggers.
timeout_msThe timeout time after which to trigger.
loop_msThe loop time of the watchdog function.

Definition at line 152 of file TimingTools.hpp.

Generic destructor.

Definition at line 161 of file TimingTools.hpp.


Member Function Documentation

void labust::tools::watchdog::reset ( ) [inline]

The method resets the watchdog counter.

Definition at line 170 of file TimingTools.hpp.

void labust::tools::watchdog::run ( ) [inline, private]

The method performs the watchdog operation.

Definition at line 176 of file TimingTools.hpp.


Member Data Documentation

boost::mutex labust::tools::watchdog::cntMutex [private]

The protector mutex for access synchonization to the counter variable.

Definition at line 210 of file TimingTools.hpp.

volatile size_t labust::tools::watchdog::counter [private]

The counter variable.

Definition at line 198 of file TimingTools.hpp.

boost::function<void (void)> labust::tools::watchdog::func [private]

The user functor.

Definition at line 189 of file TimingTools.hpp.

Definition at line 202 of file TimingTools.hpp.

boost::thread labust::tools::watchdog::runner [private]

The watchdog execution thread.

Definition at line 206 of file TimingTools.hpp.

The watchdog timeout and loop time.

Definition at line 202 of file TimingTools.hpp.


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


snippets
Author(s): Gyula Nagy
autogenerated on Mon Oct 6 2014 01:39:41