OpenTTD Source: BaseTimer< TTimerType > Class Template Reference

OpenTTD Source 14.0-RC3

Public Types | Public Member Functions | Data Fields | Protected Member Functions | Friends
BaseTimer< TTimerType > Class Template Referenceabstract

The base where every other type of timer is derived from. More...

`#include <timer.h>`

Inheritance diagram for BaseTimer< TTimerType >:

## Public Types
using | TPeriod = typename TTimerType::TPeriod
using | TElapsed = typename TTimerType::TElapsed
using | TStorage = typename TTimerType::TStorage

## Public Member Functions
| BaseTimer (const TPeriod period)
| Create a new timer. More...
virtual | ~BaseTimer ()
| Delete the timer.

## Data Fields
TPeriod | period
| The period of the timer.
TStorage | storage = {}
| The storage of the timer.

## Protected Member Functions
virtual void | Elapsed (TElapsed delta)=0
| Called by the timer manager to notify the timer that the given amount of time has elapsed. More...

## Friends
class | TimerManager< TTimerType >

## Detailed Description

### template<typename TTimerType>
class BaseTimer< TTimerType >

The base where every other type of timer is derived from.

Never use this class directly yourself.

Note
  don't include this file; include "timer.h".

Definition at line 22 of file timer.h.

## Constructor & Destructor Documentation

## ◆ BaseTimer()

template<typename TTimerType >

BaseTimer< TTimerType >::BaseTimer | ( | const TPeriod | period | ) |
| inline

Create a new timer.

Parameters

  period | The period of the timer.

Definition at line 33 of file timer.h.

## Member Function Documentation

## ◆ Elapsed()

template<typename TTimerType >

virtual void BaseTimer< TTimerType >::Elapsed | ( | TElapsed | delta | ) |
| protectedpure virtual

Called by the timer manager to notify the timer that the given amount of time has elapsed.

Parameters

  delta | Depending on the time type, this is either in milliseconds or in ticks.

Implemented in TimeoutTimer< TTimerType >, TimeoutTimer< TimerWindow >, IntervalTimer< TTimerType >, IntervalTimer< TimerWindow >, IntervalTimer< TimerGameTick >, and IntervalTimer< TimerGameCalendar >.

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

- src/timer/timer.h