AutoTimer Class Reference

#include <timer.h>

Detailed Description

Helper class to automatically cancel and destroy a timer on shutdown.

This class is useful to automatically cancel and destroy a timer on shutdown. usage: static Global<AutoTimer> g_myTimer; g_myTimer = TimerInterface::AddPeriodicTimer(Seconds(1), []() { ... }, JobQueueInterface::MainThreadQueue());

Public Member Functions

 AutoTimer ()=default
 
 AutoTimer (AutoTimer &&src)
 
MAXON_IMPLICIT AutoTimer (const TimerRef &timerRef)
 
MAXON_IMPLICIT AutoTimer (TimerRef &&timerRef)
 
 ~AutoTimer ()
 
 MAXON_OPERATOR_MOVE_ASSIGNMENT (AutoTimer)
 
AutoTimeroperator= (const TimerRef &timer)
 
AutoTimeroperator= (TimerRef &&timer)
 

Private Attributes

TimerRef _timerRef
 

Constructor & Destructor Documentation

◆ AutoTimer() [1/4]

AutoTimer ( )
default

◆ AutoTimer() [2/4]

AutoTimer ( AutoTimer &&  src)

◆ AutoTimer() [3/4]

MAXON_IMPLICIT AutoTimer ( const TimerRef &  timerRef)

◆ AutoTimer() [4/4]

MAXON_IMPLICIT AutoTimer ( TimerRef &&  timerRef)

◆ ~AutoTimer()

~AutoTimer ( )

Member Function Documentation

◆ MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( AutoTimer  )

◆ operator=() [1/2]

AutoTimer& operator= ( const TimerRef &  timer)

◆ operator=() [2/2]

AutoTimer& operator= ( TimerRef &&  timer)

Member Data Documentation

◆ _timerRef

TimerRef _timerRef
private