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 
27 namespace fawkes {
28 
29 class Clock;
30 class Time;
31 
32 class TimeWait {
33  public:
34  TimeWait(Clock *clock, long int desired_loop_time_usec);
35  ~TimeWait();
36 
37  void mark_start();
38  void wait();
39  void wait_systime();
40 
41  static void wait(long int usec);
42  static void wait_systime(long int usec);
43 
44  private:
45  Clock *__clock;
46  Time *__until;
47  Time *__until_systime;
48  Time *__now;
49  long int __desired_loop_time;
50 };
51 
52 } // end namespace fawkes
53 
54 #endif
void wait()
Wait until minimum loop time has been reached.
Definition: wait.cpp:81
TimeWait(Clock *clock, long int desired_loop_time_usec)
Constructor.
Definition: wait.cpp:49
Fawkes library namespace.
This is supposed to be the central clock in Fawkes.
Definition: clock.h:34
A class for handling time.
Definition: time.h:91
void wait_systime()
Wait until minimum loop time has been reached in real time.
Definition: wait.cpp:100
void mark_start()
Mark start of loop.
Definition: wait.cpp:70
~TimeWait()
Destructor.
Definition: wait.cpp:60
Time wait utility.
Definition: wait.h:32