LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
TimeSpan.h
1 #ifndef RHESUS_TIMESPAN_H_
2 #define RHESUS_TIMESPAN_H_
3 
4 #include <WPILib.h>
5 #include <sysLib.h>
6 #include <cmath>
7 
8 namespace Rhesus
9 {
10 namespace Toolkit
11 {
12  class TimeSpan
13  {
14  public:
15  TimeSpan(INT64 ticks);
16  TimeSpan(double seconds);
17  TimeSpan(double minutes, double seconds);
18  TimeSpan(double minutes, double seconds, double milliseconds);
19 
20  TimeSpan operator =(const TimeSpan t);
21 
22  TimeSpan operator +(const TimeSpan t) const;
23  TimeSpan operator -(const TimeSpan t) const;
24 
25  TimeSpan& operator+=(const TimeSpan t);
26  TimeSpan& operator-=(const TimeSpan t);
27 
28  bool operator <(TimeSpan t);
29  bool operator <=(TimeSpan t);
30 
31  bool operator >(TimeSpan t);
32  bool operator >=(TimeSpan t);
33 
34  bool operator ==(TimeSpan t);
35  bool operator !=(TimeSpan t);
36 
37  INT64 TotalTicks();
38  double TotalMilliseconds();
39  double TotalSeconds();
40  double TotalMinutes();
41 
42  double Milliseconds();
43  INT32 Seconds();
44  INT32 Minutes();
45 
46  private:
47  void construct(double minutes, double seconds, double milliseconds);
48 
49  double m_totalMilliseconds;
50  };
51 }
52 }
53 
54 #endif