Blender V4.3
BLI_timer.c File Reference
#include "BLI_timer.h"
#include "BLI_listbase.h"
#include "BLI_time.h"
#include "MEM_guardedalloc.h"

Go to the source code of this file.

Classes

struct  TimedFunction
struct  TimerContainer

Macros

#define GET_TIME()

Typedefs

typedef struct TimedFunction TimedFunction
typedef struct TimerContainer TimerContainer

Functions

void BLI_timer_register (uintptr_t uuid, BLI_timer_func func, void *user_data, BLI_timer_data_free user_data_free, double first_interval, bool persistent)
static void clear_user_data (TimedFunction *timed_func)
bool BLI_timer_unregister (uintptr_t uuid)
bool BLI_timer_is_registered (uintptr_t uuid)
static void execute_functions_if_necessary (void)
static void remove_tagged_functions (void)
void BLI_timer_execute (void)
void BLI_timer_free (void)
static void remove_non_persistent_functions (void)
void BLI_timer_on_file_load (void)

Variables

static TimerContainer GlobalTimer = {{0}}

Macro Definition Documentation

◆ GET_TIME

#define GET_TIME ( )
Value:
double BLI_time_now_seconds(void)
Definition time.c:65

Definition at line 15 of file BLI_timer.c.

Referenced by BLI_timer_register(), and execute_functions_if_necessary().

Typedef Documentation

◆ TimedFunction

typedef struct TimedFunction TimedFunction

◆ TimerContainer

typedef struct TimerContainer TimerContainer

Function Documentation

◆ BLI_timer_execute()

void BLI_timer_execute ( void )

Execute all registered functions that are due.

Definition at line 118 of file BLI_timer.c.

References execute_functions_if_necessary(), and remove_tagged_functions().

Referenced by wm_event_timers_execute().

◆ BLI_timer_free()

void BLI_timer_free ( void )

Definition at line 124 of file BLI_timer.c.

References GlobalTimer, LISTBASE_FOREACH, and remove_tagged_functions().

Referenced by WM_exit_ex().

◆ BLI_timer_is_registered()

bool BLI_timer_is_registered ( uintptr_t uuid)

Definition at line 73 of file BLI_timer.c.

References GlobalTimer, and LISTBASE_FOREACH.

Referenced by bpy_app_timers_is_registered().

◆ BLI_timer_on_file_load()

void BLI_timer_on_file_load ( void )

Definition at line 142 of file BLI_timer.c.

References remove_non_persistent_functions().

Referenced by wm_file_read_pre().

◆ BLI_timer_register()

◆ BLI_timer_unregister()

bool BLI_timer_unregister ( uintptr_t uuid)

Returns False when the timer does not exist (anymore).

Definition at line 61 of file BLI_timer.c.

References clear_user_data(), GlobalTimer, and LISTBASE_FOREACH.

Referenced by bpy_app_timers_unregister().

◆ clear_user_data()

void clear_user_data ( TimedFunction * timed_func)
static

◆ execute_functions_if_necessary()

void execute_functions_if_necessary ( void )
static

Definition at line 83 of file BLI_timer.c.

References GET_TIME, GlobalTimer, LISTBASE_FOREACH, and ret.

Referenced by BLI_timer_execute().

◆ remove_non_persistent_functions()

void remove_non_persistent_functions ( void )
static

Definition at line 133 of file BLI_timer.c.

References GlobalTimer, and LISTBASE_FOREACH.

Referenced by BLI_timer_on_file_load().

◆ remove_tagged_functions()

void remove_tagged_functions ( void )
static

Definition at line 106 of file BLI_timer.c.

References BLI_freelinkN(), clear_user_data(), GlobalTimer, and next.

Referenced by BLI_timer_execute(), and BLI_timer_free().

Variable Documentation

◆ GlobalTimer