coil::TimeValue Class Reference

TimeValue class. More...

#include <TimeValue.h>

List of all members.

Public Member Functions

 TimeValue (long sec=0, long usec=0)
 Constructor.
 TimeValue (double timeval)
 Constructor.
long int sec () const
 Get value of second time scale.
long int usec () const
 Get value of micro second time scale.
TimeValue operator- (TimeValue &tm)
 Time subtraction.
TimeValue operator+ (TimeValue &tm)
 Time addition.
TimeValue operator= (double time)
 Convert double type into time type.
 operator double () const
 Convert time type into double type.
int sign () const
 Sign judgment.
void normalize ()
 Normalize.

Detailed Description

TimeValue class.


Constructor & Destructor Documentation

coil::TimeValue::TimeValue ( long  sec = 0,
long  usec = 0 
)

Constructor.

Constructor Initialize with the specified second and micro second.

Parameters:
sec Second(The default value:0)
usec Micro second(The default value:0)
coil::TimeValue::TimeValue ( double  timeval  ) 

Constructor.

Constructor Initialize with the specified second and micro second.

Parameters:
timeval (Second * 1000000 + Micro second)

Member Function Documentation

void coil::TimeValue::normalize (  ) 

Normalize.

Normalize the value expression into a canonical form.

coil::TimeValue::operator double (  )  const

Convert time type into double type.

Convert held information into double type.

Returns:
Result for conversion of double type
TimeValue coil::TimeValue::operator+ ( TimeValue tm  ) 

Time addition.

Add the time given by the argument to the set time.

Parameters:
tm Added time
Returns:
Addition result
TimeValue coil::TimeValue::operator- ( TimeValue tm  ) 

Time subtraction.

Subtract the time given by the argument from the set time.

Parameters:
tm Subtracted time
Returns:
Subtraction result
TimeValue coil::TimeValue::operator= ( double  time  ) 

Convert double type into time type.

Convert double type given by the argument into time type.

Parameters:
time the original value
Returns:
Conversion result
long int coil::TimeValue::sec (  )  const [inline]

Get value of second time scale.

Get value of second time scale.

Returns:
value

Referenced by RTC::RingBuffer< DataType >::read(), setTimestamp(), coil::sleep(), and RTC::RingBuffer< DataType >::write().

int coil::TimeValue::sign (  )  const

Sign judgment.

Judge sign of the held contents

Returns:
1 if the return value is Plus sign, -1 if Minus, and 0 if 0.
long int coil::TimeValue::usec (  )  const [inline]

Get value of micro second time scale.

Get value of micro second time scale.

Returns:
value

Referenced by RTC::RingBuffer< DataType >::read(), setTimestamp(), coil::sleep(), and RTC::RingBuffer< DataType >::write().

Generated on Fri Oct 28 18:31:18 2016 for OpenRTM-aist by  doxygen 1.6.3