SPACE::Core::cTimer Class Reference

The timer class whis is handled by SPACE::Core::cTimerManager. More...

#include <cTimer.hpp>

List of all members.

Public Member Functions

 cTimer (void(*_pFunction)(ePurpose _Purpose))
 Init Variables.
bool Start (unsigned int _Length, bool _bDestroy=true, int _Repeat=0)
void ForceStop (bool _bDestroy=true)
void Pause ()
void Resume ()
bool Reset ()
bool ChangeRuntime (unsigned int _TotalRunTime)
bool ChangeReapeat (int _Repeat)
int GetRepeat ()
unsigned int GetRuntime ()
unsigned int GetElapse ()

Friends

class cTimerManager

Detailed Description

The timer class whis is handled by SPACE::Core::cTimerManager.

See also:
SPACE::Core::cTimerManager

Constructor & Destructor Documentation

cTimer::cTimer ( void(*)(ePurpose _Purpose)  _pFunction  ) 

Init Variables.

Parameters:
_pFunction The function runs, whenever something happens to the timer.

Member Function Documentation

bool cTimer::ChangeReapeat ( int  _Repeat  ) 

Changes the total runtime. The time elapsed don't change.

Parameters:
_Repeat How often repeats the timer. -1: infinity | 0: only run once | >0: repeats x-times.
Returns:
true => Everything was allright
false => something failed
bool cTimer::ChangeRuntime ( unsigned int  _TotalRunTime  ) 

Changes the total runtime. The time elapsed don't change.

Parameters:
_TotalRunTime The new runtime. If it is less than the elapsed time, the timer stops (END_PURPOSE) or repeats
Returns:
true => Everything was allright
false => something failed
void cTimer::ForceStop ( bool  _bDestroy = true  ) 

Stops the timer by hard.

Parameters:
_bDestroy If the timer should be destroyed and memory freed set this true [default], if not, set to false. The timer is deleated after the current frame.
unsigned int SPACE::Core::cTimer::GetElapse (  )  [inline]
Returns:
Returns the elapsed.
int SPACE::Core::cTimer::GetRepeat (  )  [inline]
Returns:
Returns how often the timer repeats.
unsigned int SPACE::Core::cTimer::GetRuntime (  )  [inline]
Returns:
Returns the total Runtime.
void cTimer::Pause (  ) 

Pause the timer

bool cTimer::Reset (  ) 

Reset the Start time to the current time and set the Elapsed time to 0

Returns:
true => Everything was allright
false => something failed
void cTimer::Resume (  ) 

Resume the time

bool cTimer::Start ( unsigned int  _Length,
bool  _bDestroy = true,
int  _Repeat = 0 
)

Starts the timer.

Parameters:
_Length The time, the timer runs. In miliseconds
_bDestroy If the timer should be destroyed and memory freed set this true [default], if not, set to false. The timer is deleated after it stops.
_Repeat How often repeats the timer. -1: infinity | 0: only run once | >0: repeats x-times.
Returns:
true => Everything was allright
false => something failed

The documentation for this class was generated from the following files:
Generated on Wed Apr 7 17:20:25 2010 for SPACE Engine by  doxygen 1.6.3