# Frost::PeriodicTimer Class Reference

A... periodic timer. More...

`#include <frost_utils_timers.h>`

List of all members.

## Public Types

enum | StartType { START_PAUSED, START_NOW, START_FIRST_TICK }

## Public Member Functions

| PeriodicTimer (const s_double &dDuration, StartType mType, const s_bool &bTicks)
| Default constructor.
s_double | GetElapsed ()
| Returns the time elapsed since the last tick.
const s_double & | GetPeriod () const
| Returns the period of the PeriodicTimer.
const s_bool & | IsPaused () const
| Cheks if this PeriodicTimer is paused.
s_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.

## Static Public Attributes

static const s_str | CLASS_NAME = "PeriodicTimer"

## Private Attributes

s_double | dElapsed_
s_double | dStart_
s_double | dDuration_
s_bool | bPaused_
s_bool | bFirstTick_
StartType | mType_

## 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 frost_utils_timers.h.

## Member Enumeration Documentation

enum Frost::PeriodicTimer::StartType

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 frost_utils_timers.h.

## Constructor & Destructor Documentation

Frost::PeriodicTimer::PeriodicTimer | ( | const s_double & | dDuration,
|  | StartType | mType,
|  | const s_bool & | bTicks |
| ) |  |  |

Default constructor.

Parameters:

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

Definition at line 18 of file frost_utils_timers.cpp.

## Member Function Documentation

s_double Frost::PeriodicTimer::GetElapsed | ( |  | ) |

Returns the time elapsed since the last tick.

Returns:
  The time elapsed since last tick

Definition at line 29 of file frost_utils_timers.cpp.

const s_double & Frost::PeriodicTimer::GetPeriod | ( |  | ) | const

Returns the period of the PeriodicTimer.

Returns:
  The period of the PeriodicTimer

Definition at line 37 of file frost_utils_timers.cpp.

const s_bool & Frost::PeriodicTimer::IsPaused | ( |  | ) | const

Cheks if this PeriodicTimer is paused.

Returns:
  'true' if this PeriodicTimer is paused

Definition at line 42 of file frost_utils_timers.cpp.

void Frost::PeriodicTimer::Pause | ( |  | ) |

Pauses the timer.

Definition at line 89 of file frost_utils_timers.cpp.

void Frost::PeriodicTimer::Start | ( |  | ) |

Starts the timer but doesn't reset it.

Definition at line 80 of file frost_utils_timers.cpp.

void Frost::PeriodicTimer::Stop | ( |  | ) |

Pauses the timer and resets it.

Definition at line 74 of file frost_utils_timers.cpp.

s_bool Frost::PeriodicTimer::Ticks | ( |  | ) |

Checks if the timer's period has been reached.

Returns:
  'true' if the period has been reached

Definition at line 47 of file frost_utils_timers.cpp.

void Frost::PeriodicTimer::Zero | ( |  | ) |

Resets the timer but doesn't pause it.

Definition at line 98 of file frost_utils_timers.cpp.

## Member Data Documentation

s_bool Frost::PeriodicTimer::bFirstTick_`[private]`

Definition at line 82 of file frost_utils_timers.h.

s_bool Frost::PeriodicTimer::bPaused_`[private]`

Definition at line 81 of file frost_utils_timers.h.

const s_str Frost::PeriodicTimer::CLASS_NAME = "PeriodicTimer"`[static]`

Definition at line 74 of file frost_utils_timers.h.

s_double Frost::PeriodicTimer::dDuration_`[private]`

Definition at line 80 of file frost_utils_timers.h.

s_double Frost::PeriodicTimer::dElapsed_`[private]`

Definition at line 78 of file frost_utils_timers.h.

s_double Frost::PeriodicTimer::dStart_`[private]`

Definition at line 79 of file frost_utils_timers.h.

StartType Frost::PeriodicTimer::mType_`[private]`

Definition at line 84 of file frost_utils_timers.h.

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

- D:/Programmation/Sources/Tensor2/Utils/include/frost_utils_timers.h
- D:/Programmation/Sources/Tensor2/Utils/src/frost_utils_timers.cpp