source: flair-src/trunk/lib/FlairCore/src/Watchdog.h@ 16

Last change on this file since 16 was 15, checked in by Bayard Gildas, 8 years ago

sources reformatted with flair-format-dir script

File size: 886 bytes
RevLine 
[2]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[2]4// %flair:license}
5/*!
6 * \file Watchdog.h
7 * \brief Watchdog Class
8 * \author Gildas Bayard, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2016/02/25
10 * \version 1.0
11 */
12
13#ifndef WATCHDOG_H
14#define WATCHDOG_H
15
16#include <Thread.h>
17#include <functional>
18
19namespace flair {
20namespace core {
21
[15]22/*! \class Watchdog
23*
24* \brief Watchdog class
25*
26* Calls a given function if not touched within a specified period of time
27*
28*/
29class Watchdog : public Thread {
30public:
31 Watchdog(const Object *parent, std::function<void()> _expired, Time _timer);
32 ~Watchdog();
[2]33
[15]34 // reset the timer
35 void Touch();
36 void SetTimer(Time _Timer);
[2]37
[15]38private:
39 void Run();
40 std::function<void()> expired;
41 Time timer;
42};
43
[2]44} // end namespace core
45} // end namespace flair
46
47#endif // WATCHDOG_H
Note: See TracBrowser for help on using the repository browser.