CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::TTimer< Clock > Class Template Reference

#include <CeresEngine/Foundation/IO/Timer.hpp>

Public Types

using TimePoint = typename Clock::time_point
 
using Duration = typename Clock::duration
 
using Callback = UniqueFunction< void(TTimer *)>
 

Public Member Functions

 TTimer (AnyIOExecutor executor, Duration duration, Callback callback, bool repeating=false)
 
 TTimer (AnyIOExecutor executor, Duration duration, Callback callback, Duration repeatInterval)
 
 TTimer (AnyIOExecutor executor, TimePoint timePoint, Callback callback)
 
 TTimer (AnyIOExecutor executor, TimePoint timePoint, Callback callback, Duration repeatInterval)
 
 ~TTimer () noexcept
 

Static Public Member Functions

static UPtr< TTimercreate (AnyIOExecutor executor, Duration duration, Callback callback, bool repeating=false)
 
static UPtr< TTimercreate (AnyIOExecutor executor, Duration duration, Callback callback, Duration repeatInterval)
 
static UPtr< TTimercreate (AnyIOExecutor executor, TimePoint timePoint, Callback callback)
 
static UPtr< TTimercreate (AnyIOExecutor executor, TimePoint timePoint, Callback callback, Duration repeatInterval)
 

Private Types

using TimerType = asio::basic_waitable_timer< Clock, asio::wait_traits< Clock >, AnyIOExecutor >
 

Private Member Functions

void setup (Duration duration)
 
void setup (TimePoint timePoint)
 
void fire ()
 

Private Attributes

TimerType mTimer
 
Callback mCallback
 
bool mRepeating = false
 
Duration mRepeatInterval
 

Member Typedef Documentation

◆ Callback

◆ Duration

template<typename Clock >
using CeresEngine::TTimer< Clock >::Duration = typename Clock::duration

◆ TimePoint

template<typename Clock >
using CeresEngine::TTimer< Clock >::TimePoint = typename Clock::time_point

◆ TimerType

template<typename Clock >
using CeresEngine::TTimer< Clock >::TimerType = asio::basic_waitable_timer<Clock, asio::wait_traits<Clock>, AnyIOExecutor>
private

Constructor & Destructor Documentation

◆ TTimer() [1/4]

template<typename Clock >
CeresEngine::TTimer< Clock >::TTimer ( AnyIOExecutor  executor,
Duration  duration,
Callback  callback,
bool  repeating = false 
)

◆ TTimer() [2/4]

template<typename Clock >
CeresEngine::TTimer< Clock >::TTimer ( AnyIOExecutor  executor,
Duration  duration,
Callback  callback,
Duration  repeatInterval 
)

◆ TTimer() [3/4]

template<typename Clock >
CeresEngine::TTimer< Clock >::TTimer ( AnyIOExecutor  executor,
TimePoint  timePoint,
Callback  callback 
)

◆ TTimer() [4/4]

template<typename Clock >
CeresEngine::TTimer< Clock >::TTimer ( AnyIOExecutor  executor,
TimePoint  timePoint,
Callback  callback,
Duration  repeatInterval 
)

◆ ~TTimer()

template<typename Clock >
CeresEngine::TTimer< Clock >::~TTimer ( )
noexcept

Member Function Documentation

◆ create() [1/4]

template<typename Clock >
static UPtr< TTimer > CeresEngine::TTimer< Clock >::create ( AnyIOExecutor  executor,
Duration  duration,
Callback  callback,
bool  repeating = false 
)
static

◆ create() [2/4]

template<typename Clock >
static UPtr< TTimer > CeresEngine::TTimer< Clock >::create ( AnyIOExecutor  executor,
Duration  duration,
Callback  callback,
Duration  repeatInterval 
)
static

◆ create() [3/4]

template<typename Clock >
static UPtr< TTimer > CeresEngine::TTimer< Clock >::create ( AnyIOExecutor  executor,
TimePoint  timePoint,
Callback  callback 
)
static

◆ create() [4/4]

template<typename Clock >
static UPtr< TTimer > CeresEngine::TTimer< Clock >::create ( AnyIOExecutor  executor,
TimePoint  timePoint,
Callback  callback,
Duration  repeatInterval 
)
static

◆ fire()

template<typename Clock >
void CeresEngine::TTimer< Clock >::fire ( )
private

◆ setup() [1/2]

template<typename Clock >
void CeresEngine::TTimer< Clock >::setup ( Duration  duration)
private

◆ setup() [2/2]

template<typename Clock >
void CeresEngine::TTimer< Clock >::setup ( TimePoint  timePoint)
private

Member Data Documentation

◆ mCallback

template<typename Clock >
Callback CeresEngine::TTimer< Clock >::mCallback
private

◆ mRepeating

template<typename Clock >
bool CeresEngine::TTimer< Clock >::mRepeating = false
private

◆ mRepeatInterval

template<typename Clock >
Duration CeresEngine::TTimer< Clock >::mRepeatInterval
private

◆ mTimer

template<typename Clock >
TimerType CeresEngine::TTimer< Clock >::mTimer
private

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