Harlequin RIP SDK
SW_TIMER_20110324 Struct Reference

Timed callback function pointer API version 20110324. More...

#include "timerapi.h"

Data Fields

hqn_timer_t *(* hqn_timer_create )(unsigned int first, unsigned int repeat, hqn_timer_callback_fn *callback, void *data)
 Create a timer to call a function on a timed schedule. More...
 
void(* hqn_timer_reset )(hqn_timer_t *timer, unsigned int next, unsigned int repeat)
 Set new delay and period for calling a timed callback. More...
 
void(* hqn_timer_destroy )(hqn_timer_t *timer)
 Destroy a timer event. More...
 

Detailed Description

Timed callback function pointer API version 20110324.

Field Documentation

◆ hqn_timer_create

hqn_timer_t*( * SW_TIMER_20110324::hqn_timer_create) (unsigned int first, unsigned int repeat, hqn_timer_callback_fn *callback, void *data)

Create a timer to call a function on a timed schedule.

Parameters
[in]firstTime before the first call, in milliseconds. If the time before the first call is zero then the callback will be called immediately.
[in]repeatTime between subsequent calls, in milliseconds. If the time between subsequent calls is zero then the callback will be called just once.
[in]callbackFunction to be called when the timer expires, with data passed to the function.
[in]dataPointer passed to the callback function.
Returns
Timer handle for use in hqn_timer_destroy() or hqn_timer_reset(), or NULL if the timer could not be created.
Note
A repeat time of less than 20ms is not recommended. At these short periods the operating system's scheduler time quanta becomes significant and the time between calls could vary considerably compared to that requested.

◆ hqn_timer_destroy

void( * SW_TIMER_20110324::hqn_timer_destroy) (hqn_timer_t *timer)

Destroy a timer event.

After a call to this function a timed callback will not happen, even if it has not yet been called.

Parameters
[in]timerHandle of the timer to destroy.
Note
The timer subsystem does not enforce any interpretation of the data pointer passed to the hqn_timer_create() function. If the data is allocated, its lifetime must be at least as long as the timer handle.

◆ hqn_timer_reset

void( * SW_TIMER_20110324::hqn_timer_reset) (hqn_timer_t *timer, unsigned int next, unsigned int repeat)

Set new delay and period for calling a timed callback.

Parameters
[in]timerHandle of the timer to reset.
[in]nextTime delay to the next call, in milliseconds.
[in]repeatTime delay between subsequent calls, in milliseconds.
Note
This function has not yet been implemented.

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