Clapkit
Loading...
Searching...
No Matches
CKTimer Class Reference

Defines a timer that can execute code on a pre-defined interval. More...

#include <ckTimer.h>

Inheritance diagram for CKTimer:
CKObject

Public Member Functions

 CKTimer ()
 
virtual ~CKTimer ()
 
bool Update ()
 Let the timer check if its appropriate to run.
 
void Start ()
 
void Stop ()
 
- Public Member Functions inherited from CKObject
 CKObject ()
 
virtual ~CKObject ()
 
virtual void AddHandler (CKEventType type, CKEventHandlerFunc cb)
 
virtual void RemoveHandler (CKEventType type)
 
virtual bool HasHandler (CKEventType type) const
 
virtual bool HandleEvent (const CKEvent &evt)
 
virtual void SetPropertyObserver (CKPropertyObserverFunc cb)
 
virtual void UnsetPropertyObserver ()
 
virtual void RaisePropertyChange (const char *propertyName)
 

Public Attributes

bool enabled = false
 
bool multiRun = true
 
UInt16 interval = 1000
 
UInt32 nextRun
 
CKTimerCallbackFunc callback
 
void * userData = nullptr
 
CKObjectowner = nullptr
 
CKAppapp = nullptr
 

Additional Inherited Members

- Protected Attributes inherited from CKObject
std::map< CKEventType, CKEventHandlerFunc__handlers
 
CKPropertyObserverFunc propertyObserverCB = nullptr
 

Detailed Description

Defines a timer that can execute code on a pre-defined interval.

Constructor & Destructor Documentation

◆ CKTimer()

CKTimer::CKTimer ( )

◆ ~CKTimer()

CKTimer::~CKTimer ( )
virtual

Member Function Documentation

◆ Start()

void CKTimer::Start ( )

◆ Stop()

void CKTimer::Stop ( )

◆ Update()

bool CKTimer::Update ( )

Let the timer check if its appropriate to run.

Returns
Returns false if timer needs to be removed from the queue / destroyed.

Member Data Documentation

◆ app

CKApp* CKTimer::app = nullptr

◆ callback

CKTimerCallbackFunc CKTimer::callback

◆ enabled

bool CKTimer::enabled = false

◆ interval

UInt16 CKTimer::interval = 1000

◆ multiRun

bool CKTimer::multiRun = true

◆ nextRun

UInt32 CKTimer::nextRun

◆ owner

CKObject* CKTimer::owner = nullptr

◆ userData

void* CKTimer::userData = nullptr

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