TUIO C++ Developer API
TUIO::TuioTime Class Reference

#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 ()
 

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.1.6

Constructor & Destructor Documentation

◆ TuioTime() [1/3]

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.

◆ ~TuioTime()

TUIO::TuioTime::~TuioTime ( )
inline

The destructor is doing nothing in particular.

◆ TuioTime() [2/3]

TuioTime::TuioTime ( long  msec)

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

◆ TuioTime() [3/3]

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.

Parameters
secthe total time in seconds
usecthe microseconds time component

Member Function Documentation

◆ getMicroseconds()

long TuioTime::getMicroseconds ( ) const

Returns the TuioTime Microseconds component.

Returns
the TuioTime Microseconds component

◆ getSeconds()

long TuioTime::getSeconds ( ) const

Returns the TuioTime Seconds component.

Returns
the TuioTime Seconds component

◆ getSessionTime()

TuioTime TuioTime::getSessionTime ( )
static

Returns the present TuioTime representing the time since session start.

Returns
the present TuioTime representing the time since session start

◆ getStartTime()

TuioTime TuioTime::getStartTime ( )
static

Returns the absolut TuioTime representing the session start.

Returns
the absolut TuioTime representing the session start

◆ getSystemTime()

TuioTime TuioTime::getSystemTime ( )
static

Returns the absolut TuioTime representing the current system time.

Returns
the absolut TuioTime representing the current system time

◆ getTotalMilliseconds()

long TuioTime::getTotalMilliseconds ( ) const

Returns the total TuioTime in Milliseconds.

Returns
the total TuioTime in Milliseconds

◆ initSession()

void TuioTime::initSession ( )
static

This static method globally resets the TUIO session time.

◆ operator!=()

bool TuioTime::operator!= ( TuioTime  ttime)

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

◆ operator+() [1/2]

TuioTime TuioTime::operator+ ( long  us)

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

◆ operator+() [2/2]

TuioTime TuioTime::operator+ ( TuioTime  ttime)

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

◆ operator-() [1/2]

TuioTime TuioTime::operator- ( long  us)

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

◆ operator-() [2/2]

TuioTime TuioTime::operator- ( TuioTime  ttime)

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

◆ operator=()

void TuioTime::operator= ( TuioTime  ttime)

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

Parameters
ttimethe TuioTime to assign

◆ operator==()

bool TuioTime::operator== ( TuioTime  ttime)

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

◆ reset()

void TuioTime::reset ( )

Resets the seconds and micro_seconds attributes to zero.


The documentation for this class was generated from the following files: