Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CTimer Class Reference

#include <Timer.h>

Inheritance diagram for CTimer:
CThread PVR::CPVRPlaybackState::CLastWatchedUpdateTimer

Public Member Functions

 CTimer (ITimerCallback *callback)
 
 CTimer (std::function< void()> const &callback)
 
 ~CTimer () override
 
bool Start (std::chrono::milliseconds timeout, bool interval=false)
 
bool Stop (bool wait=false)
 
bool Restart ()
 
void RestartAsync (std::chrono::milliseconds timeout)
 
bool IsRunning () const
 
float GetElapsedSeconds () const
 
float GetElapsedMilliseconds () const
 

Protected Member Functions

void Process () override
 
- Protected Member Functions inherited from CThread
 CThread (const char *ThreadName)
 
virtual void OnStartup ()
 
virtual void OnExit ()
 
WaitResponse AbortableWait (CEvent &event, std::chrono::milliseconds duration=std::chrono::milliseconds(-1))
 
 CThread (IRunnable *pRunnable, const char *ThreadName)
 
virtual ~CThread ()
 
void Create (bool bAutoDelete=false)
 
template<typename Rep , typename Period >
void Sleep (std::chrono::duration< Rep, Period > duration)
 
bool IsAutoDelete () const
 
virtual void StopThread (bool bWait=true)
 
bool IsRunning () const
 
bool IsCurrentThread () const
 
bool Join (std::chrono::milliseconds duration)
 
bool SetPriority (const ThreadPriority &priority)
 Set the threads priority. This uses the platforms native threading library to do so.
 
virtual void OnException ()
 

Additional Inherited Members

- Protected Types inherited from CThread
enum  WaitResponse { WAIT_INTERRUPTED = -1 , WAIT_SIGNALED = 0 , WAIT_TIMEDOUT = 1 }
 
- Static Protected Member Functions inherited from CThread
static const std::thread::id GetCurrentThreadId ()
 
static CThreadGetCurrentThread ()
 
- Protected Attributes inherited from CThread
std::atomic< boolm_bStop
 

Constructor & Destructor Documentation

◆ CTimer() [1/2]

CTimer::CTimer ( ITimerCallback * callback)
explicit

◆ CTimer() [2/2]

CTimer::CTimer ( std::function< void()> const & callback)
explicit

◆ ~CTimer()

CTimer::~CTimer ( )
override

Member Function Documentation

◆ GetElapsedMilliseconds()

float CTimer::GetElapsedMilliseconds ( ) const

◆ GetElapsedSeconds()

float CTimer::GetElapsedSeconds ( ) const

◆ IsRunning()

bool CTimer::IsRunning ( ) const
inline

◆ Process()

void CTimer::Process ( void )
overrideprotectedvirtual

Reimplemented from CThread.

◆ Restart()

bool CTimer::Restart ( )

◆ RestartAsync()

void CTimer::RestartAsync ( std::chrono::milliseconds timeout)

◆ Start()

bool CTimer::Start ( std::chrono::milliseconds timeout,
bool interval = false )

◆ Stop()

bool CTimer::Stop ( bool wait = false)

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