docs
Loading...
Searching...
No Matches
TimerHandle

#include <AppCore/App.h>

Overview

Handle to a repeating timer created with App::SetInterval().

The handle owns the timer. Destroying it (or calling Cancel()) stops the timer and destroys its user data. Handles are move-only and should be destroyed on the main thread.

Public Member Functions

 TimerHandle ()
 Create an empty handle that refers to no timer.
 ~TimerHandle ()
 Cancel the timer, if any.
 TimerHandle (TimerHandle &&other) noexcept
 Move constructor (the source is left empty).
TimerHandle & operator= (TimerHandle &&other) noexcept
 Move assignment.
 TimerHandle (const TimerHandle &)=delete
TimerHandle & operator= (const TimerHandle &)=delete
void Cancel ()
 Stop the timer and destroy its user data.
 operator bool () const
 Whether or not this handle still refers to a timer (false after Cancel() or a move).

Friends

class AppImpl

Constructor & Destructor Documentation

◆ TimerHandle() [1/3]

TimerHandle ( )
inline

Create an empty handle that refers to no timer.

◆ ~TimerHandle()

~TimerHandle ( )
inline

Cancel the timer, if any.

◆ TimerHandle() [2/3]

TimerHandle ( TimerHandle && other)
inlinenoexcept

Move constructor (the source is left empty).

◆ TimerHandle() [3/3]

TimerHandle ( const TimerHandle & )
delete

Member Function Documentation

◆ Cancel()

void Cancel ( )
inline

Stop the timer and destroy its user data.

Safe to call more than once.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Whether or not this handle still refers to a timer (false after Cancel() or a move).

◆ operator=() [1/2]

TimerHandle & operator= ( const TimerHandle & )
delete

◆ operator=() [2/2]

TimerHandle & operator= ( TimerHandle && other)
inlinenoexcept

Move assignment.

Cancels the timer this handle held, if any; the source is left empty.

◆ AppImpl

friend class AppImpl
friend

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