Flecs: Function types.
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.0 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
Function types.
C API » Core » API types

Function callback types. More...

Collaboration diagram for Function types.:

## Typedefs
typedef void(* | ecs_run_action_t) (ecs_iter_t *it)
| Function prototype for runnables (systems, observers).
typedef void(* | ecs_iter_action_t) (ecs_iter_t *it)
| Function prototype for iterables.
typedef bool(* | ecs_iter_next_action_t) (ecs_iter_t *it)
| Function prototype for iterating an iterator.
typedef void(* | ecs_iter_fini_action_t) (ecs_iter_t *it)
| Function prototype for freeing an iterator.
typedef int(* | ecs_order_by_action_t) (ecs_entity_t e1, const void *ptr1, ecs_entity_t e2, const void *ptr2)
| Callback used for comparing components.
typedef void(* | ecs_sort_table_action_t) (ecs_world_t *world, ecs_table_t *table, ecs_entity_t *entities, void *ptr, int32_t size, int32_t lo, int32_t hi, ecs_order_by_action_t order_by)
| Callback used for sorting the entire table of components.
typedef uint64_t(* | ecs_group_by_action_t) (ecs_world_t *world, ecs_table_t *table, ecs_id_t group_id, void *ctx)
| Callback used for grouping tables in a query.
typedef void *(* | ecs_group_create_action_t) (ecs_world_t *world, uint64_t group_id, void *group_by_ctx)
| Callback invoked when a query creates a new group.
typedef void(* | ecs_group_delete_action_t) (ecs_world_t *world, uint64_t group_id, void *group_ctx, void *group_by_ctx)
| Callback invoked when a query deletes an existing group.
typedef void(* | ecs_module_action_t) (ecs_world_t *world)
| Initialization action for modules.
typedef void(* | ecs_fini_action_t) (ecs_world_t *world, void *ctx)
| Action callback on world exit.
typedef void(* | ecs_ctx_free_t) (void *ctx)
| Function to cleanup context data.
typedef int(* | ecs_compare_action_t) (const void *ptr1, const void *ptr2)
| Callback used for sorting values.
typedef uint64_t(* | ecs_hash_value_action_t) (const void *ptr)
| Callback used for hashing values.
typedef void(* | ecs_xtor_t) (void *ptr, int32_t count, const ecs_type_info_t *type_info)
| Constructor/destructor callback.
typedef void(* | ecs_copy_t) (void *dst_ptr, const void *src_ptr, int32_t count, const ecs_type_info_t *type_info)
| Copy is invoked when a component is copied into another component.
typedef void(* | ecs_move_t) (void *dst_ptr, void *src_ptr, int32_t count, const ecs_type_info_t *type_info)
| Move is invoked when a component is moved to another component.
typedef int(* | ecs_cmp_t) (const void *a_ptr, const void *b_ptr, const ecs_type_info_t *type_info)
| Compare hook to compare component instances.
typedef bool(* | ecs_equals_t) (const void *a_ptr, const void *b_ptr, const ecs_type_info_t *type_info)
| Equals operator hook.
typedef void(* | flecs_poly_dtor_t) (ecs_poly_t *poly)
| Destructor function for poly objects.

## Detailed Description

Function callback types.

## Typedef Documentation

## ◆ ecs_cmp_t

typedef int(* ecs_cmp_t) (const void *a_ptr, const void *b_ptr, const ecs_type_info_t *type_info)

Compare hook to compare component instances.

Definition at line 656 of file flecs.h.

## ◆ ecs_compare_action_t

typedef int(* ecs_compare_action_t) (const void *ptr1, const void *ptr2)

Callback used for sorting values.

Definition at line 627 of file flecs.h.

## ◆ ecs_copy_t

typedef void(* ecs_copy_t) (void *dst_ptr, const void *src_ptr, int32_t count, const ecs_type_info_t *type_info)

Copy is invoked when a component is copied into another component.

Definition at line 642 of file flecs.h.

## ◆ ecs_ctx_free_t

typedef void(* ecs_ctx_free_t) (void *ctx)

Function to cleanup context data.

Definition at line 623 of file flecs.h.

## ◆ ecs_equals_t

