libcmutils 0.6.5
Multi-platform C99 utility library
Loading...
Searching...
No Matches
CMUTIL_Timer Struct Reference

Timer object for scheduling tasks. More...

Data Fields

CMUTIL_TimerTask *(* ScheduleAtTime )(CMUTIL_Timer *timer, struct timeval *attime, CMProcCB proc, void *param)
 Schedule a task to run at a specific time.
 
CMUTIL_TimerTask *(* ScheduleDelay )(CMUTIL_Timer *timer, long delay, CMProcCB proc, void *param)
 Schedule a task to run after a specified delay.
 
CMUTIL_TimerTask *(* ScheduleAtRepeat )(CMUTIL_Timer *timer, struct timeval *first, long period, CMBool elapse_skip, CMProcCB proc, void *param)
 Schedule a task to run repeatedly at fixed intervals, starting at a specific time.
 
CMUTIL_TimerTask *(* ScheduleDelayRepeat )(CMUTIL_Timer *timer, long delay, long period, CMBool elapse_skip, CMProcCB proc, void *param)
 Schedule a task to run repeatedly at fixed intervals, starting after a specified delay.
 
void(* Purge )(CMUTIL_Timer *timer)
 Purge all scheduled tasks from the timer.
 
void(* Destroy )(CMUTIL_Timer *timer)
 Destroy the timer object and free its resources.
 

Detailed Description

Timer object for scheduling tasks.

Field Documentation

◆ ScheduleAtTime

CMUTIL_TimerTask *(* CMUTIL_Timer::ScheduleAtTime) (CMUTIL_Timer *timer, struct timeval *attime, CMProcCB proc, void *param)

Schedule a task to run at a specific time.

Parameters
timerThe timer object used to schedule the task.
attimeThe absolute time at which to run the task.
procThe callback function to execute when the task is run.
paramA user-defined parameter to pass to the callback function.
Returns
A handle to the scheduled timer task.

◆ ScheduleDelay

CMUTIL_TimerTask *(* CMUTIL_Timer::ScheduleDelay) (CMUTIL_Timer *timer, long delay, CMProcCB proc, void *param)

Schedule a task to run after a specified delay.

Parameters
timerThe timer object used to schedule the task.
delayThe delay in milliseconds before the task is run.
procThe callback function to execute when the task is run.
paramA user-defined parameter to pass to the callback function.
Returns
A handle to the scheduled timer task.

◆ ScheduleAtRepeat

CMUTIL_TimerTask *(* CMUTIL_Timer::ScheduleAtRepeat) (CMUTIL_Timer *timer, struct timeval *first, long period, CMBool elapse_skip, CMProcCB proc, void *param)

Schedule a task to run repeatedly at fixed intervals, starting at a specific time.

Parameters
timerThe timer object used to schedule the task.
firstThe absolute time at which to run the first execution of the task.
periodThe interval in milliseconds between subsequent executions of the task.
elapse_skipIf CMTrue, the task will skip elapsed time intervals when it is delayed.
procThe callback function to execute when the task is run.
paramA user-defined parameter to pass to the callback function.
Returns
A handle to the scheduled timer task.

◆ ScheduleDelayRepeat

CMUTIL_TimerTask *(* CMUTIL_Timer::ScheduleDelayRepeat) (CMUTIL_Timer *timer, long delay, long period, CMBool elapse_skip, CMProcCB proc, void *param)

Schedule a task to run repeatedly at fixed intervals, starting after a specified delay.

Parameters
timerThe timer object used to schedule the task.
delayThe delay in milliseconds before the first execution of the task.
periodThe interval in milliseconds between subsequent executions of the task.
elapse_skipIf CMTrue, the task will skip elapsed time intervals when it is delayed.
procThe callback function to execute when the task is run.
paramA user-defined parameter to pass to the callback function.
Returns
A handle to the scheduled timer task.

◆ Purge

void(* CMUTIL_Timer::Purge) (CMUTIL_Timer *timer)

Purge all scheduled tasks from the timer.

This function removes all tasks that have been scheduled on the timer, effectively clearing the task queue.

Parameters
timerThe timer object from which to purge tasks.

◆ Destroy

void(* CMUTIL_Timer::Destroy) (CMUTIL_Timer *timer)

Destroy the timer object and free its resources.

This function stops the timer and releases all associated resources. Any scheduled tasks that have not yet executed will be canceled.

Parameters
timerThe timer object to be destroyed.

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