GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_timer Struct Reference

A timer. More...

#include <gp_timer.h>

Collaboration diagram for gp_timer:

Data Fields

uint64_t expires
 Initial xpiration time, set by user, modified by the queue.
 
const char * id
 Timer name showed in debug messages.
 
uint32_t period
 User variable may be used to store the timer period.
 
uint32_t running:1
 Set if timer is inserted into a queue.
 
uint32_t in_callback:1
 Set during the run of the timer callback.
 
uint32_t res_in_callback:1
 Set if timer was rescheduled from callback.
 
uint32_t free_on_stop:1
 Set if gp_timer_free() was called when timer was running.
 
void * _priv
 Library private pointer. Do not touch!
 
uint32_t(* callback )(struct gp_timer *self)
 Timer callback.
 
void * priv
 A user private pointer.
 
void(* stopped )(gp_timer *self)
 An optional function to cleanup when timer is stopped.
 

Detailed Description

A timer.

Definition at line 26 of file gp_timer.h.

Field Documentation

◆ callback

uint32_t(* gp_timer::callback) (struct gp_timer *self)

Timer callback.

Unless GP_TIMER_STOP is returned the timer is rescheduled to expire return value from now.

Definition at line 70 of file gp_timer.h.

◆ free_on_stop

uint32_t gp_timer::free_on_stop

Set if gp_timer_free() was called when timer was running.

This defferes freeing the timer memory afte the timer is stopped.

Definition at line 57 of file gp_timer.h.

◆ period

uint32_t gp_timer::period

User variable may be used to store the timer period.

This field is not used by the timer code and is usually returned from the callback to reschedule periodic timers.

Definition at line 44 of file gp_timer.h.

◆ stopped

void(* gp_timer::stopped) (gp_timer *self)

An optional function to cleanup when timer is stopped.

When non-NULL this function is called when timer is stopped. Timer can be either stopped when gp_timer::callback returns GP_TIMER_STOP or when a timer was removed from the queue.

It is safe to free dynamically alocated timers from this callback.

Definition at line 84 of file gp_timer.h.


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