typedef bool(* ecs_equals_t) (const void *a_ptr, const void *b_ptr, const ecs_type_info_t *type_info)

Equals operator hook.

Definition at line 662 of file flecs.h.

## ◆ ecs_fini_action_t

typedef void(* ecs_fini_action_t) (ecs_world_t *world, void *ctx)

Action callback on world exit.

Definition at line 618 of file flecs.h.

## ◆ ecs_group_by_action_t

typedef uint64_t(* ecs_group_by_action_t) (ecs_world_t *world, ecs_table_t *table, ecs_id_t group_id, void *ctx)

Callback used for grouping tables in a query.

Definition at line 594 of file flecs.h.

## ◆ ecs_group_create_action_t

typedef void *(* ecs_group_create_action_t) (ecs_world_t *world, uint64_t group_id, void *group_by_ctx)

Callback invoked when a query creates a new group.

Definition at line 601 of file flecs.h.

## ◆ ecs_group_delete_action_t

typedef void(* ecs_group_delete_action_t) (ecs_world_t *world, uint64_t group_id, void *group_ctx, void *group_by_ctx)

Callback invoked when a query deletes an existing group.

Definition at line 607 of file flecs.h.

## ◆ ecs_hash_value_action_t

typedef uint64_t(* ecs_hash_value_action_t) (const void *ptr)

Callback used for hashing values.

Definition at line 632 of file flecs.h.

## ◆ ecs_iter_action_t

typedef void(* ecs_iter_action_t) (ecs_iter_t *it)

Function prototype for iterables.

A system may invoke a callback multiple times, typically once for each matched table.

Parameters

  it | The iterator containing the data for the current match.

Definition at line 554 of file flecs.h.

## ◆ ecs_iter_fini_action_t

typedef void(* ecs_iter_fini_action_t) (ecs_iter_t *it)

Function prototype for freeing an iterator.

Free iterator resources.

Parameters

  it | The iterator to free.

Definition at line 572 of file flecs.h.

## ◆ ecs_iter_next_action_t

typedef bool(* ecs_iter_next_action_t) (ecs_iter_t *it)

Function prototype for iterating an iterator.

Stored inside initialized iterators. This allows an application to iterate an iterator without needing to know what created it.

Parameters

  it | The iterator to iterate.

Returns
  True if iterator has no more results, false if it does.

Definition at line 564 of file flecs.h.

## ◆ ecs_module_action_t

typedef void(* ecs_module_action_t) (ecs_world_t *world)

Initialization action for modules.

Definition at line 614 of file flecs.h.

## ◆ ecs_move_t

typedef void(* ecs_move_t) (void *dst_ptr, void *src_ptr, int32_t count, const ecs_type_info_t *type_info)

Move is invoked when a component is moved to another component.

Definition at line 649 of file flecs.h.

## ◆ ecs_order_by_action_t

typedef int(* ecs_order_by_action_t) (ecs_entity_t e1, const void *ptr1, ecs_entity_t e2, const void *ptr2)

Callback used for comparing components.

Definition at line 576 of file flecs.h.

## ◆ ecs_run_action_t

typedef void(* ecs_run_action_t) (ecs_iter_t *it)

Function prototype for runnables (systems, observers).

The run callback overrides the default behavior for iterating through the results of a runnable object.

The default runnable iterates the iterator, and calls an iter_action (see below) for each returned result.

Parameters

  it | The iterator to be iterated by the runnable.

Definition at line 545 of file flecs.h.

## ◆ ecs_sort_table_action_t

typedef void(* ecs_sort_table_action_t) (ecs_world_t *world, ecs_table_t *table, ecs_entity_t *entities, void *ptr, int32_t size, int32_t lo, int32_t hi, ecs_order_by_action_t order_by)

Callback used for sorting the entire table of components.

Definition at line 583 of file flecs.h.

## ◆ ecs_xtor_t

typedef void(* ecs_xtor_t) (void *ptr, int32_t count, const ecs_type_info_t *type_info)

Constructor/destructor callback.

Definition at line 636 of file flecs.h.

## ◆ flecs_poly_dtor_t

typedef void(* flecs_poly_dtor_t) (ecs_poly_t *poly)

Destructor function for poly objects.

Definition at line 668 of file flecs.h.