MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::Timer Class Reference

A base timer class for the different timers. More...

#include <timer.h>

+ Inheritance diagram for Mezzanine::Timer:

Public Types

enum  TimerType { Normal, StopWatch, Alarm }
 The style of timer to be used. More...
 

Public Member Functions

 Timer ()
 Standard Constructor. More...
 
virtual ~Timer ()
 Class Destructor.
 
virtual Whole GetCurrentTime ()
 Gets the Current time in Microseconds. More...
 
virtual Whole GetCurrentTimeInMilliseconds ()
 Gets the Current time in Milliseconds. More...
 
virtual Whole GetInitialTime () const
 Gets the Initial time in Microseconds. More...
 
virtual Whole GetInitialTimeInMilliseconds () const
 Gets the Initial time in Milliseconds. More...
 
virtual Timer::TimerType GetType () const
 Gets the type of timer this is. More...
 
virtual Boolean IsStopped ()
 Gets Whether or not this timer is currently running. More...
 
virtual void Reset ()
 Sets the current values to their initial values.
 
virtual void SetCurrentTime (const Whole Current)
 Sets the current time in Microseconds. More...
 
virtual void SetCurrentTimeInMilliseconds (const Whole Current)
 Sets the current time in Milliseconds. The time that resetting sets the timer to. More...
 
virtual void SetInitialTime (const Whole Initial)
 Sets the initial time in Microseconds. The time that resetting sets the timer to. More...
 
virtual void SetInitialTimeInMilliseconds (const Whole Initial)
 Sets the initial time in Milliseconds. The time that resetting sets the timer to. More...
 
virtual void Start ()
 Activates the Timer.
 
virtual void Stop ()
 Deactivates the Timer.
 

Protected Member Functions

virtual void Update ()
 Updates all the timings in this timer. More...
 

Protected Attributes

MaxInt CurrentTime
 The current amount of microseconds that has elapsed since starting to track time. More...
 
MaxInt InitialTime
 The amount of microseconds elapsed that is considered the starting point for tracking time. More...
 
MaxInt StartStamp
 The time stamp from when the timer first started tracking time. More...
 

Detailed Description

A base timer class for the different timers.

Definition at line 53 of file timer.h.

Member Enumeration Documentation

The style of timer to be used.

Enumerator
Normal 

Counts up forever, ignoring any goal and autoreset.

StopWatch 

Counts down, respecting any goal and autoreset.

Alarm 

Counts up, respecting any goal and autoreset.

Definition at line 57 of file timer.h.

Constructor & Destructor Documentation

Mezzanine::Timer::Timer ( )

Standard Constructor.

Parameters
StyleThe styling/type of timer to be constructed.

Definition at line 48 of file timer.cpp.

Member Function Documentation

Whole Mezzanine::Timer::GetCurrentTime ( )
virtual

Gets the Current time in Microseconds.

Returns
Returns a Whole representing the current time in Microseconds.

Definition at line 75 of file timer.cpp.

Whole Mezzanine::Timer::GetCurrentTimeInMilliseconds ( )
virtual

Gets the Current time in Milliseconds.

Returns
Returns a Whole representing the current time in Milliseconds.

Definition at line 78 of file timer.cpp.

Whole Mezzanine::Timer::GetInitialTime ( ) const
virtual

Gets the Initial time in Microseconds.

Returns
Returns a Whole representing the initial time in Microseconds.

Definition at line 87 of file timer.cpp.

Whole Mezzanine::Timer::GetInitialTimeInMilliseconds ( ) const
virtual

Gets the Initial time in Milliseconds.

Returns
Returns a Whole representing the initial time in Milliseconds.

Definition at line 90 of file timer.cpp.

Timer::TimerType Mezzanine::Timer::GetType ( ) const
virtual

Gets the type of timer this is.

Returns
Returns an enum value representing the type of timer this is.

Reimplemented in Mezzanine::AlarmTimer, and Mezzanine::StopWatchTimer.

Definition at line 119 of file timer.cpp.

bool Mezzanine::Timer::IsStopped ( )
virtual

Gets Whether or not this timer is currently running.

Returns
Returns true if this timer is not currently active, false otherwise.

Definition at line 107 of file timer.cpp.

void Mezzanine::Timer::SetCurrentTime ( const Whole  Current)
virtual

Sets the current time in Microseconds.

Returns
Returns a reference to this timer.
Parameters
CurrentThe value to set as current time in Microseconds.

Definition at line 69 of file timer.cpp.

void Mezzanine::Timer::SetCurrentTimeInMilliseconds ( const Whole  Current)
virtual

Sets the current time in Milliseconds. The time that resetting sets the timer to.

Returns
Returns a reference to this timer.
Parameters
CurrentThe value to set as current time in Milliseconds.

Definition at line 72 of file timer.cpp.

void Mezzanine::Timer::SetInitialTime ( const Whole  Initial)
virtual

Sets the initial time in Microseconds. The time that resetting sets the timer to.

Returns
Returns a reference to this timer.
Parameters
InitialThe value to set as initial time in Microseconds.

Definition at line 81 of file timer.cpp.

void Mezzanine::Timer::SetInitialTimeInMilliseconds ( const Whole  Initial)
virtual

Sets the initial time in Milliseconds. The time that resetting sets the timer to.

Returns
Returns a reference to this timer.
Parameters
InitialThe value to set as initial time in Milliseconds.

Definition at line 84 of file timer.cpp.

void Mezzanine::Timer::Update ( )
protectedvirtual

Updates all the timings in this timer.

Reimplemented in Mezzanine::AlarmTimer, and Mezzanine::StopWatchTimer.

Definition at line 57 of file timer.cpp.

Member Data Documentation

MaxInt Mezzanine::Timer::CurrentTime
protected

The current amount of microseconds that has elapsed since starting to track time.

Definition at line 69 of file timer.h.

MaxInt Mezzanine::Timer::InitialTime
protected

The amount of microseconds elapsed that is considered the starting point for tracking time.

Definition at line 72 of file timer.h.

MaxInt Mezzanine::Timer::StartStamp
protected

The time stamp from when the timer first started tracking time.

Definition at line 66 of file timer.h.


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