Jpp  18.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
timer.hh
Go to the documentation of this file.
1 #ifndef __TIMER_HH
2 #define __TIMER_HH
3 
4 #include <sys/time.h>
5 
6 /**
7  * \author cpellegrino
8  */
9 
10 class Timer : public timeval
11 {
12  public:
13 
14  // Copy constructor
15  Timer(const Timer& t)
16  {
17  set(t);
18  }
19 
20  Timer(long int seconds, long int useconds)
21  {
22  set(seconds, useconds);
23  }
24 
25  // Default constructor
27  {}
28 
29  // Expiration Check
30  bool hasExpired() const;
31 
32  bool hasExpiredWrt(Timer const& t) const;
33 
34  void set(long int seconds, long int useconds);
35 
36  void set(const Timer& t)
37  {
38  tv_sec = t.tv_sec;
39  tv_usec = t.tv_usec;
40  }
41 };
42 
43 #endif
bool hasExpired() const
Definition: timer.cc:21
Timer(const Timer &t)
Definition: timer.hh:15
void set(const Timer &t)
Definition: timer.hh:36
Timer()
Definition: timer.hh:26
bool hasExpiredWrt(Timer const &t) const
Definition: timer.cc:7
Timer(long int seconds, long int useconds)
Definition: timer.hh:20
void set(long int seconds, long int useconds)
Definition: timer.cc:27
Definition: timer.hh:10