An enhanced timer class that can store and track many units of time. More...
#include <extendedtimer.h>
Public Types | |
enum | TimeStruct { Current, Goal, Initial } |
The internal time struct to be used... More... | |
Public Types inherited from Mezzanine::Timer | |
enum | TimerType { Normal, StopWatch, Alarm } |
The style of timer to be used. More... | |
Public Member Functions | |
ExtendedTimer (const Timer::TimerStyle style) | |
Standard Constructor. More... | |
virtual | ~ExtendedTimer () |
Class destructor. | |
virtual Integer | GetDays (const ExtendedTimer::TimeStruct Struct=ExtendedTimer::Current) |
Gets the current internal Day count. More... | |
virtual Integer | GetHours (const ExtendedTimer::TimeStruct Struct=ExtendedTimer::Current) |
Gets the current internal Hour count. More... | |
virtual Integer | GetMilliseconds (const ExtendedTimer::TimeStruct Struct=ExtendedTimer::Current) |
Gets the current internal Millisecond count. More... | |
virtual Integer | GetMinutes (const ExtendedTimer::TimeStruct Struct=ExtendedTimer::Current) |
Gets the current internal Minute count. More... | |
virtual Integer | GetSeconds (const ExtendedTimer::TimeStruct Struct=ExtendedTimer::Current) |
Gets the current internal Second count. More... | |
virtual void | Reset () |
Sets the current values to their initial values. | |
virtual ExtendedTimer & | SetAutoReset (const bool AutoReset) |
Sets whether or not the Timer should reset if it reaches it's goal. Ex. If a stopwatch reaches 0. More... | |
virtual ExtendedTimer & | SetDays (Integer Day, const ExtendedTimer::TimeStruct Struct=ExtendedTimer::Current) |
Sets the value for Days of the specified struct. More... | |
virtual ExtendedTimer & | SetHours (Integer Hr, const ExtendedTimer::TimeStruct Struct=ExtendedTimer::Current) |
Sets the value for Hours of the specified struct. More... | |
virtual ExtendedTimer & | SetMicroseconds (Integer MS, const ExtendedTimer::TimeStruct Struct=ExtendedTimer::Current) |
Sets the value for Microseconds of the specified struct. More... | |
virtual ExtendedTimer & | SetMilliseconds (Integer MS, const ExtendedTimer::TimeStruct Struct=ExtendedTimer::Current) |
Sets the value for Milliseconds of the specified struct. More... | |
virtual ExtendedTimer & | SetMinutes (Integer Min, const ExtendedTimer::TimeStruct Struct=ExtendedTimer::Current) |
Sets the value for Minutes of the specified struct. More... | |
virtual ExtendedTimer & | SetSeconds (Integer Sec, const ExtendedTimer::TimeStruct Struct=ExtendedTimer::Current) |
Sets the value for Seconds of the specified struct. 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 | 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 bool | CheckAll (const ExtendedTimer::TimeStruct Struct) |
virtual bool | CheckDays (const ExtendedTimer::TimeStruct Struct) |
virtual bool | CheckHours (const ExtendedTimer::TimeStruct Struct) |
virtual bool | CheckMicroSeconds (const ExtendedTimer::TimeStruct Struct) |
virtual bool | CheckMilliSeconds (const ExtendedTimer::TimeStruct Struct) |
virtual bool | CheckMinutes (const ExtendedTimer::TimeStruct Struct) |
virtual bool | CheckSeconds (const ExtendedTimer::TimeStruct Struct) |
virtual bool | CompareCurrentAndGoal (const Integer Current, const Integer Goal) |
virtual Time & | GetStruct (const ExtendedTimer::TimeStruct Struct) |
virtual bool | GoalReached () |
virtual void | Update (const Whole MicroSecondsElapsed) |
virtual void | UpdateAsNormal (const Whole MicroSecondsElapsed) |
virtual void | UpdateAsStopWatch (const Whole MicroSecondsElapsed) |
Protected Member Functions inherited from Mezzanine::Timer | |
virtual void | Update () |
Updates all the timings in this timer. More... | |
Protected Attributes | |
Time | CurrentTime |
Time | GoalTime |
Time | InitialTime |
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... | |
An enhanced timer class that can store and track many units of time.
This timer class should be used only for longer periods, such as tracking game uptime. For shorter periods of time look at the SimpleTimer class.
Definition at line 72 of file extendedtimer.h.
The internal time struct to be used...
Enumerator | |
---|---|
Current |
Current description. |
Goal |
Goal description. |
Initial |
Initial description. |
Definition at line 76 of file extendedtimer.h.
Mezzanine::ExtendedTimer::ExtendedTimer | ( | const Timer::TimerStyle | style) |
Standard Constructor.
style | The styling/type of timer to be constructed. |
Definition at line 48 of file extendedtimer.cpp.
|
virtual |
Gets the current internal Day count.
Struct | The Kind of TimeStructure this timer should use, defaults to ExtendedTimer::Current |
Definition at line 367 of file extendedtimer.cpp.
|
virtual |
Gets the current internal Hour count.
Struct | The Kind of TimeStructure this timer should use, defaults to ExtendedTimer::Current |
Definition at line 362 of file extendedtimer.cpp.
|
virtual |
Gets the current internal Millisecond count.
Struct | The Kind of TimeStructure this timer should use, defaults to ExtendedTimer::Current |
Definition at line 347 of file extendedtimer.cpp.
|
virtual |
Gets the current internal Minute count.
Struct | The Kind of TimeStructure this timer should use, defaults to ExtendedTimer::Current |
Definition at line 357 of file extendedtimer.cpp.
|
virtual |
Gets the current internal Second count.
Struct | The Kind of TimeStructure this timer should use, defaults to ExtendedTimer::Current |
Definition at line 352 of file extendedtimer.cpp.
|
virtual |
Sets whether or not the Timer should reset if it reaches it's goal.
Ex. If a stopwatch reaches 0.
Definition at line 294 of file extendedtimer.cpp.
|
virtual |
Sets the value for Days of the specified struct.
Day | The number of Days to set. |
Struct | The Kind of TimeStructure this timer should use, defaults to ExtendedTimer::Current |
Definition at line 341 of file extendedtimer.cpp.
|
virtual |
Sets the value for Hours of the specified struct.
If a number greater then 23 is passed in, it will be reduced to 23.
Hr | The number of Hours to set. |
Struct | The Kind of TimeStructure this timer should use, defaults to ExtendedTimer::Current |
Definition at line 334 of file extendedtimer.cpp.
|
virtual |
Sets the value for Microseconds of the specified struct.
If a number greater then 999 is passed in, it will be reduced to 999.
MS | The number of Microseconds to set. |
Struct | The Kind of TimeStructure this timer should use, defaults to ExtendedTimer::Current |
Definition at line 300 of file extendedtimer.cpp.
|
virtual |
Sets the value for Milliseconds of the specified struct.
If a number greater then 999 is passed in, it will be reduced to 999.
MS | The number of Milliseconds to set. |
Struct | The Kind of TimeStructure this timer should use, defaults to ExtendedTimer::Current |
Definition at line 307 of file extendedtimer.cpp.
|
virtual |
Sets the value for Minutes of the specified struct.
If a number greater then 59 is passed in, it will be reduced to 59.
Min | The number of Minutes to set. |
Struct | The Kind of TimeStructure this timer should use, defaults to ExtendedTimer::Current |
Definition at line 326 of file extendedtimer.cpp.
|
virtual |
Sets the value for Seconds of the specified struct.
If a number greater then 59 is passed in, it will be reduced to 59.
Sec | The number of Seconds to set. |
Struct | The Kind of TimeStructure this timer should use, defaults to ExtendedTimer::Current |
Definition at line 317 of file extendedtimer.cpp.