Fawkes API Fawkes Development Version
wait.h
1
2/***************************************************************************
3 * wait.h - TimeWait tool
4 *
5 * Created: Thu Nov 29 17:28:46 2007
6 * Copyright 2007 Tim Niemueller [www.niemueller.de]
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24#ifndef _UTILS_TIME_WAIT_H_
25#define _UTILS_TIME_WAIT_H_
26
27namespace fawkes {
28
29class Clock;
30class Time;
31
33{
34public:
35 TimeWait(Clock *clock, long int desired_loop_time_usec);
36 ~TimeWait();
37
38 void mark_start();
39 void wait();
40 void wait_systime();
41
42 static void wait(long int usec);
43 static void wait_systime(long int usec);
44
45private:
46 Clock * clock_;
47 Time * until_;
48 Time * until_systime_;
49 Time * now_;
50 long int desired_loop_time_;
51};
52
53} // end namespace fawkes
54
55#endif
This is supposed to be the central clock in Fawkes.
Definition: clock.h:35
Time wait utility.
Definition: wait.h:33
TimeWait(Clock *clock, long int desired_loop_time_usec)
Constructor.
Definition: wait.cpp:49
void mark_start()
Mark start of loop.
Definition: wait.cpp:68
void wait_systime()
Wait until minimum loop time has been reached in real time.
Definition: wait.cpp:96
void wait()
Wait until minimum loop time has been reached.
Definition: wait.cpp:78
~TimeWait()
Destructor.
Definition: wait.cpp:59
A class for handling time.
Definition: time.h:93
Fawkes library namespace.