Kodi Documentation 23.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:
PVR::CPVRPlaybackState::CLastWatchedUpdateTimer

Classes

class  CTimerThread
 

Public Member Functions

 CTimer (ITimerCallback *callback)
 
 CTimer (std::function< void()> const &callback)
 
 CTimer (const CTimer &)=delete
 
CTimer & operator= (const CTimer &)=delete
 
virtual ~CTimer ()
 
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
 

Detailed Description

All timers share one thread, which runs their callbacks one at a time. A callback therefore delays every other timer until it returns, and must not block, for example wait on the main thread.

Constructor & Destructor Documentation

◆ CTimer() [1/3]

CTimer::CTimer ( ITimerCallback * callback)
explicit

◆ CTimer() [2/3]

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

◆ CTimer() [3/3]

CTimer::CTimer ( const CTimer & )
delete

◆ ~CTimer()

CTimer::~CTimer ( )
virtual

Member Function Documentation

◆ GetElapsedMilliseconds()

float CTimer::GetElapsedMilliseconds ( ) const

◆ GetElapsedSeconds()

float CTimer::GetElapsedSeconds ( ) const

◆ IsRunning()

bool CTimer::IsRunning ( ) const

◆ operator=()

CTimer & CTimer::operator= ( const CTimer & )
delete

◆ 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: