StopWatch Class Reference

StopWatch Class Reference

#include <StopWatch.h>

+ Inheritance diagram for StopWatch:

Public Types

enum  TimerState { PLAYING =0, PAUSED, STOPPED }
 Three timer states are defined. More...
 

Public Member Functions

UtilExport StopWatch ()
 Construct the StopWatch Object. More...
 
UtilExport void Start ()
 This method lets you start to trace the time and changes the current state to PLAYING. More...
 
UtilExport void Pause ()
 This method lets you pause to trace the time and changes the current state to PAUSED. More...
 
UtilExport void Resume ()
 This method lets you resume to trace the time and changes the current state to PLAYING. More...
 
UtilExport void Stop ()
 This method lets you stop to trace the time and changes the current state to STOPPED. More...
 
UtilExport void Reset ()
 This method lets you clear the time traced and changes the current state to STOPPED. More...
 
UtilExport bool IsRunning () const
 This method lets you know whether the timer is running. More...
 
UtilExport bool IsPaused () const
 This method lets you know whether the timer is paused. More...
 
UtilExport bool IsStopped () const
 This method lets you know whether the timer is stopped. More...
 
UtilExport TimerState GetTimerCurrentState () const
 This method lets you know what the current timer state is. More...
 
UtilExport double GetElapsedTime () const
 This method lets you get the elapsed time(milliseconds) traced. More...
 
UtilExport void GetLocalTime (SYSTEMTIME *time) const
 Retrieves the current local time. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

Member Enumeration Documentation

enum TimerState

Three timer states are defined.

Enumerator
PLAYING 

If timer is running, the state is defined as PLAYING and means that the timer is timing now.

PAUSED 

If timer is paused, the state is defined as PAUSED and means that the timer pauses to time unless doing Resume.

STOPPED 

If timer is stopped, the state is defined as STOPPED and means that the timer stops to time unless doing Start.

56  {
58  PLAYING =0,
60  PAUSED ,
62  STOPPED
63  };
If timer is paused, the state is defined as PAUSED and means that the timer pauses to time unless doi...
Definition: StopWatch.h:60
If timer is stopped, the state is defined as STOPPED and means that the timer stops to time unless do...
Definition: StopWatch.h:62
If timer is running, the state is defined as PLAYING and means that the timer is timing now...
Definition: StopWatch.h:58

Constructor & Destructor Documentation

Construct the StopWatch Object.

Member Function Documentation

UtilExport void Start ( )

This method lets you start to trace the time and changes the current state to PLAYING.

UtilExport void Pause ( )

This method lets you pause to trace the time and changes the current state to PAUSED.

UtilExport void Resume ( )

This method lets you resume to trace the time and changes the current state to PLAYING.

UtilExport void Stop ( )

This method lets you stop to trace the time and changes the current state to STOPPED.

UtilExport void Reset ( )

This method lets you clear the time traced and changes the current state to STOPPED.

UtilExport bool IsRunning ( ) const

This method lets you know whether the timer is running.

UtilExport bool IsPaused ( ) const

This method lets you know whether the timer is paused.

UtilExport bool IsStopped ( ) const

This method lets you know whether the timer is stopped.

UtilExport TimerState GetTimerCurrentState ( ) const

This method lets you know what the current timer state is.

UtilExport double GetElapsedTime ( ) const

This method lets you get the elapsed time(milliseconds) traced.

UtilExport void GetLocalTime ( SYSTEMTIME *  time) const

Retrieves the current local time.