gui::periodic_timer Class Reference

A... periodic timer. More...

#include <gui_editbox.hpp>

List of all members.

Public Types

enum  start_type { START_PAUSED, START_NOW, START_FIRST_TICK }

Public Member Functions

 periodic_timer (const double &dDuration, start_type mType, bool bTicks)
 Default constructor.
const double & get_elapsed ()
 Returns the time elapsed since the last tick.
const double & get_period () const
 Returns the period of the periodic_timer.
bool is_paused () const
 Cheks if this periodic_timer is paused.
bool ticks ()
 Checks if the timer's period has been reached.
void stop ()
 Pauses the timer and resets it.
void start ()
 Starts the timer but doesn't reset it.
void pause ()
 Pauses the timer.
void zero ()
 Resets the timer but doesn't pause it.
void update (double dDelta)
 Updates this timer (adds time).

Detailed Description

A... periodic timer.

This timer is meant to tick periodicaly, so you can use it for any periodic event such as key repetition or a count down.

Definition at line 21 of file gui_editbox.hpp.


Member Enumeration Documentation

Enumerator:
START_PAUSED 

The timer will start if you call Start().

START_NOW 

The timer starts immediatly after it is created.

START_FIRST_TICK 

The timer will start when you first call Ticks().

Definition at line 25 of file gui_editbox.hpp.


Constructor & Destructor Documentation

gui::periodic_timer::periodic_timer ( const double &  dDuration,
start_type  mType,
bool  bTicks 
)

Default constructor.

Parameters:
dDuration The time interval between each tick
mType See TimerType
bTicks The timer ticks immediately

Definition at line 1233 of file gui_editbox.cpp.


Member Function Documentation

const double & gui::periodic_timer::get_elapsed (  ) 

Returns the time elapsed since the last tick.

Returns:
The time elapsed since last tick

Definition at line 1241 of file gui_editbox.cpp.

const double & gui::periodic_timer::get_period (  )  const

Returns the period of the periodic_timer.

Returns:
The period of the periodic_timer

Definition at line 1246 of file gui_editbox.cpp.

bool gui::periodic_timer::is_paused (  )  const

Cheks if this periodic_timer is paused.

Returns:
'true' if this periodic_timer is paused

Definition at line 1251 of file gui_editbox.cpp.

void gui::periodic_timer::pause (  ) 

Pauses the timer.

Definition at line 1281 of file gui_editbox.cpp.

void gui::periodic_timer::start (  ) 

Starts the timer but doesn't reset it.

Definition at line 1286 of file gui_editbox.cpp.

void gui::periodic_timer::stop (  ) 

Pauses the timer and resets it.

Definition at line 1275 of file gui_editbox.cpp.

bool gui::periodic_timer::ticks (  ) 

Checks if the timer's period has been reached.

Returns:
'true' if the period has been reached

Definition at line 1256 of file gui_editbox.cpp.

void gui::periodic_timer::update ( double  dDelta  ) 

Updates this timer (adds time).

Parameters:
dDelta The time elapsed since last update

Definition at line 1296 of file gui_editbox.cpp.

void gui::periodic_timer::zero (  ) 

Resets the timer but doesn't pause it.

Definition at line 1291 of file gui_editbox.cpp.


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

Generated on Tue Jan 1 21:58:12 2013 for gui by  doxygen 1.6.1