OpenRTM  1.0.0
TimeValue.h
説明を見る。
1 // -*- C++ -*-
19 #ifndef COIL_TIMEVALUE_H
20 #define COIL_TIMEVALUE_H
21 
22 namespace coil
23 {
24 
25 #define TIMEVALUE_ONE_SECOND_IN_USECS 1000000 // 1 [sec] = 1000000 [usec]
26 
40  class TimeValue
41  {
42  public:
66  TimeValue(long sec=0, long usec=0);
67 
89  TimeValue(double timeval);
90 
110  inline long int sec() const {return m_sec;}
111 
131  inline long int usec() const {return m_usec;}
132 
158 
183 
207  TimeValue operator=(double time);
208 
228  operator double() const;
229 
249  int sign() const;
250 
251  // private:
252 
268  void normalize();
269 
270  private:
271  long int m_sec;
272  long int m_usec;
273  };
274 };
275 
276 #endif // COIL_TIMEVALUE_H