Public Member Functions | Static Public Member Functions

TUIO::TuioTime Class Reference

#include <TuioTime.h>

List of all members.

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 ()
long getMicroseconds ()
long getTotalMilliseconds ()

Static Public Member Functions

static void initSession ()
static TuioTime getSessionTime ()
static TuioTime getStartTime ()
static TuioTime getSystemTime ()

Detailed Description

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.

Author:
Martin Kaltenbrunner
Version:
1.4

Constructor & Destructor Documentation

TUIO::TuioTime::TuioTime (  ) [inline]

The default constructor takes no arguments and sets the Seconds and Microseconds attributes of the newly created TuioTime both to zero.

TUIO::TuioTime::~TuioTime (  ) [inline]

The destructor is doing nothing in particular.

TUIO::TuioTime::TuioTime ( long  msec ) [inline]

This constructor takes the provided time represented in total Milliseconds and assigs this value to the newly created TuioTime.

Parameters:
msecthe total time in Millseconds
TUIO::TuioTime::TuioTime ( long  sec,
long  usec 
) [inline]

This constructor takes the provided time represented in Seconds and Microseconds and assigs these value to the newly created TuioTime.

Parameters:
secthe total time in seconds
usecthe microseconds time component

Member Function Documentation

long TUIO::TuioTime::getMicroseconds (  ) [inline]

Returns the TuioTime Microseconds component.

Returns:
the TuioTime Microseconds component
long TUIO::TuioTime::getSeconds (  ) [inline]

Returns the TuioTime Seconds component.

Returns:
the TuioTime Seconds component
TuioTime TuioTime::getSessionTime (  ) [static]

Returns the present TuioTime representing the time since session start.

Returns:
the present TuioTime representing the time since session start
TuioTime TuioTime::getStartTime (  ) [static]

Returns the absolut TuioTime representing the session start.

Returns:
the absolut TuioTime representing the session start
TuioTime TuioTime::getSystemTime (  ) [static]

Returns the absolut TuioTime representing the current system time.

Returns:
the absolut TuioTime representing the current system time
long TUIO::TuioTime::getTotalMilliseconds (  ) [inline]

Returns the total TuioTime in Milliseconds.

Returns:
the total TuioTime in Milliseconds
void TuioTime::initSession (  ) [static]

This static method globally resets the TUIO session time.

bool TUIO::TuioTime::operator!= ( TuioTime  ttime ) [inline]

Takes a TuioTime argument and compares the provided TuioTime to the private Seconds and Microseconds attributes.

Parameters:
ttimethe TuioTime to compare
Returns:
true if the two TuioTime have differnt Seconds or Microseconds attributes
TuioTime TUIO::TuioTime::operator+ ( TuioTime  ttime ) [inline]

Sums the provided TuioTime to the private Seconds and Microseconds attributes.

Parameters:
ttimethe TuioTime to add
Returns:
the sum of this TuioTime with the provided TuioTime argument
TuioTime TUIO::TuioTime::operator+ ( long  us ) [inline]

Sums the provided time value represented in total Microseconds to this TuioTime.

Parameters:
usthe total time to add in Microseconds
Returns:
the sum of this TuioTime with the provided argument in microseconds
TuioTime TUIO::TuioTime::operator- ( TuioTime  ttime ) [inline]

Subtracts the provided TuioTime from the private Seconds and Microseconds attributes.

Parameters:
ttimethe TuioTime to subtract
Returns:
the subtraction result of this TuioTime minus the provided TuioTime
TuioTime TUIO::TuioTime::operator- ( long  us ) [inline]

Subtracts the provided time represented in Microseconds from the private Seconds and Microseconds attributes.

Parameters:
usthe total time to subtract in Microseconds
Returns:
the subtraction result of this TuioTime minus the provided time in Microseconds
void TUIO::TuioTime::operator= ( TuioTime  ttime ) [inline]

Assigns the provided TuioTime to the private Seconds and Microseconds attributes.

Parameters:
ttimethe TuioTime to assign
bool TUIO::TuioTime::operator== ( TuioTime  ttime ) [inline]

Takes a TuioTime argument and compares the provided TuioTime to the private Seconds and Microseconds attributes.

Parameters:
ttimethe TuioTime to compare
Returns:
true if the two TuioTime have equal Seconds and Microseconds attributes
void TUIO::TuioTime::reset (  ) [inline]

Resets the seconds and micro_seconds attributes to zero.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines