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

This is the base class for timers intended to run only until they reach a specific goal. More...

#include <timer.h>

+ Inheritance diagram for Mezzanine::GoalTimer:
+ Collaboration diagram for Mezzanine::GoalTimer:

Public Member Functions

 GoalTimer ()
 Class constructor.
 
virtual ~GoalTimer ()
 Class destructor.
 
virtual Boolean GetAutoReset () const
 Gets whether or not this Timer will reset when it reaches it's goal. More...
 
virtual Whole GetGoalTime () const
 Gets the Goal time in Microseconds. More...
 
virtual Whole GetGoalTimeInMilliseconds () const
 Gets the Goal time in Milliseconds. More...
 
virtual void SetAutoReset (const bool AutoReset)
 Sets whether or not this Timer should reset if it reaches it's goal. More...
 
virtual void SetGoalTime (const Whole Goal)
 Sets the goal time in Microseconds. More...
 
virtual void SetGoalTimeInMilliseconds (const Whole Goal)
 Sets the goal time in Milliseconds. More...
 
- Public Member Functions inherited from Mezzanine::Timer
 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 Boolean GoalReached ()=0
 Checks to see if the goal has been attained as dictated by the type of timer this is. More...
 
- Protected Member Functions inherited from Mezzanine::Timer
virtual void Update ()
 Updates all the timings in this timer. More...
 

Protected Attributes

MaxInt GoalTime
 The time this timer should stop at. More...
 
Boolean ResetAtGoal
 Wether or not this timer will reset itself when it reaches it's goal. More...
 
- Protected Attributes inherited from Mezzanine::Timer
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...
 

Additional Inherited Members

- Public Types inherited from Mezzanine::Timer
enum  TimerType { Normal, StopWatch, Alarm }
 The style of timer to be used. More...
 

Detailed Description

This is the base class for timers intended to run only until they reach a specific goal.

Definition at line 133 of file timer.h.

Member Function Documentation

Boolean Mezzanine::GoalTimer::GetAutoReset ( ) const
virtual

Gets whether or not this Timer will reset when it reaches it's goal.

Returns
Returns true if this timer will automatically reset when it reaches it's goal.

Definition at line 141 of file timer.cpp.

Whole Mezzanine::GoalTimer::GetGoalTime ( ) const
virtual

Gets the Goal time in Microseconds.

Returns
Returns a Whole representing the goal time in Microseconds.

Definition at line 150 of file timer.cpp.

Whole Mezzanine::GoalTimer::GetGoalTimeInMilliseconds ( ) const
virtual

Gets the Goal time in Milliseconds.

Returns
Returns a Whole representing the goal time in Milliseconds.

Definition at line 153 of file timer.cpp.

virtual Boolean Mezzanine::GoalTimer::GoalReached ( )
protectedpure virtual

Checks to see if the goal has been attained as dictated by the type of timer this is.

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

void Mezzanine::GoalTimer::SetAutoReset ( const bool  AutoReset)
virtual

Sets whether or not this Timer should reset if it reaches it's goal.

Parameters
AutoResetShould be true if you want this timer to reset itself back to it's initial time when it reaches it's goal.

Definition at line 138 of file timer.cpp.

void Mezzanine::GoalTimer::SetGoalTime ( const Whole  Goal)
virtual

Sets the goal time in Microseconds.

Parameters
GoalThe value to set as goal time in Microseconds.

Definition at line 144 of file timer.cpp.

void Mezzanine::GoalTimer::SetGoalTimeInMilliseconds ( const Whole  Goal)
virtual

Sets the goal time in Milliseconds.

Parameters
GoalThe value to set as goal time in Milliseconds.

Definition at line 147 of file timer.cpp.

Member Data Documentation

MaxInt Mezzanine::GoalTimer::GoalTime
protected

The time this timer should stop at.

Definition at line 138 of file timer.h.

Boolean Mezzanine::GoalTimer::ResetAtGoal
protected

Wether or not this timer will reset itself when it reaches it's goal.

Definition at line 141 of file timer.h.


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