TUIO C++ Developer API
|
#include <TuioTime.h>
Public Member Functions | |
TuioTime () | |
~TuioTime () | |
TuioTime (long msec) | |
TuioTime (long sec, long usec) | |
TuioTime | operator+ (long us) |
TuioTime | operator+ (TuioTime ttime) |
TuioTime | operator- (long us) |
TuioTime | operator- (TuioTime ttime) |
void | operator= (TuioTime ttime) |
bool | operator== (TuioTime ttime) |
bool | operator!= (TuioTime ttime) |
void | reset () |
long | getSeconds () const |
long | getMicroseconds () const |
long | getTotalMilliseconds () const |
Static Public Member Functions | |
static void | initSession () |
static TuioTime | getSessionTime () |
static TuioTime | getStartTime () |
static TuioTime | getSystemTime () |
The TuioTime class is a simple structure that is used to reprent the time that has elapsed since the session start. The time is internally represented as seconds and fractions of microseconds which should be more than sufficient for gesture related timing requirements. Therefore at the beginning of a typical TUIO session the static method initSession() will set the reference time for the session. Another important static method getSessionTime will return a TuioTime object representing the time elapsed since the session start. The class also provides various addtional convience method, which allow some simple time arithmetics.
|
inline |
The default constructor takes no arguments and sets the Seconds and Microseconds attributes of the newly created TuioTime both to zero.
|
inline |
The destructor is doing nothing in particular.
TuioTime::TuioTime | ( | long | msec | ) |
This constructor takes the provided time represented in total Milliseconds and assigs this value to the newly created TuioTime.
msec | the total time in Millseconds |
TuioTime::TuioTime | ( | long | sec, |
long | usec | ||
) |
This constructor takes the provided time represented in Seconds and Microseconds and assigs these value to the newly created TuioTime.
sec | the total time in seconds |
usec | the microseconds time component |
long TuioTime::getMicroseconds | ( | ) | const |
long TuioTime::getSeconds | ( | ) | const |
|
static |
|
static |
|
static |
long TuioTime::getTotalMilliseconds | ( | ) | const |
|
static |
This static method globally resets the TUIO session time.
bool TuioTime::operator!= | ( | TuioTime | ttime | ) |
TuioTime TuioTime::operator+ | ( | long | us | ) |
TuioTime TuioTime::operator- | ( | long | us | ) |
Subtracts the provided time represented in Microseconds from the private Seconds and Microseconds attributes.
us | the total time to subtract in Microseconds |
void TuioTime::operator= | ( | TuioTime | ttime | ) |
bool TuioTime::operator== | ( | TuioTime | ttime | ) |
void TuioTime::reset | ( | ) |
Resets the seconds and micro_seconds attributes to zero.