From fe5739ffa93d1d71d2d1ed1af6edd3d5d4e038ab Mon Sep 17 00:00:00 2001 From: Gaspard-- Date: Wed, 25 Sep 2024 14:44:56 +0200 Subject: [PATCH] rerun bake after rebase --- distr/flecs.h | 1565 +++++++++++++++++++++++++------------------------ 1 file changed, 783 insertions(+), 782 deletions(-) diff --git a/distr/flecs.h b/distr/flecs.h index b50cbee86..9a1c71f11 100644 --- a/distr/flecs.h +++ b/distr/flecs.h @@ -42,7 +42,7 @@ FLECS_VERSION_MAJOR, FLECS_VERSION_MINOR, FLECS_VERSION_PATCH) /** @def FLECS_CONFIG_HEADER - * Allows for including a user-customizable header that specifies compile-time + * Allows for including a user-customizable header that specifies compile-time * features. */ #ifdef FLECS_CONFIG_HEADER #include "flecs_config.h" @@ -139,7 +139,7 @@ /** \def FLECS_CPP_NO_AUTO_REGISTRATION * When set, the C++ API will require that components are registered before they * are used. This is useful in multithreaded applications, where components need - * to be registered beforehand, and to catch issues in projects where component + * to be registered beforehand, and to catch issues in projects where component * registration is mandatory. Disabling automatic component registration also * slightly improves performance. * The C API is not affected by this feature. @@ -282,13 +282,13 @@ * Maximum number of query variables per query */ #define FLECS_VARIABLE_COUNT_MAX (64) -/** \def FLECS_TERM_COUNT_MAX +/** \def FLECS_TERM_COUNT_MAX * Maximum number of terms in queries. Should not exceed 64. */ #ifndef FLECS_TERM_COUNT_MAX #define FLECS_TERM_COUNT_MAX 32 #endif -/** \def FLECS_TERM_ARG_COUNT_MAX +/** \def FLECS_TERM_ARG_COUNT_MAX * Maximum number of arguments for a term. */ #ifndef FLECS_TERM_ARG_COUNT_MAX #define FLECS_TERM_ARG_COUNT_MAX (16) @@ -398,7 +398,7 @@ extern "C" { #define EcsIdIsTransitive (1u << 14) #define EcsIdHasOnAdd (1u << 16) /* Same values as table flags */ -#define EcsIdHasOnRemove (1u << 17) +#define EcsIdHasOnRemove (1u << 17) #define EcsIdHasOnSet (1u << 18) #define EcsIdHasOnTableFill (1u << 19) #define EcsIdHasOnTableEmpty (1u << 20) @@ -631,14 +631,14 @@ extern "C" { #pragma clang diagnostic ignored "-Wunknown-warning-option" /* Warns for double or redundant semicolons. There are legitimate cases where a * semicolon after an empty statement is useful, for example after a macro that - * is replaced with a code block. With this warning enabled, semicolons would + * is replaced with a code block. With this warning enabled, semicolons would * only have to be added after macro's that are not code blocks, which in some * cases isn't possible as the implementation of a macro can be different in * debug/release mode. */ #pragma clang diagnostic ignored "-Wextra-semi-stmt" /* This is valid in C99, and Flecs must be compiled as C99. */ #pragma clang diagnostic ignored "-Wdeclaration-after-statement" -/* Clang attribute to detect fallthrough isn't supported on older versions. +/* Clang attribute to detect fallthrough isn't supported on older versions. * Implicit fallthrough is still detected by gcc and ignored with "fall through" * comments */ #pragma clang diagnostic ignored "-Wimplicit-fallthrough" @@ -659,7 +659,7 @@ extern "C" { /* clang 13 can throw this warning for a define in ctype.h */ #pragma clang diagnostic ignored "-Wreserved-identifier" #endif -/* Filenames aren't consistent across targets as they can use different casing +/* Filenames aren't consistent across targets as they can use different casing * (e.g. WinSock2 vs winsock2). */ #pragma clang diagnostic ignored "-Wnonportable-system-include-path" /* Very difficult to workaround this warning in C, especially for an ECS. */ @@ -690,8 +690,8 @@ extern "C" { /* This warning gets thrown *sometimes* when not all members for a struct are * provided in an initializer. Flecs heavily relies on descriptor structs that * only require partly initialization, so this warning isn't useful. - * It doesn't introduce any safety issues (fields are guaranteed to be 0 - * initialized), and later versions of gcc (>=11) seem to no longer throw this + * It doesn't introduce any safety issues (fields are guaranteed to be 0 + * initialized), and later versions of gcc (>=11) seem to no longer throw this * warning. */ #pragma GCC diagnostic ignored "-Wmissing-field-initializers" /* Produces false positives in addons/cpp/delegate.hpp. */ @@ -1365,7 +1365,7 @@ bool flecs_sparse_is_alive( const ecs_sparse_t *sparse, uint64_t id); -/** Get value from sparse set by dense id. This function is useful in +/** Get value from sparse set by dense id. This function is useful in * combination with flecs_sparse_count for iterating all values in the set. */ FLECS_DBG_API void* flecs_sparse_get_dense( @@ -1437,7 +1437,7 @@ FLECS_DBG_API const uint64_t* flecs_sparse_ids( const ecs_sparse_t *sparse); -/* Publicly exposed APIs +/* Publicly exposed APIs * These APIs are not part of the public API and as a result may change without * notice (though they haven't changed in a long time). */ @@ -1555,24 +1555,24 @@ void* flecs_bcalloc( FLECS_API void flecs_bfree( - ecs_block_allocator_t *allocator, + ecs_block_allocator_t *allocator, void *memory); FLECS_API void flecs_bfree_w_dbg_info( - ecs_block_allocator_t *allocator, + ecs_block_allocator_t *allocator, void *memory, const char *type_name); FLECS_API void* flecs_brealloc( - ecs_block_allocator_t *dst, - ecs_block_allocator_t *src, + ecs_block_allocator_t *dst, + ecs_block_allocator_t *src, void *memory); FLECS_API void* flecs_bdup( - ecs_block_allocator_t *ba, + ecs_block_allocator_t *ba, void *memory); #endif @@ -1624,7 +1624,7 @@ void flecs_stack_fini( FLECS_DBG_API void* flecs_stack_alloc( - ecs_stack_t *stack, + ecs_stack_t *stack, ecs_size_t size, ecs_size_t align); @@ -1636,7 +1636,7 @@ void* flecs_stack_alloc( FLECS_DBG_API void* flecs_stack_calloc( - ecs_stack_t *stack, + ecs_stack_t *stack, ecs_size_t size, ecs_size_t align); @@ -1947,7 +1947,7 @@ ecs_map_iter_t flecs_switch_targets( /** * @file allocator.h - * @brief Allocator that returns memory objects of any size. + * @brief Allocator that returns memory objects of any size. */ #ifndef FLECS_ALLOCATOR_H @@ -1974,17 +1974,17 @@ void flecs_allocator_fini( FLECS_API ecs_block_allocator_t* flecs_allocator_get( - ecs_allocator_t *a, + ecs_allocator_t *a, ecs_size_t size); FLECS_API char* flecs_strdup( - ecs_allocator_t *a, + ecs_allocator_t *a, const char* str); FLECS_API void flecs_strfree( - ecs_allocator_t *a, + ecs_allocator_t *a, char* str); FLECS_API @@ -2540,7 +2540,7 @@ typedef struct ecs_os_api_t { ecs_flags32_t flags_; /**< OS API flags */ - FILE *log_out_; /**< File used for logging output + FILE *log_out_; /**< File used for logging output * (hint, log_ decides where to write) */ } ecs_os_api_t; @@ -2548,10 +2548,10 @@ typedef struct ecs_os_api_t { FLECS_API extern ecs_os_api_t ecs_os_api; -/** Initialize OS API. +/** Initialize OS API. * This operation is not usually called by an application. To override callbacks * of the OS API, use the following pattern: - * + * * @code * ecs_os_set_api_defaults(); * ecs_os_api_t os_api = ecs_os_get_api(); @@ -2562,25 +2562,25 @@ extern ecs_os_api_t ecs_os_api; FLECS_API void ecs_os_init(void); -/** Deinitialize OS API. +/** Deinitialize OS API. * This operation is not usually called by an application. */ FLECS_API void ecs_os_fini(void); /** Override OS API. - * This overrides the OS API struct with new values for callbacks. See + * This overrides the OS API struct with new values for callbacks. See * ecs_os_init() on how to use the function. - * + * * @param os_api Pointer to struct with values to set. */ FLECS_API void ecs_os_set_api( ecs_os_api_t *os_api); -/** Get OS API. - * - * @return A value with the current OS API callbacks +/** Get OS API. + * + * @return A value with the current OS API callbacks * @see ecs_os_init() */ FLECS_API @@ -2589,13 +2589,13 @@ ecs_os_api_t ecs_os_get_api(void); /** Set default values for OS API. * This initializes the OS API struct with default values for callbacks like * malloc and free. - * + * * @see ecs_os_init() */ FLECS_API void ecs_os_set_api_defaults(void); -/** Macro utilities +/** Macro utilities * \cond */ @@ -2764,7 +2764,7 @@ void ecs_os_set_api_defaults(void); #define ecs_os_module_to_dl(lib) ecs_os_api.module_to_dl_(lib) #define ecs_os_module_to_etc(lib) ecs_os_api.module_to_etc_(lib) -/** Macro utilities +/** Macro utilities * \endcond */ @@ -2772,67 +2772,67 @@ void ecs_os_set_api_defaults(void); /* Logging */ /** Log at debug level. - * + * * @param file The file to log. * @param line The line to log. * @param msg The message to log. */ FLECS_API void ecs_os_dbg( - const char *file, - int32_t line, + const char *file, + int32_t line, const char *msg); /** Log at trace level. - * + * * @param file The file to log. * @param line The line to log. * @param msg The message to log. */ FLECS_API void ecs_os_trace( - const char *file, - int32_t line, + const char *file, + int32_t line, const char *msg); /** Log at warning level. - * + * * @param file The file to log. * @param line The line to log. * @param msg The message to log. */ FLECS_API void ecs_os_warn( - const char *file, - int32_t line, + const char *file, + int32_t line, const char *msg); /** Log at error level. - * + * * @param file The file to log. * @param line The line to log. * @param msg The message to log. */ FLECS_API void ecs_os_err( - const char *file, - int32_t line, + const char *file, + int32_t line, const char *msg); /** Log at fatal level. - * + * * @param file The file to log. * @param line The line to log. * @param msg The message to log. */ FLECS_API void ecs_os_fatal( - const char *file, - int32_t line, + const char *file, + int32_t line, const char *msg); /** Convert errno to string. - * + * * @param err The error number. * @return A string describing the error. */ @@ -2840,15 +2840,15 @@ FLECS_API const char* ecs_os_strerror( int err); -/** Utility for assigning strings. +/** Utility for assigning strings. * This operation frees an existing string and duplicates the input string. - * + * * @param str Pointer to a string value. * @param value The string value to assign. */ FLECS_API void ecs_os_strset( - char **str, + char **str, const char *value); /* Profile tracing */ @@ -2870,18 +2870,18 @@ void ecs_os_perf_trace_pop_( size_t line, const char *name); -/** Sleep with floating point time. - * +/** Sleep with floating point time. + * * @param t The time in seconds. */ FLECS_API void ecs_sleepf( double t); -/** Measure time since provided timestamp. +/** Measure time since provided timestamp. * Use with a time value initialized to 0 to obtain the number of seconds since * the epoch. The operation will write the current timestamp in start. - * + * * Usage: * @code * ecs_time_t t = {}; @@ -2889,7 +2889,7 @@ void ecs_sleepf( * // code * double elapsed = ecs_time_measure(&t); * @endcode - * + * * @param start The starting timestamp. * @return The time elapsed since start. */ @@ -2897,8 +2897,8 @@ FLECS_API double ecs_time_measure( ecs_time_t *start); -/** Calculate difference between two timestamps. - * +/** Calculate difference between two timestamps. + * * @param t1 The first timestamp. * @param t2 The first timestamp. * @return The difference between timestamps. @@ -2908,8 +2908,8 @@ ecs_time_t ecs_time_sub( ecs_time_t t1, ecs_time_t t2); -/** Convert time value to a double. - * +/** Convert time value to a double. + * * @param t The timestamp. * @return The timestamp converted to a double. */ @@ -2917,8 +2917,8 @@ FLECS_API double ecs_time_to_double( ecs_time_t t); -/** Return newly allocated memory that contains a copy of src. - * +/** Return newly allocated memory that contains a copy of src. + * * @param src The source pointer. * @param size The number of bytes to copy. * @return The duplicated memory. @@ -3064,8 +3064,8 @@ typedef struct ecs_query_t ecs_query_t; * }); * @endcode * - * Observers only trigger when the source of the event matches the full observer - * query. For example, an OnAdd observer for Position, Velocity will only + * Observers only trigger when the source of the event matches the full observer + * query. For example, an OnAdd observer for Position, Velocity will only * trigger after both components have been added to the entity. */ typedef struct ecs_observer_t ecs_observer_t; @@ -3143,7 +3143,7 @@ struct ecs_record_t { ecs_id_record_t *idr; /**< Id record to (*, entity) for target entities */ ecs_table_t *table; /**< Identifies a type (and table) in world */ uint32_t row; /**< Table row of the entity */ - int32_t dense; /**< Index in dense array of entity index */ + int32_t dense; /**< Index in dense array of entity index */ }; /** Header for table cache elements. */ @@ -3399,7 +3399,7 @@ typedef enum ecs_query_cache_kind_t { /** Type that describes a reference to an entity or variable in a term. */ typedef struct ecs_term_ref_t { - ecs_entity_t id; /**< Entity id. If left to 0 and flags does not + ecs_entity_t id; /**< Entity id. If left to 0 and flags does not * specify whether id is an entity or a variable * the id will be initialized to #EcsThis. * To explicitly set the id to 0, leave the id @@ -3434,7 +3434,7 @@ struct ecs_term_t { ecs_flags16_t flags_; /**< Flags that help eval, set by ecs_query_init() */ }; -/** Queries are lists of constraints (terms) that match entities. +/** Queries are lists of constraints (terms) that match entities. * Created with ecs_query_init(). */ struct ecs_query_t { @@ -3461,7 +3461,7 @@ struct ecs_query_t { ecs_termset_t set_fields; /**< Fields that will be set */ ecs_query_cache_kind_t cache_kind; /**< Caching policy of query */ - + char **vars; /**< Array with variable names for iterator */ void *ctx; /**< User context to pass to callback */ @@ -3479,7 +3479,7 @@ struct ecs_query_t { */ struct ecs_observer_t { ecs_header_t hdr; /**< Object header */ - + ecs_query_t *query; /**< Observer query */ /** Observer events */ @@ -3573,7 +3573,7 @@ struct ecs_type_info_t { * @file api_types.h * @brief Supporting types for the public API. * - * This file contains types that are typically not used by an application but + * This file contains types that are typically not used by an application but * support the public API, and therefore must be exposed. This header should not * be included by itself. */ @@ -3621,7 +3621,7 @@ struct ecs_observable_t { typedef struct ecs_table_range_t { ecs_table_t *table; int32_t offset; /* Leave both members to 0 to cover entire table */ - int32_t count; + int32_t count; } ecs_table_range_t; /** Value of query variable */ @@ -3629,8 +3629,8 @@ typedef struct ecs_var_t { ecs_table_range_t range; /* Set when variable stores a range of entities */ ecs_entity_t entity; /* Set when variable stores single entity */ - /* Most entities can be stored as a range by setting range.count to 1, - * however in order to also be able to store empty entities in variables, + /* Most entities can be stored as a range by setting range.count to 1, + * however in order to also be able to store empty entities in variables, * a separate entity member is needed. Both range and entity may be set at * the same time, as long as they are consistent. */ } ecs_var_t; @@ -3698,7 +3698,7 @@ typedef struct ecs_query_iter_t { } ecs_query_iter_t; /* Bits for tracking whether a cache was used/whether the array was allocated. - * Used by flecs_iter_init, flecs_iter_validate and ecs_iter_fini. + * Used by flecs_iter_init, flecs_iter_validate and ecs_iter_fini. * Constants are named to enable easy macro substitution. */ #define flecs_iter_cache_ids (1u << 0u) #define flecs_iter_cache_trs (1u << 1u) @@ -3739,9 +3739,9 @@ typedef struct ecs_iter_private_t { * @file api_support.h * @brief Support functions and constants. * - * Supporting types and functions that need to be exposed either in support of - * the public API or for unit tests, but that may change between minor / patch - * releases. + * Supporting types and functions that need to be exposed either in support of + * the public API or for unit tests, but that may change between minor / patch + * releases. */ #ifndef FLECS_API_SUPPORT_H @@ -3774,8 +3774,8 @@ bool flecs_identifier_is_0( /* Constructor that zeromem's a component value */ FLECS_API void flecs_default_ctor( - void *ptr, - int32_t count, + void *ptr, + int32_t count, const ecs_type_info_t *ctx); /* Create allocated string from format */ @@ -3887,12 +3887,12 @@ void flecs_dump_backtrace( * components, it should be possible to register components while the world is * in readonly mode. It is not uncommon that a component is used first from * within a system, which are often ran while in readonly mode. - * + * * Suspending readonly mode is only allowed when the world is not multithreaded. * When a world is multithreaded, it is not safe to (even temporarily) leave * readonly mode, so a multithreaded application should always explicitly - * register components in advance. - * + * register components in advance. + * * These operations also suspend deferred mode. */ typedef struct ecs_suspend_readonly_state_t { @@ -3947,12 +3947,12 @@ int32_t flecs_poly_refcount( /** Enable/disable bitsets */ #define ECS_BIT_SET(flags, bit) (flags) |= (bit) -#define ECS_BIT_CLEAR(flags, bit) (flags) &= ~(bit) +#define ECS_BIT_CLEAR(flags, bit) (flags) &= ~(bit) #define ECS_BIT_COND(flags, bit, cond) ((cond) \ ? (ECS_BIT_SET(flags, bit)) \ : (ECS_BIT_CLEAR(flags, bit))) -#define ECS_BIT_CLEAR16(flags, bit) (flags) &= (ecs_flags16_t)~(bit) +#define ECS_BIT_CLEAR16(flags, bit) (flags) &= (ecs_flags16_t)~(bit) #define ECS_BIT_COND16(flags, bit, cond) ((cond) \ ? (ECS_BIT_SET(flags, bit)) \ : (ECS_BIT_CLEAR16(flags, bit))) @@ -4218,28 +4218,28 @@ typedef struct ecs_component_desc_t { * Used for iterating queries. The ecs_iter_t type contains all the information * that is provided by a query, and contains all the state required for the * iterator code. - * + * * Functions that create iterators accept as first argument the world, and as * second argument the object they iterate. For example: - * + * * @code * ecs_iter_t it = ecs_query_iter(world, q); * @endcode - * + * * When this code is called from a system, it is important to use the world * provided by its iterator object to ensure thread safety. For example: - * + * * @code * void Collide(ecs_iter_t *it) { * ecs_iter_t qit = ecs_query_iter(it->world, Colliders); * } * @endcode - * - * An iterator contains resources that need to be released. By default this + * + * An iterator contains resources that need to be released. By default this * is handled by the last call to next() that returns false. When iteration is * ended before iteration has completed, an application has to manually call * ecs_iter_fini() to release the iterator resources: - * + * * @code * ecs_iter_t it = ecs_query_iter(world, q); * while (ecs_query_next(&it)) { @@ -4349,7 +4349,7 @@ struct ecs_iter_t { /** Used with ecs_query_init(). - * + * * \ingroup queries */ typedef struct ecs_query_desc_t { @@ -4650,10 +4650,10 @@ typedef struct EcsPoly { ecs_poly_t *poly; /**< Pointer to poly object */ } EcsPoly; -/** When added to an entity this informs serialization formats which component - * to use when a value is assigned to an entity without specifying the - * component. This is intended as a hint, serialization formats are not required - * to use it. Adding this component does not change the behavior of core ECS +/** When added to an entity this informs serialization formats which component + * to use when a value is assigned to an entity without specifying the + * component. This is intended as a hint, serialization formats are not required + * to use it. Adding this component does not change the behavior of core ECS * operations. */ typedef struct EcsDefaultChildComponent { ecs_id_t component; /**< Default component id. */ @@ -4796,7 +4796,7 @@ FLECS_API extern const ecs_entity_t EcsTransitive; FLECS_API extern const ecs_entity_t EcsReflexive; /** Ensures that entity/component cannot be used as target in `IsA` relationship. - * Final can improve the performance of queries as they will not attempt to + * Final can improve the performance of queries as they will not attempt to * substitute a final component with its subsets. * * Behavior: @@ -4810,19 +4810,19 @@ FLECS_API extern const ecs_entity_t EcsFinal; /** Relationship that specifies component inheritance behavior. */ FLECS_API extern const ecs_entity_t EcsOnInstantiate; -/** Override component on instantiate. +/** Override component on instantiate. * This will copy the component from the base entity `(IsA target)` to the * instance. The base component will never be inherited from the prefab. */ FLECS_API extern const ecs_entity_t EcsOverride; -/** Inherit component on instantiate. +/** Inherit component on instantiate. * This will inherit (share) the component from the base entity `(IsA target)`. * The component can be manually overridden by adding it to the instance. */ FLECS_API extern const ecs_entity_t EcsInherit; -/** Never inherit component on instantiate. +/** Never inherit component on instantiate. * This will not copy or share the component from the base entity `(IsA target)`. - * When the component is added to an instance, its value will never be copied + * When the component is added to an instance, its value will never be copied * from the base entity. */ FLECS_API extern const ecs_entity_t EcsDontInherit; @@ -4905,7 +4905,7 @@ FLECS_API extern const ecs_entity_t EcsRelationship; */ FLECS_API extern const ecs_entity_t EcsTarget; -/** Can be added to relationship to indicate that it should never hold data, +/** Can be added to relationship to indicate that it should never hold data, * even when it or the relationship target is a component. */ FLECS_API extern const ecs_entity_t EcsPairIsTag; @@ -5141,7 +5141,7 @@ typedef struct ecs_entities_t { * This operation returns an array with all entity ids that exist in the world. * Note that the returned array will change and may get invalidated as a result * of entity creation & deletion. - * + * * To iterate all alive entity ids, do: * @code * ecs_entities_t entities = ecs_get_entities(world); @@ -5149,17 +5149,17 @@ typedef struct ecs_entities_t { * ecs_entity_t id = entities.ids[i]; * } * @endcode - * + * * To iterate not-alive ids, do: * @code * for (int i = entities.alive_count + 1; i < entities.count; i ++) { * ecs_entity_t id = entities.ids[i]; * } * @endcode - * + * * The returned array does not need to be freed. Mutating the returned array * will return in undefined behavior (and likely crashes). - * + * * @param world The world. * @return Struct with entity id array. */ @@ -5289,7 +5289,7 @@ void ecs_set_target_fps( ecs_world_t *world, ecs_ftime_t fps); -/** Set default query flags. +/** Set default query flags. * Set a default value for the ecs_filter_desc_t::flags field. Default flags * are applied in addition to the flags provided in the descriptor. For a * list of available flags, see include/flecs/private/api_flags.h. Typical flags @@ -5298,7 +5298,7 @@ void ecs_set_target_fps( * - `EcsQueryMatchEmptyTables` * - `EcsQueryMatchDisabled` * - `EcsQueryMatchPrefab` - * + * * @param world The world. * @param flags The query flags. */ @@ -5317,35 +5317,35 @@ void ecs_set_default_query_flags( /** Begin readonly mode. * This operation puts the world in readonly mode, which disallows mutations on * the world. Readonly mode exists so that internal mechanisms can implement - * optimizations that certain aspects of the world to not change, while also - * providing a mechanism for applications to prevent accidental mutations in, + * optimizations that certain aspects of the world to not change, while also + * providing a mechanism for applications to prevent accidental mutations in, * for example, multithreaded applications. - * + * * Readonly mode is a stronger version of deferred mode. In deferred mode - * ECS operations such as add/remove/set/delete etc. are added to a command + * ECS operations such as add/remove/set/delete etc. are added to a command * queue to be executed later. In readonly mode, operations that could break * scheduler logic (such as creating systems, queries) are also disallowed. - * + * * Readonly mode itself has a single threaded and a multi threaded mode. In - * single threaded mode certain mutations on the world are still allowed, for + * single threaded mode certain mutations on the world are still allowed, for * example: * - Entity liveliness operations (such as new, make_alive), so that systems are * able to create new entities. * - Implicit component registration, so that this works from systems - * - Mutations to supporting data structures for the evaluation of uncached + * - Mutations to supporting data structures for the evaluation of uncached * queries (filters), so that these can be created on the fly. - * + * * These mutations are safe in a single threaded applications, but for * multithreaded applications the world needs to be entirely immutable. For this * purpose multi threaded readonly mode exists, which disallows all mutations on * the world. This means that in multi threaded applications, entity liveliness * operations, implicit component registration, and on-the-fly query creation * are not guaranteed to work. - * + * * While in readonly mode, applications can still enqueue ECS operations on a - * stage. Stages are managed automatically when using the pipeline addon and + * stage. Stages are managed automatically when using the pipeline addon and * ecs_progress(), but they can also be configured manually as shown here: - * + * * @code * // Number of stages typically corresponds with number of threads * ecs_set_stage_count(world, 2); @@ -5355,26 +5355,26 @@ void ecs_set_default_query_flags( * ecs_add(world, e, Tag); // readonly assert * ecs_add(stage, e, Tag); // OK * @endcode - * + * * When an attempt is made to perform an operation on a world in readonly mode, * the code will throw an assert saying that the world is in readonly mode. - * + * * A call to ecs_readonly_begin() must be followed up with ecs_readonly_end(). - * When ecs_readonly_end() is called, all enqueued commands from configured + * When ecs_readonly_end() is called, all enqueued commands from configured * stages are merged back into the world. Calls to ecs_readonly_begin() and * ecs_readonly_end() should always happen from a context where the code has * exclusive access to the world. The functions themselves are not thread safe. - * - * In a typical application, a (non-exhaustive) call stack that uses + * + * In a typical application, a (non-exhaustive) call stack that uses * ecs_readonly_begin() and ecs_readonly_end() will look like this: - * + * * @code * ecs_progress() * ecs_readonly_begin() * ecs_defer_begin() - * + * * // user code - * + * * ecs_readonly_end() * ecs_defer_end() *@endcode @@ -5643,7 +5643,7 @@ void* ecs_get_binding_ctx( /** Get build info. * Returns information about the current Flecs build. - * + * * @return A struct with information about the current Flecs build. */ FLECS_API @@ -6064,44 +6064,44 @@ void ecs_remove_id( * An auto override is a component that is automatically added to an entity when * it is instantiated from a prefab. Auto overrides are added to the entity that * is inherited from (usually a prefab). For example: - * + * * @code * ecs_entity_t prefab = ecs_insert(world, * ecs_value(Position, {10, 20}), * ecs_value(Mass, {100})); - * + * * ecs_auto_override(world, prefab, Position); - * + * * ecs_entity_t inst = ecs_new_w_pair(world, EcsIsA, prefab); * assert(ecs_owns(world, inst, Position)); // true * assert(ecs_owns(world, inst, Mass)); // false * @endcode - * + * * An auto override is equivalent to a manual override: - * + * * @code * ecs_entity_t prefab = ecs_insert(world, * ecs_value(Position, {10, 20}), * ecs_value(Mass, {100})); - * + * * ecs_entity_t inst = ecs_new_w_pair(world, EcsIsA, prefab); * assert(ecs_owns(world, inst, Position)); // false * ecs_add(world, inst, Position); // manual override * assert(ecs_owns(world, inst, Position)); // true * assert(ecs_owns(world, inst, Mass)); // false * @endcode - * + * * This operation is equivalent to manually adding the id with the AUTO_OVERRIDE * bit applied: * * @code * ecs_add_id(world, entity, ECS_AUTO_OVERRIDE | id); * @endcode - * - * When a component is overridden and inherited from a prefab, the value from + * + * When a component is overridden and inherited from a prefab, the value from * the prefab component is copied to the instance. When the component is not * inherited from a prefab, it is added to the instance as if using ecs_add_id(). - * + * * Overriding is the default behavior on prefab instantiation. Auto overriding * is only useful for components with the `(OnInstantiate, Inherit)` trait. * When a component has the `(OnInstantiate, DontInherit)` trait and is overridden @@ -6234,7 +6234,7 @@ bool ecs_is_enabled_id( /** Get an immutable pointer to a component. * This operation obtains a const pointer to the requested component. The * operation accepts the component entity id. - * + * * This operation can return inherited components reachable through an `IsA` * relationship. * @@ -6254,7 +6254,7 @@ const void* ecs_get_id( /** Get a mutable pointer to a component. * This operation obtains a mutable pointer to the requested component. The * operation accepts the component entity id. - * + * * Unlike ecs_get_id(), this operation does not return inherited components. * * @param world The world. @@ -6350,9 +6350,9 @@ void ecs_ref_update( const ecs_world_t *world, ecs_ref_t *ref); -/** Find record for entity. +/** Find record for entity. * An entity record contains the table and row for the entity. - * + * * @param world The world. * @param entity The entity. * @return The record, NULL if the entity does not exist. @@ -6486,17 +6486,17 @@ bool ecs_record_has_id( const ecs_record_t *record, ecs_id_t id); -/** Get component pointer from column/record. +/** Get component pointer from column/record. * This returns a pointer to the component using a table column index. The * table's column index can be found with ecs_table_get_column_index(). - * + * * Usage: * @code * ecs_record_t *r = ecs_record_find(world, entity); * int32_t column = ecs_table_get_column_index(world, table, ecs_id(Position)); * Position *ptr = ecs_record_get_by_column(r, column, sizeof(Position)); * @endcode - * + * * @param record The record. * @param column The column index in the entity's table. * @param size The component size. @@ -6510,13 +6510,13 @@ void* ecs_record_get_by_column( /** Emplace a component. * Emplace is similar to ecs_ensure_id() except that the component constructor - * is not invoked for the returned pointer, allowing the component to be + * is not invoked for the returned pointer, allowing the component to be * constructed directly in the storage. - * + * * When the `is_new` parameter is not provided, the operation will assert when the * component already exists. When the `is_new` parameter is provided, it will * indicate whether the returned storage has been constructed. - * + * * When `is_new` indicates that the storage has not yet been constructed, it must * be constructed by the code invoking this operation. Not constructing the * component will result in undefined behavior. @@ -6733,7 +6733,7 @@ bool ecs_exists( * This operation overrides the current generation of an entity with the * specified generation, which can be useful if an entity is externally managed, * like for external pools, savefiles or netcode. - * + * * This operation is similar to ecs_make_alive(), except that it will also * override the generation of an alive entity. * @@ -7574,7 +7574,7 @@ ecs_id_t ecs_id_from_str( * @param id The term id. * @return True when set, false when not set. */ -FLECS_API +FLECS_API bool ecs_term_ref_is_set( const ecs_term_ref_t *id); @@ -7643,13 +7643,13 @@ char* ecs_term_str( /** Convert query to string expression. * Convert query to a string expression. The resulting expression can be * parsed to create the same query. - * + * * @param query The query. * @return The query converted to a string. */ -FLECS_API +FLECS_API char* ecs_query_str( - const ecs_query_t *query); + const ecs_query_t *query); /** @} */ @@ -7659,11 +7659,11 @@ char* ecs_query_str( * @{ */ -/** Iterate all entities with specified (component id). +/** Iterate all entities with specified (component id). * This returns an iterator that yields all entities with a single specified - * component. This is a much lighter weight operation than creating and + * component. This is a much lighter weight operation than creating and * iterating a query. - * + * * Usage: * @code * ecs_iter_t it = ecs_each(world, Player); @@ -7673,10 +7673,10 @@ char* ecs_query_str( * } * } * @endcode - * + * * If the specified id is a component, it is possible to access the component * pointer with ecs_field just like with regular queries: - * + * * @code * ecs_iter_t it = ecs_each(world, Position); * while (ecs_each_next(&it)) { @@ -7686,7 +7686,7 @@ char* ecs_query_str( * } * } * @endcode - * + * * @param world The world. * @param id The (component) id to iterate. * @return An iterator that iterates all entities with the (component) id. @@ -7697,7 +7697,7 @@ ecs_iter_t ecs_each_id( ecs_id_t id); /** Progress an iterator created with ecs_each_id(). - * + * * @param it The iterator. * @return True if the iterator has more results, false if not. */ @@ -7710,7 +7710,7 @@ bool ecs_each_next( * @code * ecs_iter_t it = ecs_each_id(world, ecs_pair(EcsChildOf, parent)); * @endcode - * + * * @param world The world. * @param parent The parent. * @return An iterator that iterates all children of the parent. @@ -7723,7 +7723,7 @@ ecs_iter_t ecs_children( ecs_entity_t parent); /** Progress an iterator created with ecs_children(). - * + * * @param it The iterator. * @return True if the iterator has more results, false if not. */ @@ -7741,7 +7741,7 @@ bool ecs_children_next( */ /** Create a query. - * + * * @param world The world. * @param desc The descriptor (see ecs_query_desc_t) * @return The query. @@ -7770,7 +7770,7 @@ void ecs_query_fini( FLECS_API int32_t ecs_query_find_var( const ecs_query_t *query, - const char *name); + const char *name); /** Get variable name. * This operation returns the variable name for an index. @@ -7797,42 +7797,42 @@ const char* ecs_query_var_name( FLECS_API bool ecs_query_var_is_entity( const ecs_query_t *query, - int32_t var_id); + int32_t var_id); /** Create a query iterator. * Use an iterator to iterate through the entities that match an entity. Queries * can return multiple results, and have to be iterated by repeatedly calling * ecs_query_next() until the operation returns false. - * + * * Depending on the query, a single result can contain an entire table, a range * of entities in a table, or a single entity. Iteration code has an inner and * an outer loop. The outer loop loops through the query results, and typically * corresponds with a table. The inner loop loops entities in the result. - * + * * Example: * @code * ecs_iter_t it = ecs_query_iter(world, q); - * + * * while (ecs_query_next(&it)) { * Position *p = ecs_field(&it, Position, 0); * Velocity *v = ecs_field(&it, Velocity, 1); - * + * * for (int i = 0; i < it.count; i ++) { * p[i].x += v[i].x; * p[i].y += v[i].y; * } * } * @endcode - * + * * The world passed into the operation must be either the actual world or the * current stage, when iterating from a system. The stage is accessible through * the it.world member. - * + * * Example: * @code * void MySystem(ecs_iter_t *it) { * ecs_query_t *q = it->ctx; // Query passed as system context - * + * * // Create query iterator from system stage * ecs_iter_t qit = ecs_query_iter(it->world, q); * while (ecs_query_next(&qit)) { @@ -7840,21 +7840,21 @@ bool ecs_query_var_is_entity( * } * } * @endcode - * - * If query iteration is stopped without the last call to ecs_query_next() + * + * If query iteration is stopped without the last call to ecs_query_next() * returning false, iterator resources need to be cleaned up explicitly * with ecs_iter_fini(). - * + * * Example: * @code * ecs_iter_t it = ecs_query_iter(world, q); - * + * * while (ecs_query_next(&it)) { * if (!ecs_field_is_set(&it, 0)) { * ecs_iter_fini(&it); // Free iterator resources * break; * } - * + * * for (int i = 0; i < it.count; i ++) { * // ... * } @@ -7887,7 +7887,7 @@ bool ecs_query_next( * This operation matches an entity with a query and returns the result of the * match in the "it" out parameter. An application should free the iterator * resources with ecs_iter_fini() if this function returns true. - * + * * Usage: * @code * ecs_iter_t it; @@ -7895,7 +7895,7 @@ bool ecs_query_next( * ecs_iter_fini(&it); * } * @endcode - * + * * @param query The query. * @param entity The entity to match * @param it The iterator with matched data. @@ -7911,7 +7911,7 @@ bool ecs_query_has( * This operation matches a table with a query and returns the result of the * match in the "it" out parameter. An application should free the iterator * resources with ecs_iter_fini() if this function returns true. - * + * * Usage: * @code * ecs_iter_t it; @@ -7919,7 +7919,7 @@ bool ecs_query_has( * ecs_iter_fini(&it); * } * @endcode - * + * * @param query The query. * @param table The table to match * @param it The iterator with matched data. @@ -7935,9 +7935,9 @@ bool ecs_query_has_table( * This operation matches a range with a query and returns the result of the * match in the "it" out parameter. An application should free the iterator * resources with ecs_iter_fini() if this function returns true. - * + * * The entire range must match the query for the operation to return true. - * + * * Usage: * @code * ecs_table_range_t range = { @@ -7945,13 +7945,13 @@ bool ecs_query_has_table( * .offset = 1, * .count = 2 * }; - * + * * ecs_iter_t it; * if (ecs_query_has_range(q, &range, &it)) { * ecs_iter_fini(&it); * } * @endcode - * + * * @param query The query. * @param range The range to match * @param it The iterator with matched data. @@ -7963,10 +7963,10 @@ bool ecs_query_has_range( ecs_table_range_t *range, ecs_iter_t *it); -/** Returns how often a match event happened for a cached query. - * This operation can be used to determine whether the query cache has been +/** Returns how often a match event happened for a cached query. + * This operation can be used to determine whether the query cache has been * updated with new tables. - * + * * @param query The query. * @return The number of match events happened. */ @@ -7994,7 +7994,7 @@ char* ecs_query_plan( * @code * it.flags |= EcsIterProfile * @endcode - * + * * The returned string must be freed with ecs_os_free(). * * @param query The query. @@ -8015,7 +8015,7 @@ char* ecs_query_plan_w_profile( * @endcode * * The key-value list may optionally be enclosed in parenthesis. - * + * * This function uses the script addon. * * @param query The query. @@ -8145,8 +8145,8 @@ FLECS_API ecs_query_count_t ecs_query_count( const ecs_query_t *query); -/** Does query return one or more results. - * +/** Does query return one or more results. + * * @param query The query. * @return True if query matches anything, false if not. */ @@ -8190,10 +8190,10 @@ void ecs_emit( /** Enqueue event. * Same as ecs_emit(), but enqueues an event in the command queue instead. The * event will be emitted when ecs_defer_end() is called. - * + * * If this operation is called when the provided world is not in deferred mode * it behaves just like ecs_emit(). - * + * * @param world The world. * @param desc Event parameters. */ @@ -8325,13 +8325,13 @@ ecs_entity_t ecs_iter_first( * { .first.id = Eats, .second.name = "$food" } * } * }); - * + * * int food_var = ecs_query_find_var(r, "food"); - * + * * // Set Food to Apples, so we're only matching (Eats, Apples) * ecs_iter_t it = ecs_query_iter(world, q); * ecs_iter_set_var(&it, food_var, Apples); - * + * * while (ecs_query_next(&it)) { * for (int i = 0; i < it.count; i ++) { * // iterate as usual @@ -8460,10 +8460,10 @@ bool ecs_iter_var_is_constrained( * This operation must be used in combination with a query that supports change * detection (e.g. is cached). The operation returns whether the currently * iterated result has changed since the last time it was iterated by the query. - * + * * Change detection works on a per-table basis. Changes to individual entities * cannot be detected this way. - * + * * @param it The iterator. * @return True if the result changed, false if it didn't. */ @@ -8566,18 +8566,18 @@ bool ecs_worker_next( * the entity being iterated, such as a shared component (from a prefab), a * component from a parent, or another entity. The ecs_field_is_self() operation * can be used to test dynamically if a field is owned. - * + * * When a field contains a sparse component, use the ecs_field_at function. When * a field is guaranteed to be set and owned, the ecs_field_self() function can be - * used. ecs_field_self() has slightly better performance, and provides stricter + * used. ecs_field_self() has slightly better performance, and provides stricter * validity checking. * * The provided size must be either 0 or must match the size of the type * of the returned array. If the size does not match, the operation may assert. * The size can be dynamically obtained with ecs_field_size(). - * + * * An example: - * + * * @code * while (ecs_query_next(&it)) { * Position *p = ecs_field(&it, Position, 0); @@ -8601,10 +8601,10 @@ void* ecs_field_w_size( int8_t index); /** Get data for field at specified row. - * This operation should be used instead of ecs_field_w_size for sparse + * This operation should be used instead of ecs_field_w_size for sparse * component fields. This operation should be called for each returned row in a * result. In the following example the Velocity component is sparse: - * + * * @code * while (ecs_query_next(&it)) { * Position *p = ecs_field(&it, Position, 0); @@ -8615,7 +8615,7 @@ void* ecs_field_w_size( * } * } * @endcode - * + * * @param it the iterator. * @param size The size of the field type. * @param index The index of the field. @@ -8878,9 +8878,9 @@ int32_t ecs_table_count( const ecs_table_t *table); /** Returns allocated size of table. - * This operation returns the number of elements allocated in the table + * This operation returns the number of elements allocated in the table * per column. - * + * * @param table The table. * @return The number of allocated elements in the table. */ @@ -8890,7 +8890,7 @@ int32_t ecs_table_size( /** Returns array with entity ids for table. * The size of the returned array is the result of ecs_table_count(). - * + * * @param table The table. * @return Array with entity ids for table. */ @@ -11464,7 +11464,7 @@ void ecs_rest_server_fini( * @code * ECS_IMPORT(world, FlecsRest) * @endcode - * + * * @param world The world. */ FLECS_API @@ -11741,7 +11741,7 @@ void ecs_set_tick_source( * @code * ECS_IMPORT(world, FlecsTimer) * @endcode - * + * * @param world The world. */ FLECS_API @@ -11810,7 +11810,7 @@ extern "C" { #ifndef FLECS_LEGACY -/** Convenience macro to create a predeclared pipeline. +/** Convenience macro to create a predeclared pipeline. * Usage: * @code * ECS_ENTITY_DECLARE(MyPipeline); @@ -11830,19 +11830,19 @@ extern "C" { } \ ecs_assert(id_ != 0, ECS_INVALID_PARAMETER, "failed to create pipeline"); -/** Convenience macro to create a pipeline. +/** Convenience macro to create a pipeline. * Usage: * @code * ECS_PIPELINE(world, MyPipeline, Update || Physics || Render) * @endcode - * + * */ #define ECS_PIPELINE(world, id, ...) \ ecs_entity_t id = 0, ecs_id(id) = 0; ECS_PIPELINE_DEFINE(world, id, __VA_ARGS__);\ (void)id;\ (void)ecs_id(id); -/** Convenience macro to create a pipeline. +/** Convenience macro to create a pipeline. * See ecs_pipeline_init(). */ #define ecs_pipeline(world, ...)\ @@ -11855,25 +11855,25 @@ typedef struct ecs_pipeline_desc_t { /** Existing entity to associate with pipeline (optional). */ ecs_entity_t entity; - /** The pipeline query. + /** The pipeline query. * Pipelines are queries that are matched with system entities. Pipeline * queries are the same as regular queries, which means the same query rules * apply. A common mistake is to try a pipeline that matches systems in a * list of phases by specifying all the phases, like: * OnUpdate, OnPhysics, OnRender - * + * * That however creates a query that matches entities with OnUpdate _and_ * OnPhysics _and_ OnRender tags, which is likely undesired. Instead, a * query could use the or operator match a system that has one of the * specified phases: * OnUpdate || OnPhysics || OnRender - * + * * This will return the correct set of systems, but they likely won't be in * the correct order. To make sure systems are returned in the correct order * two query ordering features can be used: * - group_by * - order_by - * + * * Take a look at the system manual for a more detailed explanation of * how query features can be applied to pipelines, and how the builtin * pipeline query works. @@ -11882,7 +11882,7 @@ typedef struct ecs_pipeline_desc_t { } ecs_pipeline_desc_t; /** Create a custom pipeline. - * + * * @param world The world. * @param desc The pipeline descriptor. * @return The pipeline, 0 if failed. @@ -11990,9 +11990,9 @@ void ecs_run_pipeline( * used, but never while running a system / pipeline. * Calling ecs_set_threads() will also end the use of task threads setup with * ecs_set_task_threads() and vice-versa. - * + * * @param world The world. - * @param threads The number of threads to create. + * @param threads The number of threads to create. */ FLECS_API void ecs_set_threads( @@ -12010,18 +12010,18 @@ void ecs_set_threads( * The operation may be called multiple times to reconfigure the number of task threads * used, but never while running a system / pipeline. * Calling ecs_set_task_threads() will also end the use of threads setup with - * ecs_set_threads() and vice-versa - * + * ecs_set_threads() and vice-versa + * * @param world The world. - * @param task_threads The number of task threads to create. + * @param task_threads The number of task threads to create. */ FLECS_API void ecs_set_task_threads( ecs_world_t *world, int32_t task_threads); -/** Returns true if task thread use have been requested. - * +/** Returns true if task thread use have been requested. + * * @param world The world. * @result Whether the world is using task threads. */ @@ -12038,7 +12038,7 @@ bool ecs_using_task_threads( * @code * ECS_IMPORT(world, FlecsPipeline) * @endcode - * + * * @param world The world. */ FLECS_API @@ -12118,7 +12118,7 @@ typedef struct ecs_system_desc_t { * * It should not be assumed that the input iterator can always be iterated * with ecs_query_next(). When a system is multithreaded and/or paged, the - * iterator can be either a worker or paged iterator. The correct function + * iterator can be either a worker or paged iterator. The correct function * to use for iteration is ecs_iter_next(). * * An implementation can test whether the iterator is a query iterator by @@ -12142,7 +12142,7 @@ typedef struct ecs_system_desc_t { /** Callback to free run ctx. */ ecs_ctx_free_t run_ctx_free; - + /** Interval in seconds at which the system should run */ ecs_ftime_t interval; @@ -12224,7 +12224,7 @@ typedef struct ecs_system_t { /* Mixins */ ecs_world_t *world; ecs_entity_t entity; - flecs_poly_dtor_t dtor; + flecs_poly_dtor_t dtor; } ecs_system_t; /** Get system object. @@ -12367,7 +12367,7 @@ ecs_entity_t ecs_run_worker( * @code * ECS_IMPORT(world, FlecsSystem) * @endcode - * + * * @param world The world. */ FLECS_API @@ -12399,7 +12399,7 @@ void FlecsSystemImport( * functions to obtain statistics directly and as a module where statistics are * automatically tracked. The latter is required for statistics tracking in the * explorer. - * + * * When the addon is imported as module, statistics are tracked for each frame, * second, minute, hour, day and week with 60 datapoints per tier. */ @@ -12567,7 +12567,7 @@ typedef struct ecs_query_stats_t { int64_t last_; /** Current position in ringbuffer */ - int32_t t; + int32_t t; } ecs_query_stats_t; /** Statistics for a single system (use ecs_system_stats_get()) */ @@ -12666,7 +12666,7 @@ void ecs_query_stats_get( ecs_query_stats_t *stats); /** Reduce source measurement window into single destination measurement. */ -FLECS_API +FLECS_API void ecs_query_cache_stats_reduce( ecs_query_stats_t *dst, const ecs_query_stats_t *src); @@ -12865,7 +12865,7 @@ typedef struct { * @code * ECS_IMPORT(world, FlecsStats) * @endcode - * + * * @param world The world. */ FLECS_API @@ -13058,7 +13058,7 @@ ecs_entity_t ecs_metric_init( * @code * ECS_IMPORT(world, FlecsMetrics) * @endcode - * + * * @param world The world. */ FLECS_API @@ -13142,7 +13142,7 @@ typedef struct EcsAlertsActive { ecs_map_t alerts; } EcsAlertsActive; -/** Alert severity filter. +/** Alert severity filter. * A severity filter can adjust the severity of an alert based on whether an * entity in the alert query has a specific component. For example, a filter * could check if an entity has the "Production" tag, and increase the default @@ -13288,7 +13288,7 @@ ecs_entity_t ecs_get_alert( * @code * ECS_IMPORT(world, FlecsAlerts) * @endcode - * + * * @param world The world. */ FLECS_API @@ -14048,7 +14048,7 @@ FLECS_API extern ecs_entity_t EcsDeciBel; /**< DeciBel unit. */ * @code * ECS_IMPORT(world, FlecsUnits) * @endcode - * + * * @param world The world. */ FLECS_API @@ -14135,7 +14135,7 @@ typedef struct ecs_script_t { const char *code; } ecs_script_t; -/** Script component. +/** Script component. * This component is added to the entities of managed scripts and templates. */ typedef struct EcsScript { @@ -14149,7 +14149,7 @@ typedef struct EcsScript { /** Parse script. * This operation parses a script and returns a script object upon success. To * run the script, call ecs_script_eval(). - * + * * @param world The world. * @param name Name of the script (typically a file/module name). * @param code The script code. @@ -14163,7 +14163,7 @@ ecs_script_t* ecs_script_parse( /** Evaluate script. * This operation evaluates (runs) a parsed script. - * + * * @param script The script. * @return Zero if success, non-zero if failed. */ @@ -14173,7 +14173,7 @@ int ecs_script_eval( /** Free script. * This operation frees a script object. - * + * * Templates created by the script rely upon resources in the script object, * and for that reason keep the script alive until all templates created by the * script are deleted. @@ -14187,13 +14187,13 @@ void ecs_script_free( /** Parse script. * This parses a script and instantiates the entities in the world. * This operation is the equivalent to doing: - * + * * @code * ecs_script_t *script = ecs_script_parse(world, name, code); * ecs_script_eval(script); * ecs_script_free(script); * @endcode - * + * * @param world The world. * @param name The script name (typically the file). * @param code The script. @@ -14222,7 +14222,7 @@ int ecs_script_run_file( /** Convert script AST to string. * This operation converts the script abstract syntax tree to a string, which * can be used to debug a script. - * + * * @param script The script. * @param buf The buffer to write to. * @return Zero if success, non-zero if failed. @@ -14235,7 +14235,7 @@ int ecs_script_ast_to_buf( /** Convert script AST to string. * This operation converts the script abstract syntax tree to a string, which * can be used to debug a script. - * + * * @param script The script. * @return The string if success, NULL if failed. */ @@ -14301,19 +14301,19 @@ void ecs_script_clear( /* Script variables */ /** Create new variable scope. - * Create root variable scope. A variable scope contains one or more variables. - * Scopes can be nested, which allows variables in different scopes to have the - * same name. Variables from parent scopes will be shadowed by variables in + * Create root variable scope. A variable scope contains one or more variables. + * Scopes can be nested, which allows variables in different scopes to have the + * same name. Variables from parent scopes will be shadowed by variables in * child scopes with the same name. - * + * * Use the `ecs_script_vars_push()` and `ecs_script_vars_pop()` functions to * push and pop variable scopes. - * + * * When a variable contains allocated resources (e.g. a string), its resources * will be freed when `ecs_script_vars_pop()` is called on the scope, the - * ecs_script_vars_t::type_info field is initialized for the variable, and + * ecs_script_vars_t::type_info field is initialized for the variable, and * `ecs_type_info_t::hooks::dtor` is set. - * + * * @param world The world. */ FLECS_API @@ -14331,10 +14331,10 @@ void ecs_script_vars_fini( ecs_script_vars_t *vars); /** Push new variable scope. - * + * * Scopes created with ecs_script_vars_push() must be cleaned up with * ecs_script_vars_pop(). - * + * * If the stack and allocator arguments are left to NULL, their values will be * copied from the parent. * @@ -14360,11 +14360,11 @@ ecs_script_vars_t* ecs_script_vars_pop( /** Declare a variable. * This operation declares a new variable in the current scope. If a variable * with the specified name already exists, the operation will fail. - * + * * This operation does not allocate storage for the variable. This is done to * allow for variables that point to existing storage, which prevents having * to copy existing values to a variable scope. - * + * * @param vars The variable scope. * @param name The variable name. * @return The new variable, or NULL if the operation failed. @@ -14377,13 +14377,13 @@ ecs_script_var_t* ecs_script_vars_declare( /** Define a variable. * This operation calls `ecs_script_vars_declare()` and allocates storage for * the variable. If the type has a ctor, it will be called on the new storage. - * - * The scope's stack allocator will be used to allocate the storage. After + * + * The scope's stack allocator will be used to allocate the storage. After * `ecs_script_vars_pop()` is called on the scope, the variable storage will no * longer be valid. - * + * * The operation will fail if the type argument is not a type. - * + * * @param vars The variable scope. * @param name The variable name. * @param type The variable type. @@ -14399,10 +14399,10 @@ ecs_script_var_t* ecs_script_vars_define_id( ecs_script_vars_define_id(vars, name, ecs_id(type)) /** Lookup a variable. - * This operation looks up a variable in the current scope. If the variable + * This operation looks up a variable in the current scope. If the variable * can't be found in the current scope, the operation will recursively search * the parent scopes. - * + * * @param vars The variable scope. * @param name The variable name. * @return The variable, or NULL if one with the provided name does not exist. @@ -14576,7 +14576,7 @@ int ecs_ptr_to_str_buf( * @code * ECS_IMPORT(world, FlecsScript) * @endcode - * + * * @param world The world. */ FLECS_API @@ -14632,22 +14632,22 @@ extern "C" { FLECS_API extern const ecs_entity_t ecs_id(EcsDocDescription); /**< Component id for EcsDocDescription. */ -/** Tag for adding brief descriptions to entities. +/** Tag for adding brief descriptions to entities. * Added to an entity as (EcsDocDescription, EcsBrief) by ecs_doc_set_brief(). */ FLECS_API extern const ecs_entity_t EcsDocBrief; -/** Tag for adding detailed descriptions to entities. +/** Tag for adding detailed descriptions to entities. * Added to an entity as (EcsDocDescription, EcsDocDetail) by ecs_doc_set_detail(). */ FLECS_API extern const ecs_entity_t EcsDocDetail; -/** Tag for adding a link to entities. +/** Tag for adding a link to entities. * Added to an entity as (EcsDocDescription, EcsDocLink) by ecs_doc_set_link(). */ FLECS_API extern const ecs_entity_t EcsDocLink; -/** Tag for adding a color to entities. +/** Tag for adding a color to entities. * Added to an entity as (EcsDocDescription, EcsDocColor) by ecs_doc_set_link(). */ FLECS_API extern const ecs_entity_t EcsDocColor; @@ -14841,7 +14841,7 @@ const char* ecs_doc_get_color( * @code * ECS_IMPORT(world, FlecsDoc) * @endcode - * + * * @param world The world. */ FLECS_API @@ -15241,7 +15241,7 @@ typedef int (*ecs_meta_serialize_t)( const ecs_serializer_t *ser, const void *src); /**< Pointer to value to serialize */ -/** Opaque type reflection data. +/** Opaque type reflection data. * An opaque type is a type with an unknown layout that can be mapped to a type * known to the reflection framework. See the opaque type reflection examples. */ @@ -15358,8 +15358,8 @@ typedef struct EcsUnitPrefix { /* Serializer utilities */ -/** Serializer instruction opcodes. - * The meta type serializer works by generating a flattened array with +/** Serializer instruction opcodes. + * The meta type serializer works by generating a flattened array with * instructions that tells a serializer what kind of fields can be found in a * type at which offsets. */ @@ -15421,7 +15421,7 @@ typedef struct EcsTypeSerializer { /* Deserializer utilities */ -/** Maximum level of type nesting. +/** Maximum level of type nesting. * >32 levels of nesting is not sane. */ #define ECS_META_MAX_SCOPE_DEPTH (32) @@ -15460,12 +15460,12 @@ typedef struct ecs_meta_cursor_t { /** Create meta cursor. * A meta cursor allows for walking over, reading and writing a value without * having to know its type at compile time. - * + * * When a value is assigned through the cursor API, it will get converted to * the actual value of the underlying type. This allows the underlying type to * change without having to update the serialized data. For example, an integer * field can be set by a string, a floating point can be set as integer etc. - * + * * @param world The world. * @param type The type of the value. * @param ptr Pointer to the value. @@ -15478,7 +15478,7 @@ ecs_meta_cursor_t ecs_meta_cursor( void *ptr); /** Get pointer to current field. - * + * * @param cursor The cursor. * @return A pointer to the current field. */ @@ -15487,7 +15487,7 @@ void* ecs_meta_get_ptr( ecs_meta_cursor_t *cursor); /** Move cursor to next field. - * + * * @param cursor The cursor. * @return Zero if success, non-zero if failed. */ @@ -15496,7 +15496,7 @@ int ecs_meta_next( ecs_meta_cursor_t *cursor); /** Move cursor to a field. - * + * * @param cursor The cursor. * @return Zero if success, non-zero if failed. */ @@ -15506,7 +15506,7 @@ int ecs_meta_elem( int32_t elem); /** Move cursor to member. - * + * * @param cursor The cursor. * @param name The name of the member. * @return Zero if success, non-zero if failed. @@ -15518,7 +15518,7 @@ int ecs_meta_member( /** Move cursor to member. * Same as ecs_meta_member(), but with support for "foo.bar" syntax. - * + * * @param cursor The cursor. * @param name The name of the member. * @return Zero if success, non-zero if failed. @@ -15529,7 +15529,7 @@ int ecs_meta_dotmember( const char *name); /** Push a scope (required/only valid for structs & collections). - * + * * @param cursor The cursor. * @return Zero if success, non-zero if failed. */ @@ -15538,7 +15538,7 @@ int ecs_meta_push( ecs_meta_cursor_t *cursor); /** Pop a struct or collection scope (must follow a push). - * + * * @param cursor The cursor. * @return Zero if success, non-zero if failed. */ @@ -15547,7 +15547,7 @@ int ecs_meta_pop( ecs_meta_cursor_t *cursor); /** Is the current scope a collection?. - * + * * @param cursor The cursor. * @return True if current scope is a collection, false if not. */ @@ -15556,7 +15556,7 @@ bool ecs_meta_is_collection( const ecs_meta_cursor_t *cursor); /** Get type of current field. - * + * * @param cursor The cursor. * @return The type of the current field. */ @@ -15565,7 +15565,7 @@ ecs_entity_t ecs_meta_get_type( const ecs_meta_cursor_t *cursor); /** Get unit of current field. - * + * * @param cursor The cursor. * @return The unit of the current field. */ @@ -15574,7 +15574,7 @@ ecs_entity_t ecs_meta_get_unit( const ecs_meta_cursor_t *cursor); /** Get member name of current field. - * + * * @param cursor The cursor. * @return The member name of the current field. */ @@ -15583,7 +15583,7 @@ const char* ecs_meta_get_member( const ecs_meta_cursor_t *cursor); /** Get member entity of current field. - * + * * @param cursor The cursor. * @return The member entity of the current field. */ @@ -15596,7 +15596,7 @@ ecs_entity_t ecs_meta_get_member_id( * If no valid conversion is available, the operation will fail. */ /** Set field with boolean value. - * + * * @param cursor The cursor. * @param value The value to set. * @return Zero if success, non-zero if failed. @@ -15607,7 +15607,7 @@ int ecs_meta_set_bool( bool value); /** Set field with char value. - * + * * @param cursor The cursor. * @param value The value to set. * @return Zero if success, non-zero if failed. @@ -15618,7 +15618,7 @@ int ecs_meta_set_char( char value); /** Set field with int value. - * + * * @param cursor The cursor. * @param value The value to set. * @return Zero if success, non-zero if failed. @@ -15629,7 +15629,7 @@ int ecs_meta_set_int( int64_t value); /** Set field with uint value. - * + * * @param cursor The cursor. * @param value The value to set. * @return Zero if success, non-zero if failed. @@ -15640,7 +15640,7 @@ int ecs_meta_set_uint( uint64_t value); /** Set field with float value. - * + * * @param cursor The cursor. * @param value The value to set. * @return Zero if success, non-zero if failed. @@ -15651,7 +15651,7 @@ int ecs_meta_set_float( double value); /** Set field with string value. - * + * * @param cursor The cursor. * @param value The value to set. * @return Zero if success, non-zero if failed. @@ -15662,7 +15662,7 @@ int ecs_meta_set_string( const char *value); /** Set field with string literal value (has enclosing ""). - * + * * @param cursor The cursor. * @param value The value to set. * @return Zero if success, non-zero if failed. @@ -15673,7 +15673,7 @@ int ecs_meta_set_string_literal( const char *value); /** Set field with entity value. - * + * * @param cursor The cursor. * @param value The value to set. * @return Zero if success, non-zero if failed. @@ -15684,7 +15684,7 @@ int ecs_meta_set_entity( ecs_entity_t value); /** Set field with (component) id value. - * + * * @param cursor The cursor. * @param value The value to set. * @return Zero if success, non-zero if failed. @@ -15695,7 +15695,7 @@ int ecs_meta_set_id( ecs_id_t value); /** Set field with null value. - * + * * @param cursor The cursor. * @return Zero if success, non-zero if failed. */ @@ -15704,7 +15704,7 @@ int ecs_meta_set_null( ecs_meta_cursor_t *cursor); /** Set field with dynamic value. - * + * * @param cursor The cursor. * @param value The value to set. * @return Zero if success, non-zero if failed. @@ -15717,7 +15717,7 @@ int ecs_meta_set_value( /* Functions for getting members. */ /** Get field value as boolean. - * + * * @param cursor The cursor. * @return The value of the current field. */ @@ -15726,7 +15726,7 @@ bool ecs_meta_get_bool( const ecs_meta_cursor_t *cursor); /** Get field value as char. - * + * * @param cursor The cursor. * @return The value of the current field. */ @@ -15735,7 +15735,7 @@ char ecs_meta_get_char( const ecs_meta_cursor_t *cursor); /** Get field value as signed integer. - * + * * @param cursor The cursor. * @return The value of the current field. */ @@ -15744,7 +15744,7 @@ int64_t ecs_meta_get_int( const ecs_meta_cursor_t *cursor); /** Get field value as unsigned integer. - * + * * @param cursor The cursor. * @return The value of the current field. */ @@ -15753,7 +15753,7 @@ uint64_t ecs_meta_get_uint( const ecs_meta_cursor_t *cursor); /** Get field value as float. - * + * * @param cursor The cursor. * @return The value of the current field. */ @@ -15764,7 +15764,7 @@ double ecs_meta_get_float( /** Get field value as string. * This operation does not perform conversions. If the field is not a string, * this operation will fail. - * + * * @param cursor The cursor. * @return The value of the current field. */ @@ -15773,8 +15773,8 @@ const char* ecs_meta_get_string( const ecs_meta_cursor_t *cursor); /** Get field value as entity. - * This operation does not perform conversions. - * + * This operation does not perform conversions. + * * @param cursor The cursor. * @return The value of the current field. */ @@ -15783,16 +15783,16 @@ ecs_entity_t ecs_meta_get_entity( const ecs_meta_cursor_t *cursor); /** Get field value as (component) id. - * This operation can convert from an entity. - * + * This operation can convert from an entity. + * * @param cursor The cursor. * @return The value of the current field. */ ecs_id_t ecs_meta_get_id( const ecs_meta_cursor_t *cursor); -/** Convert pointer of primitive kind to float. - * +/** Convert pointer of primitive kind to float. + * * @param type_kind The primitive type kind of the value. * @param ptr Pointer to a value of a primitive type. * @return The value in floating point format. @@ -15810,8 +15810,8 @@ typedef struct ecs_primitive_desc_t { ecs_primitive_kind_t kind; /**< Primitive type kind. */ } ecs_primitive_desc_t; -/** Create a new primitive type. - * +/** Create a new primitive type. + * * @param world The world. * @param desc The type descriptor. * @return The new type, 0 if failed. @@ -15828,8 +15828,8 @@ typedef struct ecs_enum_desc_t { ecs_enum_constant_t constants[ECS_MEMBER_DESC_CACHE_SIZE]; /**< Enum constants. */ } ecs_enum_desc_t; -/** Create a new enum type. - * +/** Create a new enum type. + * * @param world The world. * @param desc The type descriptor. * @return The new type, 0 if failed. @@ -15846,8 +15846,8 @@ typedef struct ecs_bitmask_desc_t { ecs_bitmask_constant_t constants[ECS_MEMBER_DESC_CACHE_SIZE]; /**< Bitmask constants. */ } ecs_bitmask_desc_t; -/** Create a new bitmask type. - * +/** Create a new bitmask type. + * * @param world The world. * @param desc The type descriptor. * @return The new type, 0 if failed. @@ -15865,8 +15865,8 @@ typedef struct ecs_array_desc_t { int32_t count; /**< Number of elements. */ } ecs_array_desc_t; -/** Create a new array type. - * +/** Create a new array type. + * * @param world The world. * @param desc The type descriptor. * @return The new type, 0 if failed. @@ -15883,8 +15883,8 @@ typedef struct ecs_vector_desc_t { ecs_entity_t type; /**< Element type. */ } ecs_vector_desc_t; -/** Create a new vector type. - * +/** Create a new vector type. + * * @param world The world. * @param desc The type descriptor. * @return The new type, 0 if failed. @@ -15901,8 +15901,8 @@ typedef struct ecs_struct_desc_t { ecs_member_t members[ECS_MEMBER_DESC_CACHE_SIZE]; /**< Struct members. */ } ecs_struct_desc_t; -/** Create a new struct type. - * +/** Create a new struct type. + * * @param world The world. * @param desc The type descriptor. * @return The new type, 0 if failed. @@ -15936,7 +15936,7 @@ typedef struct ecs_opaque_desc_t { * * - value, which serializes a value (such as .c_str()) * - member, which specifies a member to be serialized (in the case of a struct) - * + * * @param world The world. * @param desc The type descriptor. * @return The new type, 0 if failed. @@ -15976,8 +15976,8 @@ typedef struct ecs_unit_desc_t { ecs_entity_t prefix; } ecs_unit_desc_t; -/** Create a new unit. - * +/** Create a new unit. + * * @param world The world. * @param desc The unit descriptor. * @return The new unit, 0 if failed. @@ -16000,8 +16000,8 @@ typedef struct ecs_unit_prefix_desc_t { ecs_unit_translation_t translation; } ecs_unit_prefix_desc_t; -/** Create a new unit prefix. - * +/** Create a new unit prefix. + * * @param world The world. * @param desc The type descriptor. * @return The new unit prefix, 0 if failed. @@ -16012,8 +16012,8 @@ ecs_entity_t ecs_unit_prefix_init( const ecs_unit_prefix_desc_t *desc); -/** Create a new quantity. - * +/** Create a new quantity. + * * @param world The world. * @param desc The quantity descriptor. * @return The new quantity, 0 if failed. @@ -16071,7 +16071,7 @@ ecs_entity_t ecs_quantity_init( * @code * ECS_IMPORT(world, FlecsMeta) * @endcode - * + * * @param world The world. */ FLECS_API @@ -16469,7 +16469,7 @@ extern "C" { FLECS_API char* ecs_cpp_get_type_name( - char *type_name, + char *type_name, const char *func_name, size_t len, size_t front_len); @@ -16539,7 +16539,7 @@ ecs_entity_t ecs_cpp_enum_constant_register( const char *name, int value); -FLECS_API +FLECS_API int32_t ecs_cpp_reset_count_get(void); FLECS_API @@ -16548,7 +16548,7 @@ int32_t ecs_cpp_reset_count_inc(void); #ifdef FLECS_META FLECS_API const ecs_member_t* ecs_cpp_last_member( - const ecs_world_t *world, + const ecs_world_t *world, ecs_entity_t type); #endif @@ -16956,7 +16956,7 @@ struct always_false { /** * @file addons/cpp/utils/array.hpp * @brief Array class. - * + * * Array class. Simple std::array like utility that is mostly there to aid * template code where template expansion would lead to an array with size 0. */ @@ -16992,7 +16992,7 @@ struct array_iterator int index_; }; -template +template struct array final { }; template @@ -17075,16 +17075,16 @@ namespace flecs { struct string_view; -// This removes dependencies on std::string (and therefore STL) and allows the +// This removes dependencies on std::string (and therefore STL) and allows the // API to return allocated strings without incurring additional allocations when // wrapping in an std::string. struct string { - explicit string() + explicit string() : str_(nullptr) , const_str_("") , length_(0) { } - explicit string(char *str) + explicit string(char *str) : str_(str) , const_str_(str ? str : "") , length_(str ? ecs_os_strlen(str) : 0) { } @@ -17142,7 +17142,7 @@ struct string { bool operator!=(const flecs::string& str) const { return !(*this == str); - } + } bool operator==(const char *str) const { if (const_str_ == str) { @@ -17158,7 +17158,7 @@ struct string { bool operator!=(const char *str) const { return !(*this == str); - } + } const char* c_str() const { return const_str_; @@ -17722,7 +17722,7 @@ enum_data enum_type(flecs::world_t *world) { namespace flecs { struct stringstream { - explicit stringstream() + explicit stringstream() : buf_({}) { } ~stringstream() { @@ -17744,7 +17744,7 @@ struct stringstream { // Ban implicit copies/allocations stringstream& operator=(const stringstream& str) = delete; - stringstream(const stringstream& str) = delete; + stringstream(const stringstream& str) = delete; stringstream& operator<<(const char* str) { ecs_strbuf_appendstr(&buf_, str); @@ -17805,16 +17805,16 @@ struct function_traits_impl template struct function_traits_impl - : function_traits_defs {}; + : function_traits_defs {}; template struct function_traits_impl : function_traits_defs {}; - + template struct function_traits_impl : function_traits_defs {}; - + template struct function_traits_impl : function_traits_defs {}; @@ -17822,7 +17822,7 @@ struct function_traits_impl template struct function_traits_impl : function_traits_defs {}; - + template struct function_traits_impl : function_traits_defs {}; @@ -17834,7 +17834,7 @@ struct function_traits_impl template struct function_traits_impl : function_traits_defs {}; - + template struct function_traits_impl : function_traits_defs {}; @@ -17850,7 +17850,7 @@ struct function_traits_no_cv template struct function_traits_no_cv : function_traits_impl {}; - + // Front facing template that decays T before ripping it apart. template struct function_traits @@ -18163,8 +18163,8 @@ struct event_builder_base { ids_.count ++; return *this; } - - /** + + /** * Add pair to emit for * @tparam First The first element of the pair. * @tparam Second the second element of a pair. @@ -18172,11 +18172,11 @@ struct event_builder_base { template Base& id() { return id( - ecs_pair(_::type::id(this->world_), + ecs_pair(_::type::id(this->world_), _::type::id(this->world_))); } - /** + /** * Add pair to emit for * @tparam First The first element of the pair. * @param second The second element of the pair id. @@ -18186,7 +18186,7 @@ struct event_builder_base { return id(ecs_pair(_::type::id(this->world_), second)); } - /** + /** * Add pair to emit for * @param first The first element of the pair type. * @param second The second element of the pair id. @@ -19442,8 +19442,8 @@ namespace flecs { /** Event builder interface */ struct metric_builder { - metric_builder(flecs::world_t *world, flecs::entity_t entity) - : world_(world) + metric_builder(flecs::world_t *world, flecs::entity_t entity) + : world_(world) { desc_.entity = entity; } @@ -20062,10 +20062,10 @@ struct is_actual { #pragma once -namespace flecs +namespace flecs { -namespace _ +namespace _ { inline void ecs_ctor_illegal(void *, int32_t, const ecs_type_info_t *ti) { @@ -20114,7 +20114,7 @@ void ctor_impl(void *ptr, int32_t count, const ecs_type_info_t *info) { // ~T() template void dtor_impl(void *ptr, int32_t count, const ecs_type_info_t *info) { - (void)info; ecs_assert(info->size == ECS_SIZEOF(T), + (void)info; ecs_assert(info->size == ECS_SIZEOF(T), ECS_INTERNAL_ERROR, NULL); T *arr = static_cast(ptr); for (int i = 0; i < count; i ++) { @@ -20124,10 +20124,10 @@ void dtor_impl(void *ptr, int32_t count, const ecs_type_info_t *info) { // T& operator=(const T&) template -void copy_impl(void *dst_ptr, const void *src_ptr, int32_t count, +void copy_impl(void *dst_ptr, const void *src_ptr, int32_t count, const ecs_type_info_t *info) { - (void)info; ecs_assert(info->size == ECS_SIZEOF(T), + (void)info; ecs_assert(info->size == ECS_SIZEOF(T), ECS_INTERNAL_ERROR, NULL); T *dst_arr = static_cast(dst_ptr); const T *src_arr = static_cast(src_ptr); @@ -20138,10 +20138,10 @@ void copy_impl(void *dst_ptr, const void *src_ptr, int32_t count, // T& operator=(T&&) template -void move_impl(void *dst_ptr, void *src_ptr, int32_t count, +void move_impl(void *dst_ptr, void *src_ptr, int32_t count, const ecs_type_info_t *info) { - (void)info; ecs_assert(info->size == ECS_SIZEOF(T), + (void)info; ecs_assert(info->size == ECS_SIZEOF(T), ECS_INTERNAL_ERROR, NULL); T *dst_arr = static_cast(dst_ptr); T *src_arr = static_cast(src_ptr); @@ -20152,10 +20152,10 @@ void move_impl(void *dst_ptr, void *src_ptr, int32_t count, // T(T&) template -void copy_ctor_impl(void *dst_ptr, const void *src_ptr, int32_t count, +void copy_ctor_impl(void *dst_ptr, const void *src_ptr, int32_t count, const ecs_type_info_t *info) { - (void)info; ecs_assert(info->size == ECS_SIZEOF(T), + (void)info; ecs_assert(info->size == ECS_SIZEOF(T), ECS_INTERNAL_ERROR, NULL); T *dst_arr = static_cast(dst_ptr); const T *src_arr = static_cast(src_ptr); @@ -20166,10 +20166,10 @@ void copy_ctor_impl(void *dst_ptr, const void *src_ptr, int32_t count, // T(T&&) template -void move_ctor_impl(void *dst_ptr, void *src_ptr, int32_t count, +void move_ctor_impl(void *dst_ptr, void *src_ptr, int32_t count, const ecs_type_info_t *info) { - (void)info; ecs_assert(info->size == ECS_SIZEOF(T), + (void)info; ecs_assert(info->size == ECS_SIZEOF(T), ECS_INTERNAL_ERROR, NULL); T *dst_arr = static_cast(dst_ptr); T *src_arr = static_cast(src_ptr); @@ -20181,10 +20181,10 @@ void move_ctor_impl(void *dst_ptr, void *src_ptr, int32_t count, // T(T&&), ~T() // Typically used when moving to a new table, and removing from the old table template -void ctor_move_dtor_impl(void *dst_ptr, void *src_ptr, int32_t count, +void ctor_move_dtor_impl(void *dst_ptr, void *src_ptr, int32_t count, const ecs_type_info_t *info) { - (void)info; ecs_assert(info->size == ECS_SIZEOF(T), + (void)info; ecs_assert(info->size == ECS_SIZEOF(T), ECS_INTERNAL_ERROR, NULL); T *dst_arr = static_cast(dst_ptr); T *src_arr = static_cast(src_ptr); @@ -20198,10 +20198,10 @@ void ctor_move_dtor_impl(void *dst_ptr, void *src_ptr, int32_t count, // Typically used when moving a component to a deleted component template ::value > = 0> -void move_dtor_impl(void *dst_ptr, void *src_ptr, int32_t count, +void move_dtor_impl(void *dst_ptr, void *src_ptr, int32_t count, const ecs_type_info_t *info) { - (void)info; ecs_assert(info->size == ECS_SIZEOF(T), + (void)info; ecs_assert(info->size == ECS_SIZEOF(T), ECS_INTERNAL_ERROR, NULL); T *dst_arr = static_cast(dst_ptr); T *src_arr = static_cast(src_ptr); @@ -20218,10 +20218,10 @@ void move_dtor_impl(void *dst_ptr, void *src_ptr, int32_t count, // Typically used when moving a component to a deleted component template ::value > = 0> -void move_dtor_impl(void *dst_ptr, void *src_ptr, int32_t count, +void move_dtor_impl(void *dst_ptr, void *src_ptr, int32_t count, const ecs_type_info_t *info) { - (void)info; ecs_assert(info->size == ECS_SIZEOF(T), + (void)info; ecs_assert(info->size == ECS_SIZEOF(T), ECS_INTERNAL_ERROR, NULL); T *dst_arr = static_cast(dst_ptr); T *src_arr = static_cast(src_ptr); @@ -20241,7 +20241,7 @@ void move_dtor_impl(void *dst_ptr, void *src_ptr, int32_t count, // Trait to test if type is constructible by flecs template struct is_flecs_constructible { - static constexpr bool value = + static constexpr bool value = std::is_default_constructible>::value; }; @@ -20255,7 +20255,7 @@ ecs_xtor_t ctor() { } // Not constructible by flecs -template ::value > = 0> ecs_xtor_t ctor() { return ecs_ctor_illegal; @@ -20286,7 +20286,7 @@ ecs_xtor_t dtor() { // Assert when the type cannot be destructed template ::value > = 0> ecs_xtor_t dtor() { - flecs_static_assert(always_false::value, + flecs_static_assert(always_false::value, "component type must be destructible"); return ecs_dtor_illegal; } @@ -20570,8 +20570,8 @@ struct world { /** Create world. */ explicit world() - : world_( ecs_init() ) { - init_builtin_components(); + : world_( ecs_init() ) { + init_builtin_components(); } /** Create world with command line arguments. @@ -20579,14 +20579,14 @@ struct world { * used in the future to configure Flecs parameters. */ explicit world(int argc, char *argv[]) - : world_( ecs_init_w_args(argc, argv) ) { - init_builtin_components(); + : world_( ecs_init_w_args(argc, argv) ) { + init_builtin_components(); } /** Create world from C world. */ explicit world(world_t *w) - : world_( w ) { + : world_( w ) { if (w) { flecs_poly_claim(w); } @@ -20634,7 +20634,7 @@ struct world { } } world_ = nullptr; - } + } } ~world() { @@ -20647,7 +20647,7 @@ struct world { /** Make current world object owner of the world. This may only be called on * one flecs::world object, an may only be called once. Failing to do so * will result in undefined behavior. - * + * * This operation allows a custom (C) world to be wrapped by a C++ object, * and transfer ownership so that the world is automatically cleaned up. */ @@ -20730,7 +20730,7 @@ struct world { /** Begin readonly mode. * * @param multi_threaded Whether to enable readonly/multi threaded mode. - * + * * @return Whether world is currently readonly. * * @see ecs_readonly_begin() @@ -20742,7 +20742,7 @@ struct world { } /** End readonly mode. - * + * * @see ecs_readonly_end() * @see flecs::world::is_readonly() * @see flecs::world::readonly_begin() @@ -20853,8 +20853,8 @@ struct world { bool is_stage() const { ecs_assert( flecs_poly_is(world_, ecs_world_t) || - flecs_poly_is(world_, ecs_stage_t), - ECS_INVALID_PARAMETER, + flecs_poly_is(world_, ecs_stage_t), + ECS_INVALID_PARAMETER, "flecs::world instance contains invalid reference to world or stage"); return flecs_poly_is(world_, ecs_stage_t); } @@ -21612,35 +21612,35 @@ struct world { */ /** Get id from a type. - * + * * @memberof flecs::world */ template flecs::id id() const; /** Id factory. - * + * * @memberof flecs::world */ template flecs::id id(Args&&... args) const; /** Get pair id from relationship, object. - * + * * @memberof flecs::world */ template flecs::id pair() const; /** Get pair id from relationship, object. - * + * * @memberof flecs::world */ template flecs::id pair(entity_t o) const; /** Get pair id from relationship, object. - * + * * @memberof flecs::world */ flecs::id pair(entity_t r, entity_t o) const; @@ -21651,7 +21651,7 @@ flecs::id pair(entity_t r, entity_t o) const; */ /** Find or register component. - * + * * @ingroup cpp_components * @memberof flecs::world */ @@ -21660,7 +21660,7 @@ flecs::component component(Args &&... args) const; /** Find or register untyped component. * Method available on flecs::world class. - * + * * @ingroup cpp_components * @memberof flecs::world */ @@ -21673,7 +21673,7 @@ flecs::untyped_component component(Args &&... args) const; */ /** Create an entity. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21681,7 +21681,7 @@ template flecs::entity entity(Args &&... args) const; /** Convert enum constant to entity. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21689,7 +21689,7 @@ template ::value > = 0> flecs::id id(E value) const; /** Convert enum constant to entity. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21697,7 +21697,7 @@ template ::value > = 0> flecs::entity entity(E value) const; /** Create a prefab. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21705,7 +21705,7 @@ template flecs::entity prefab(Args &&... args) const; /** Create an entity that's associated with a type. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21713,7 +21713,7 @@ template flecs::entity entity(const char *name = nullptr) const; /** Create a prefab that's associated with a type. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21767,7 +21767,7 @@ flecs::event_builder_typed event() const; */ /** Create a term. - * + * */ template flecs::term term(Args &&... args) const; @@ -21775,7 +21775,7 @@ flecs::term term(Args &&... args) const; /** Create a term for a (component) type. */ template -flecs::term term() const; +flecs::term term() const; /** Create a term for a pair. */ @@ -21790,7 +21790,7 @@ flecs::term term() const; */ /** Observer builder. - * + * * @memberof flecs::world * @ingroup cpp_observers * @@ -21799,14 +21799,14 @@ flecs::term term() const; /** Upcast entity to an observer. * The provided entity must be an observer. - * + * * @param e The entity. * @return An observer object. */ flecs::observer observer(flecs::entity e) const; /** Create a new observer. - * + * * @tparam Components The components to match on. * @tparam Args Arguments passed to the constructor of flecs::observer_builder. * @return Observer builder. @@ -21829,20 +21829,20 @@ flecs::observer_builder observer(Args &&... args) const; */ /** Create a query. - * + * * @see ecs_query_init */ template flecs::query query(Args &&... args) const; /** Create a query from entity. - * + * * @see ecs_query_init */ flecs::query<> query(flecs::entity query_entity) const; /** Create a query builder. - * + * * @see ecs_query_init */ template @@ -21860,7 +21860,7 @@ flecs::query_builder query_builder(Args &&... args) const; * @code * void(*)(flecs::entity, T&, U&, ...) * @endcode - * + * */ template void each(Func&& func) const; @@ -21877,7 +21877,7 @@ void each(Func&& func) const; * @code * void(*)(flecs::entity, T&) * @endcode - * + * */ template void each(Func&& func) const; @@ -21894,7 +21894,7 @@ void each(flecs::id_t term_id, Func&& func) const; */ /** Convert enum constant to entity. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21908,17 +21908,17 @@ flecs::entity to_entity(E constant) const; * @brief Module world mixin. */ -/** +/** * @memberof flecs::world * @ingroup cpp_addons_modules - * + * * @{ */ /** Define a module. * This operation is not mandatory, but can be called inside the module ctor to * obtain the entity associated with the module, or override the module name. - * + * * @tparam Module module class. * @return Module entity. */ @@ -21926,7 +21926,7 @@ template flecs::entity module(const char *name = nullptr) const; /** Import a module. - * + * * @tparam Module module class. * @return Module entity. */ @@ -22040,7 +22040,7 @@ bool using_task_threads() const; * @brief System module world mixin. */ -/** +/** * @memberof flecs::world * @ingroup cpp_addons_systems * @@ -22049,14 +22049,14 @@ bool using_task_threads() const; /** Upcast entity to a system. * The provided entity must be a system. - * + * * @param e The entity. * @return A system object. */ flecs::system system(flecs::entity e) const; /** Create a new system. - * + * * @tparam Components The components to match on. * @tparam Args Arguments passed to the constructor of flecs::system_builder. * @return System builder. @@ -22153,7 +22153,7 @@ flecs::string to_expr(const T* value) { /** * @memberof flecs::world * @ingroup cpp_addons_meta - * + * * @{ */ @@ -22196,7 +22196,7 @@ flecs::entity vector(); */ /** Serialize untyped value to JSON. - * + * * @memberof flecs::world * @ingroup cpp_addons_json */ @@ -22206,7 +22206,7 @@ flecs::string to_json(flecs::entity_t tid, const void* value) { } /** Serialize value to JSON. - * + * * @memberof flecs::world * @ingroup cpp_addons_json */ @@ -22217,7 +22217,7 @@ flecs::string to_json(const T* value) { } /** Serialize world to JSON. - * + * * @memberof flecs::world * @ingroup cpp_addons_json */ @@ -22226,7 +22226,7 @@ flecs::string to_json() { } /** Deserialize value from JSON. - * + * * @memberof flecs::world * @ingroup cpp_addons_json */ @@ -22235,7 +22235,7 @@ const char* from_json(flecs::entity_t tid, void* value, const char *json, flecs: } /** Deserialize value from JSON. - * + * * @memberof flecs::world * @ingroup cpp_addons_json */ @@ -22246,7 +22246,7 @@ const char* from_json(T* value, const char *json, flecs::from_json_desc_t *desc } /** Deserialize JSON into world. - * + * * @memberof flecs::world * @ingroup cpp_addons_json */ @@ -22255,7 +22255,7 @@ const char* from_json(const char *json, flecs::from_json_desc_t *desc = nullptr) } /** Deserialize JSON file into world. - * + * * @memberof flecs::world * @ingroup cpp_addons_json */ @@ -22278,9 +22278,9 @@ const char* from_json_file(const char *json, flecs::from_json_desc_t *desc = nul */ /** Return app builder. - * The app builder is a convenience wrapper around a loop that runs + * The app builder is a convenience wrapper around a loop that runs * world::progress. An app allows for writing platform agnostic code, - * as it provides hooks to modules for overtaking the main loop which is + * as it provides hooks to modules for overtaking the main loop which is * required for frameworks like emscripten. */ flecs::app_builder app() { @@ -22295,7 +22295,7 @@ flecs::app_builder app() { # ifdef FLECS_METRICS /** Create metric. - * + * * @ingroup cpp_addons_metrics * @memberof flecs::world */ @@ -22306,7 +22306,7 @@ flecs::metric_builder metric(Args &&... args) const; # ifdef FLECS_ALERTS /** Create alert. - * + * * @ingroup cpp_addons_alerts * @memberof flecs::world */ @@ -22842,10 +22842,10 @@ struct iter { /** Free iterator resources. * This operation only needs to be called when the iterator is not iterated * until completion (e.g. the last call to next() did not return false). - * + * * Failing to call this operation on an unfinished iterator will throw a * fatal LEAK_DETECTED error. - * + * * @see ecs_iter_fini() */ void fini() { @@ -22925,7 +22925,7 @@ struct iter { flecs::untyped_field get_unchecked_field_at(int8_t index, size_t row) const { size_t size = ecs_field_size(iter_, index); return flecs::untyped_field( - ecs_field_at_w_size(iter_, 0, index, static_cast(row)), + ecs_field_at_w_size(iter_, 0, index, static_cast(row)), size, 1, false); } @@ -22948,10 +22948,10 @@ struct iter { /** * @file addons/cpp/entity_view.hpp * @brief Entity class with only readonly operations. - * - * This class provides readonly access to entities. Using this class to store + * + * This class provides readonly access to entities. Using this class to store * entities in components ensures valid handles, as this class will always store - * the actual world vs. a stage. The constructors of this class will never + * the actual world vs. a stage. The constructors of this class will never * create a new entity. * * To obtain a mutable handle to the entity, use the "mut" function. @@ -22969,7 +22969,7 @@ namespace flecs /** Entity view. * Class with read operations for entities. Base for flecs::entity. - * + * * @ingroup cpp_entities */ struct entity_view : public id { @@ -22982,13 +22982,13 @@ struct entity_view : public id { * @param id The entity id. */ explicit entity_view(flecs::world_t *world, flecs::id_t id) - : flecs::id(world + : flecs::id(world ? const_cast(ecs_get_world(world)) : nullptr , id ) { } /** Implicit conversion from flecs::entity_t to flecs::entity_view. */ - entity_view(entity_t id) + entity_view(entity_t id) : flecs::id( nullptr, id ) { } /** Get entity id. @@ -23005,7 +23005,7 @@ struct entity_view : public id { bool is_valid() const { return world_ && ecs_is_valid(world_, id_); } - + explicit operator bool() const { return is_valid(); } @@ -23040,7 +23040,7 @@ struct entity_view : public id { */ flecs::string path(const char *sep = "::", const char *init_sep = "::") const { return path_from(0, sep, init_sep); - } + } /** Return the entity path relative to a parent. * @@ -23130,10 +23130,10 @@ struct entity_view : public id { * @endcode * * @tparam First The relationship for which to iterate the targets. - * @param func The function invoked for each target. + * @param func The function invoked for each target. */ template - void each(const Func& func) const { + void each(const Func& func) const { return each(_::type::id(world_), func); } @@ -23145,7 +23145,7 @@ struct entity_view : public id { * @endcode * * @param rel The relationship to follow. - * @param func The function invoked for each child. + * @param func The function invoked for each child. */ template void children(flecs::entity_t rel, Func&& func) const { @@ -23173,7 +23173,7 @@ struct entity_view : public id { * @endcode * * @tparam Rel The relationship to follow. - * @param func The function invoked for each child. + * @param func The function invoked for each child. */ template void children(Func&& func) const { @@ -23186,10 +23186,10 @@ struct entity_view : public id { * @code * void(*)(flecs::entity target) * @endcode - * + * * This operation follows the ChildOf relationship. * - * @param func The function invoked for each child. + * @param func The function invoked for each child. */ template void children(Func&& func) const { @@ -23197,7 +23197,7 @@ struct entity_view : public id { } /** Get component value. - * + * * @tparam T The component to get. * @return Pointer to the component value, nullptr if the entity does not * have the component. @@ -23213,12 +23213,12 @@ struct entity_view : public id { /** Get component value. * Overload for when T is not the same as the actual type, which happens * when using pair types. - * + * * @tparam T The component to get. * @return Pointer to the component value, nullptr if the entity does not * have the component. */ - template , + template , if_t< flecs::is_pair::value > = 0> const A* get() const { auto comp_id = _::type::id(world_); @@ -23233,14 +23233,14 @@ struct entity_view : public id { * @tparam First The first element of the pair. * @tparam Second the second element of a pair. */ - template , + template , typename A = actual_type_t

, if_not_t< flecs::is_pair::value > = 0> const A* get() const { return this->get

(); } /** Get a pair. - * This operation gets the value for a pair from the entity. + * This operation gets the value for a pair from the entity. * * @tparam First The first element of the pair. * @param second The second element of the pair. @@ -23255,7 +23255,7 @@ struct entity_view : public id { } /** Get a pair. - * This operation gets the value for a pair from the entity. + * This operation gets the value for a pair from the entity. * * @tparam First The first element of the pair. * @param constant the enum constant. @@ -23268,7 +23268,7 @@ struct entity_view : public id { } /** Get component value (untyped). - * + * * @param comp The component to get. * @return Pointer to the component value, nullptr if the entity does not * have the component. @@ -23279,7 +23279,7 @@ struct entity_view : public id { /** Get a pair (untyped). * This operation gets the value for a pair from the entity. If neither the - * first nor the second part of the pair are components, the operation + * first nor the second part of the pair are components, the operation * will fail. * * @param first The first element of the pair. @@ -23296,25 +23296,25 @@ struct entity_view : public id { * * This operation is faster than individually calling get for each component * as it only obtains entity metadata once. - * + * * While the callback is invoked the table in which the components are * stored is locked, which prevents mutations that could cause invalidation - * of the component references. Note that this is not an actual lock: - * invalid access causes a runtime panic and so it is still up to the + * of the component references. Note that this is not an actual lock: + * invalid access causes a runtime panic and so it is still up to the * application to ensure access is protected. - * + * * The component arguments must be references and can be either const or * non-const. When all arguments are const, the function will read-lock the * table (see ecs_read_begin). If one or more arguments are non-const the * function will write-lock the table (see ecs_write_begin). - * + * * Example: * * @code * e.get([](Position& p, Velocity& v) { // write lock * p.x += v.x; * }); - * + * * e.get([](const Position& p) { // read lock * std::cout << p.x << std::endl; * }); @@ -23327,7 +23327,7 @@ struct entity_view : public id { bool get(const Func& func) const; /** Get enum constant. - * + * * @tparam T The enum type for which to get the constant * @return Constant entity if found, 0 entity if not. */ @@ -23363,7 +23363,7 @@ struct entity_view : public id { } /** Get mutable component value. - * + * * @tparam T The component to get. * @return Pointer to the component value, nullptr if the entity does not * have the component. @@ -23379,12 +23379,12 @@ struct entity_view : public id { /** Get mutable component value. * Overload for when T is not the same as the actual type, which happens * when using pair types. - * + * * @tparam T The component to get. * @return Pointer to the component value, nullptr if the entity does not * have the component. */ - template , + template , if_t< flecs::is_pair::value > = 0> A* get_mut() const { auto comp_id = _::type::id(world_); @@ -23399,14 +23399,14 @@ struct entity_view : public id { * @tparam First The first element of the pair. * @tparam Second the second element of a pair. */ - template , + template , typename A = actual_type_t

, if_not_t< flecs::is_pair::value > = 0> A* get_mut() const { return this->get_mut

(); } /** Get a mutable pair. - * This operation gets the value for a pair from the entity. + * This operation gets the value for a pair from the entity. * * @tparam First The first element of the pair. * @param second The second element of the pair. @@ -23414,14 +23414,14 @@ struct entity_view : public id { template::value> = 0> First* get_mut(Second second) const { auto comp_id = _::type::id(world_); - ecs_assert(_::type::size() != 0, ECS_INVALID_PARAMETER, + ecs_assert(_::type::size() != 0, ECS_INVALID_PARAMETER, "operation invalid for empty type"); return static_cast( ecs_get_mut_id(world_, id_, ecs_pair(comp_id, second))); } /** Get a mutable pair. - * This operation gets the value for a pair from the entity. + * This operation gets the value for a pair from the entity. * * @tparam First The first element of the pair. * @param constant the enum constant. @@ -23434,7 +23434,7 @@ struct entity_view : public id { } /** Get mutable component value (untyped). - * + * * @param comp The component to get. * @return Pointer to the component value, nullptr if the entity does not * have the component. @@ -23445,7 +23445,7 @@ struct entity_view : public id { /** Get a mutable pair (untyped). * This operation gets the value for a pair from the entity. If neither the - * first nor the second part of the pair are components, the operation + * first nor the second part of the pair are components, the operation * will fail. * * @param first The first element of the pair. @@ -23465,7 +23465,7 @@ struct entity_view : public id { template Second* get_mut_second(flecs::entity_t first) const { auto second = _::type::id(world_); - ecs_assert(_::type::size() != 0, ECS_INVALID_PARAMETER, + ecs_assert(_::type::size() != 0, ECS_INVALID_PARAMETER, "operation invalid for empty type"); return static_cast( ecs_get_mut_id(world_, id_, ecs_pair(first, second))); @@ -23509,15 +23509,15 @@ struct entity_view : public id { * the specified relationship. If the entity itself has the id then entity will * be returned. If the id cannot be found on the entity or by following the * relationship, the operation will return 0. - * + * * This operation can be used to lookup, for example, which prefab is providing * a component by specifying the IsA pair: - * + * * @code * // Is Position provided by the entity or one of its base entities? * ecs_get_target_for_id(world, entity, EcsIsA, ecs_id(Position)) * @endcode - * + * * @param relationship The relationship to follow. * @param id The id to lookup. * @return The entity for which the target has been found. @@ -23551,11 +23551,11 @@ struct entity_view : public id { /** Get parent of entity. * Short for target(flecs::ChildOf). - * + * * @return The parent of the entity. */ flecs::entity parent() const; - + /** Lookup an entity by name. * Lookup an entity in the scope of this entity. The provided path may * contain double colons as scope separators, for example: "Foo::Bar". @@ -23573,7 +23573,7 @@ struct entity_view : public id { */ bool has(flecs::id_t e) const { return ecs_has_id(world_, id_, e); - } + } /** Check if entity has the provided component. * @@ -23598,7 +23598,7 @@ struct entity_view : public id { /** Check if entity has the provided enum constant. * * @tparam E The enum type (can be deduced). - * @param value The enum constant to check. + * @param value The enum constant to check. * @return True if the entity has the provided constant, false otherwise. */ template ::value > = 0> @@ -23778,11 +23778,11 @@ struct entity_view : public id { flecs::entity clone(bool clone_value = true, flecs::entity_t dst_id = 0) const; - /** Return mutable entity handle for current stage + /** Return mutable entity handle for current stage * When an entity handle created from the world is used while the world is - * in staged mode, it will only allow for readonly operations since + * in staged mode, it will only allow for readonly operations since * structural changes are not allowed on the world while in staged mode. - * + * * To do mutations on the entity, this operation provides a handle to the * entity that uses the stage instead of the actual world. * @@ -23791,7 +23791,7 @@ struct entity_view : public id { * main world. * * Also note that this operation is not necessary when doing mutations on an - * entity outside of a system. It is allowed to do entity operations + * entity outside of a system. It is allowed to do entity operations * directly on the world, as long as the world is not in staged mode. * * @param stage The current stage. @@ -23810,7 +23810,7 @@ struct entity_view : public id { /** Same as mut(world), but for entity. * This operation allows for the construction of a mutable entity handle - * from another entity. This is useful in each() functions, which only + * from another entity. This is useful in each() functions, which only * provide a handle to the entity being iterated over. * * @param e Another mutable entity. @@ -23825,7 +23825,7 @@ struct entity_view : public id { */ /** Serialize entity to JSON. - * + * * @memberof flecs::entity_view * @ingroup cpp_addons_json */ @@ -23914,7 +23914,7 @@ const char* doc_color() const { */ /** Return number of alerts for entity. - * + * * @memberof flecs::entity_view * @ingroup cpp_addons_alerts */ @@ -23930,7 +23930,7 @@ int32_t alert_count(flecs::entity_t alert = 0) const { */ /** Convert entity to enum constant. - * + * * @memberof flecs::entity_view * @ingroup cpp_entities */ @@ -23944,9 +23944,9 @@ E to_constant() const; */ /** Emit event for entity. - * + * * @memberof flecs::entity_view - * + * * @param evt The event to emit. */ void emit(flecs::entity_t evt) const { @@ -23957,17 +23957,17 @@ void emit(flecs::entity_t evt) const { } /** Emit event for entity. - * + * * @memberof flecs::entity_view - * + * * @param evt The event to emit. */ void emit(flecs::entity evt) const; /** Emit event for entity. - * + * * @memberof flecs::entity_view - * + * * @tparam Evt The event to emit. */ template ::value> = 0> @@ -23976,9 +23976,9 @@ void emit() const { } /** Emit event with payload for entity. - * + * * @memberof flecs::entity_view - * + * * @tparam Evt The event to emit. */ template ::value> = 0> @@ -23992,9 +23992,9 @@ void emit(const Evt& payload) const { /** Enqueue event for entity. - * + * * @memberof flecs::entity_view - * + * * @param evt The event to enqueue. */ void enqueue(flecs::entity_t evt) const { @@ -24005,17 +24005,17 @@ void enqueue(flecs::entity_t evt) const { } /** Enqueue event for entity. - * + * * @memberof flecs::entity_view - * + * * @param evt The event to enqueue. */ void enqueue(flecs::entity evt) const; /** Enqueue event for entity. - * + * * @memberof flecs::entity_view - * + * * @tparam Evt The event to enqueue. */ template ::value> = 0> @@ -24024,9 +24024,9 @@ void enqueue() const { } /** Enqueue event with payload for entity. - * + * * @memberof flecs::entity_view - * + * * @tparam Evt The event to enqueue. */ template ::value> = 0> @@ -24057,7 +24057,7 @@ void enqueue(const Evt& payload) const { namespace flecs { -/** Entity builder. +/** Entity builder. * @ingroup cpp_entities */ template @@ -24067,7 +24067,7 @@ struct entity_builder : entity_view { /** Add a component to an entity. * To ensure the component is initialized, it should have a constructor. - * + * * @tparam T the component type to add. */ template @@ -24081,10 +24081,10 @@ struct entity_builder : entity_view { /** Add pair for enum constant. * This operation will add a pair to the entity where the first element is * the enumeration type, and the second element the enumeration constant. - * + * * The operation may be used with regular (C style) enumerations as well as * enum classes. - * + * * @param value The enumeration value. */ template ::value > = 0> @@ -24170,7 +24170,7 @@ struct entity_builder : entity_view { /** Conditional add. * This operation adds if condition is true, removes if condition is false. - * + * * @param cond The condition to evaluate. * @param component The component to add. */ @@ -24184,7 +24184,7 @@ struct entity_builder : entity_view { /** Conditional add. * This operation adds if condition is true, removes if condition is false. - * + * * @tparam T The component to add. * @param cond The condition to evaluate. */ @@ -24199,7 +24199,7 @@ struct entity_builder : entity_view { /** Conditional add. * This operation adds if condition is true, removes if condition is false. - * + * * @param cond The condition to evaluate. * @param first The first element of the pair. * @param second The second element of the pair. @@ -24221,7 +24221,7 @@ struct entity_builder : entity_view { /** Conditional add. * This operation adds if condition is true, removes if condition is false. - * + * * @tparam First The first element of the pair * @param cond The condition to evaluate. * @param second The second element of the pair. @@ -24233,7 +24233,7 @@ struct entity_builder : entity_view { /** Conditional add. * This operation adds if condition is true, removes if condition is false. - * + * * @tparam First The first element of the pair * @tparam Second The second element of the pair * @param cond The condition to evaluate. @@ -24245,7 +24245,7 @@ struct entity_builder : entity_view { /** Conditional add. * This operation adds if condition is true, removes if condition is false. - * + * * @param cond The condition to evaluate. * @param constant The enumeration constant. */ @@ -24310,7 +24310,7 @@ struct entity_builder : entity_view { /** Shortcut for `add(SlotOf, target(ChildOf))`. */ const Self& slot() const { - ecs_check(ecs_get_target(world_, id_, flecs::ChildOf, 0), + ecs_check(ecs_get_target(world_, id_, flecs::ChildOf, 0), ECS_INVALID_PARAMETER, "add ChildOf pair before using slot()"); return this->slot_of(this->target(flecs::ChildOf)); error: @@ -24325,7 +24325,7 @@ struct entity_builder : entity_view { const Self& child_of() const { return this->child_of(_::type::id(this->world_)); } - + /** Shortcut for `add(DependsOn, entity)`. * * @tparam T the type associated with the entity. @@ -24356,7 +24356,7 @@ struct entity_builder : entity_view { /** Remove pair for enum. * This operation will remove any `(Enum, *)` pair from the entity. - * + * * @tparam E The enumeration type. */ template ::value > = 0> @@ -24429,7 +24429,7 @@ struct entity_builder : entity_view { const auto& et = enum_type(this->world_); flecs::entity_t second = et.entity(constant); return this->remove(second); - } + } /** Mark id for auto-overriding. * When an entity inherits from a base entity (using the `IsA` relationship) @@ -24541,8 +24541,8 @@ struct entity_builder : entity_view { * @tparam Second The second element of the pair. * @param val The value to set. */ - template , - typename A = actual_type_t

, if_not_t< flecs::is_pair::value> = 0> + template , + typename A = actual_type_t

, if_not_t< flecs::is_pair::value> = 0> const Self& set_auto_override(const A& val) const { this->auto_override(); return this->set(val); @@ -24555,8 +24555,8 @@ struct entity_builder : entity_view { * @tparam Second The second element of the pair. * @param val The value to set. */ - template , - typename A = actual_type_t

, if_not_t< flecs::is_pair::value> = 0> + template , + typename A = actual_type_t

, if_not_t< flecs::is_pair::value> = 0> const Self& set_auto_override(A&& val) const { this->auto_override(); return this->set(FLECS_FWD(val)); @@ -24572,10 +24572,10 @@ struct entity_builder : entity_view { const Self& emplace_auto_override(Args&&... args) const { this->auto_override(); - flecs::emplace(this->world_, this->id_, + flecs::emplace(this->world_, this->id_, _::type::id(this->world_), FLECS_FWD(args)...); - return to_base(); + return to_base(); } /** Emplace pair, mark pair for auto-overriding. @@ -24585,18 +24585,18 @@ struct entity_builder : entity_view { * @tparam Second The second element of the pair to emplace and override. * @param args The arguments to pass to the constructor of `Second`. */ - template , + template , typename A = actual_type_t

, if_not_t< flecs::is_pair::value> = 0, typename ... Args> const Self& emplace_auto_override(Args&&... args) const { this->auto_override(); - flecs::emplace(this->world_, this->id_, + flecs::emplace(this->world_, this->id_, ecs_pair(_::type::id(this->world_), _::type::id(this->world_)), FLECS_FWD(args)...); - return to_base(); + return to_base(); } /** Enable an entity. @@ -24609,7 +24609,7 @@ struct entity_builder : entity_view { } /** Disable an entity. - * Disabled entities are not matched with systems and cannot be searched + * Disabled entities are not matched with systems and cannot be searched * with queries, unless explicitly specified in the query expression. */ const Self& disable() const { @@ -24620,7 +24620,7 @@ struct entity_builder : entity_view { /** Enable an id. * This sets the enabled bit for this component. If this is the first time * the component is enabled or disabled, the bitset is added. - * + * * @param id The id to enable. * @param toggle True to enable, false to disable (default = true). * @@ -24628,7 +24628,7 @@ struct entity_builder : entity_view { */ const Self& enable(flecs::id_t id, bool toggle = true) const { ecs_enable_id(this->world_, this->id_, id, toggle); - return to_base(); + return to_base(); } /** Enable a component. @@ -24755,7 +24755,7 @@ struct entity_builder : entity_view { return to_base(); } - template, if_not_t< + template, if_not_t< is_actual::value > = 0> const Self& set(A&& value) const { flecs::set(this->world_, this->id_, FLECS_FWD(value)); @@ -24777,7 +24777,7 @@ struct entity_builder : entity_view { * @tparam Second The second element of the pair * @param value The value to set. */ - template , + template , typename A = actual_type_t

, if_not_t< flecs::is_pair::value> = 0> const Self& set(A&& value) const { flecs::set

(this->world_, this->id_, FLECS_FWD(value)); @@ -24792,7 +24792,7 @@ struct entity_builder : entity_view { * @tparam Second The second element of the pair * @param value The value to set. */ - template , + template , typename A = actual_type_t

, if_not_t< flecs::is_pair::value> = 0> const Self& set(const A& value) const { flecs::set

(this->world_, this->id_, value); @@ -24810,7 +24810,7 @@ struct entity_builder : entity_view { template ::value > = 0> const Self& set(Second second, const First& value) const { auto first = _::type::id(this->world_); - flecs::set(this->world_, this->id_, value, + flecs::set(this->world_, this->id_, value, ecs_pair(first, second)); return to_base(); } @@ -24826,7 +24826,7 @@ struct entity_builder : entity_view { template ::value > = 0> const Self& set(Second second, First&& value) const { auto first = _::type::id(this->world_); - flecs::set(this->world_, this->id_, FLECS_FWD(value), + flecs::set(this->world_, this->id_, FLECS_FWD(value), ecs_pair(first, second)); return to_base(); } @@ -24857,7 +24857,7 @@ struct entity_builder : entity_view { template const Self& set_second(entity_t first, const Second& value) const { auto second = _::type::id(this->world_); - flecs::set(this->world_, this->id_, value, + flecs::set(this->world_, this->id_, value, ecs_pair(first, second)); return to_base(); } @@ -24873,7 +24873,7 @@ struct entity_builder : entity_view { template const Self& set_second(entity_t first, Second&& value) const { auto second = _::type::id(this->world_); - flecs::set(this->world_, this->id_, FLECS_FWD(value), + flecs::set(this->world_, this->id_, FLECS_FWD(value), ecs_pair(first, second)); return to_base(); } @@ -24882,7 +24882,7 @@ struct entity_builder : entity_view { const Self& set_second(const Second& value) const { flecs::set>(this->world_, this->id_, value); return to_base(); - } + } /** Set 1..N components. * This operation accepts a callback with as arguments the components to @@ -24913,7 +24913,7 @@ struct entity_builder : entity_view { * T{flecs::entity, Args...} * @endcode * - * If the second signature matches, emplace will pass in the current entity + * If the second signature matches, emplace will pass in the current entity * as argument to the constructor, which is useful if the component needs * to be aware of the entity to which it has been added. * @@ -24925,15 +24925,15 @@ struct entity_builder : entity_view { */ template> const Self& emplace(Args&&... args) const { - flecs::emplace(this->world_, this->id_, + flecs::emplace(this->world_, this->id_, _::type::id(this->world_), FLECS_FWD(args)...); return to_base(); } - template , + template , typename A = actual_type_t

, if_not_t< flecs::is_pair::value> = 0> const Self& emplace(Args&&... args) const { - flecs::emplace(this->world_, this->id_, + flecs::emplace(this->world_, this->id_, ecs_pair(_::type::id(this->world_), _::type::id(this->world_)), FLECS_FWD(args)...); @@ -24942,7 +24942,7 @@ struct entity_builder : entity_view { template const Self& emplace_first(flecs::entity_t second, Args&&... args) const { - flecs::emplace(this->world_, this->id_, + flecs::emplace(this->world_, this->id_, ecs_pair(_::type::id(this->world_), second), FLECS_FWD(args)...); return to_base(); @@ -24950,7 +24950,7 @@ struct entity_builder : entity_view { template const Self& emplace_second(flecs::entity_t first, Args&&... args) const { - flecs::emplace(this->world_, this->id_, + flecs::emplace(this->world_, this->id_, ecs_pair(first, _::type::id(this->world_)), FLECS_FWD(args)...); return to_base(); @@ -24989,7 +24989,7 @@ struct entity_builder : entity_view { */ template const Self& with(entity_t first, const Func& func) const { - ecs_id_t prev = ecs_set_with(this->world_, + ecs_id_t prev = ecs_set_with(this->world_, ecs_pair(first, this->id_)); func(); ecs_set_with(this->world_, prev); @@ -25116,13 +25116,13 @@ const Self& set_doc_color(const char *link) const { /** * @memberof flecs::entity_view * @ingroup cpp_addons_meta - * + * * @{ */ /** Make entity a unit */ const Self& unit( - const char *symbol, + const char *symbol, flecs::entity_t prefix = 0, flecs::entity_t base = 0, flecs::entity_t over = 0, @@ -25143,7 +25143,7 @@ const Self& unit( } /** Make entity a derived unit */ -const Self& unit( +const Self& unit( flecs::entity_t prefix = 0, flecs::entity_t base = 0, flecs::entity_t over = 0, @@ -25163,7 +25163,7 @@ const Self& unit( } /** Make entity a derived unit */ -const Self& unit_prefix( +const Self& unit_prefix( const char *symbol, int32_t factor = 0, int32_t power = 0) const @@ -25207,13 +25207,13 @@ const Self& quantity() const { */ /** Set component from JSON. - * + * * @memberof flecs::entity_builder * @ingroup cpp_addons_json */ const Self& set_json( - flecs::id_t e, - const char *json, + flecs::id_t e, + const char *json, flecs::from_json_desc_t *desc = nullptr) const { flecs::entity_t type = ecs_get_typeid(world_, e); @@ -25231,57 +25231,57 @@ const Self& set_json( } /** Set pair from JSON. - * + * * @memberof flecs::entity_builder * @ingroup cpp_addons_json */ const Self& set_json( - flecs::entity_t r, + flecs::entity_t r, flecs::entity_t t, - const char *json, + const char *json, flecs::from_json_desc_t *desc = nullptr) const { return set_json(ecs_pair(r, t), json, desc); } /** Set component from JSON. - * + * * @memberof flecs::entity_builder * @ingroup cpp_addons_json */ template const Self& set_json( - const char *json, + const char *json, flecs::from_json_desc_t *desc = nullptr) const { return set_json(_::type::id(world_), json, desc); } /** Set pair from JSON. - * + * * @memberof flecs::entity_builder * @ingroup cpp_addons_json */ template const Self& set_json( - const char *json, + const char *json, flecs::from_json_desc_t *desc = nullptr) const { return set_json( - _::type::id(world_), + _::type::id(world_), _::type::id(world_), json, desc); } /** Set pair from JSON. - * + * * @memberof flecs::entity_builder * @ingroup cpp_addons_json */ template const Self& set_json( flecs::entity_t t, - const char *json, + const char *json, flecs::from_json_desc_t *desc = nullptr) const { return set_json( @@ -25290,14 +25290,14 @@ const Self& set_json( } /** Set pair from JSON. - * + * * @memberof flecs::entity_builder * @ingroup cpp_addons_json */ template const Self& set_json_second( flecs::entity_t r, - const char *json, + const char *json, flecs::from_json_desc_t *desc = nullptr) const { return set_json( @@ -25313,9 +25313,9 @@ const Self& set_json_second( */ /** Observe event on entity - * + * * @memberof flecs::entity_builder - * + * * @param evt The event id. * @param callback The observer callback. * @return Event builder. @@ -25324,9 +25324,9 @@ template const Self& observe(flecs::entity_t evt, Func&& callback) const; /** Observe event on entity - * + * * @memberof flecs::entity_builder - * + * * @tparam Evt The event type. * @param callback The observer callback. * @return Event builder. @@ -25335,7 +25335,7 @@ template const Self& observe(Func&& callback) const; /** Observe event on entity - * + * * @memberof flecs::entity_builder * * @param callback The observer callback. @@ -25677,7 +25677,7 @@ struct entity : entity_builder # ifdef FLECS_JSON /** Deserialize entity to JSON. - * + * * @memberof flecs::entity * @ingroup cpp_addons_json */ @@ -26958,7 +26958,7 @@ struct untyped_component : entity { /** * @memberof flecs::component * @ingroup cpp_addons_meta - * + * * @{ */ @@ -26966,12 +26966,12 @@ struct untyped_component : entity { /** Private method that adds member to component. */ untyped_component& internal_member( - flecs::entity_t type_id, - flecs::entity_t unit, - const char *name, - int32_t count = 0, - size_t offset = 0, - bool use_offset = false) + flecs::entity_t type_id, + flecs::entity_t unit, + const char *name, + int32_t count = 0, + size_t offset = 0, + bool use_offset = false) { ecs_entity_desc_t desc = {}; desc.name = name; @@ -26992,44 +26992,44 @@ untyped_component& internal_member( return *this; } -public: +public: /** Add member with unit. */ untyped_component& member( - flecs::entity_t type_id, - flecs::entity_t unit, - const char *name, - int32_t count = 0) + flecs::entity_t type_id, + flecs::entity_t unit, + const char *name, + int32_t count = 0) { return internal_member(type_id, unit, name, count, 0, false); } /** Add member with unit, count and offset. */ untyped_component& member( - flecs::entity_t type_id, - flecs::entity_t unit, - const char *name, - int32_t count, - size_t offset) + flecs::entity_t type_id, + flecs::entity_t unit, + const char *name, + int32_t count, + size_t offset) { return internal_member(type_id, unit, name, count, offset, true); } /** Add member. */ untyped_component& member( - flecs::entity_t type_id, + flecs::entity_t type_id, const char* name, - int32_t count = 0) + int32_t count = 0) { return member(type_id, 0, name, count); } /** Add member with count and offset. */ untyped_component& member( - flecs::entity_t type_id, - const char* name, - int32_t count, - size_t offset) + flecs::entity_t type_id, + const char* name, + int32_t count, + size_t offset) { return member(type_id, 0, name, count, offset); } @@ -27038,7 +27038,7 @@ untyped_component& member( template untyped_component& member( const char *name, - int32_t count = 0) + int32_t count = 0) { flecs::entity_t type_id = _::type::id(world_); return member(type_id, name, count); @@ -27048,8 +27048,8 @@ untyped_component& member( template untyped_component& member( const char *name, - int32_t count, - size_t offset) + int32_t count, + size_t offset) { flecs::entity_t type_id = _::type::id(world_); return member(type_id, name, count, offset); @@ -27059,8 +27059,8 @@ untyped_component& member( template untyped_component& member( flecs::entity_t unit, - const char *name, - int32_t count = 0) + const char *name, + int32_t count = 0) { flecs::entity_t type_id = _::type::id(world_); return member(type_id, unit, name, count); @@ -27070,9 +27070,9 @@ untyped_component& member( template untyped_component& member( flecs::entity_t unit, - const char *name, - int32_t count, - size_t offset) + const char *name, + int32_t count, + size_t offset) { flecs::entity_t type_id = _::type::id(world_); return member(type_id, unit, name, count, offset); @@ -27082,7 +27082,7 @@ untyped_component& member( template untyped_component& member( const char *name, - int32_t count = 0) + int32_t count = 0) { flecs::entity_t type_id = _::type::id(world_); flecs::entity_t unit_id = _::type::id(world_); @@ -27092,9 +27092,9 @@ untyped_component& member( /** Add member with unit. */ template untyped_component& member( - const char *name, - int32_t count, - size_t offset) + const char *name, + int32_t count, + size_t offset) { flecs::entity_t type_id = _::type::id(world_); flecs::entity_t unit_id = _::type::id(world_); @@ -27102,11 +27102,11 @@ untyped_component& member( } /** Add member using pointer-to-member. */ -template ::type> untyped_component& member( - const char* name, - const MemberType ComponentType::* ptr) + const char* name, + const MemberType ComponentType::* ptr) { flecs::entity_t type_id = _::type::id(world_); size_t offset = reinterpret_cast(&(static_cast(nullptr)->*ptr)); @@ -27114,12 +27114,12 @@ untyped_component& member( } /** Add member with unit using pointer-to-member. */ -template ::type> untyped_component& member( - flecs::entity_t unit, - const char* name, - const MemberType ComponentType::* ptr) + flecs::entity_t unit, + const char* name, + const MemberType ComponentType::* ptr) { flecs::entity_t type_id = _::type::id(world_); size_t offset = reinterpret_cast(&(static_cast(nullptr)->*ptr)); @@ -27127,11 +27127,11 @@ untyped_component& member( } /** Add member with unit using pointer-to-member. */ -template ::type> untyped_component& member( - const char* name, - const MemberType ComponentType::* ptr) + const char* name, + const MemberType ComponentType::* ptr) { flecs::entity_t type_id = _::type::id(world_); flecs::entity_t unit_id = _::type::id(world_); @@ -27142,7 +27142,7 @@ untyped_component& member( /** Add constant. */ untyped_component& constant( const char *name, - int32_t value) + int32_t value) { ecs_add_id(world_, id_, _::type::id(world_)); @@ -27152,7 +27152,7 @@ untyped_component& constant( ecs_entity_t eid = ecs_entity_init(world_, &desc); ecs_assert(eid != 0, ECS_INTERNAL_ERROR, NULL); - ecs_set_id(world_, eid, + ecs_set_id(world_, eid, ecs_pair(flecs::Constant, flecs::I32), sizeof(int32_t), &value); @@ -27161,8 +27161,8 @@ untyped_component& constant( /** Add bitmask constant. */ untyped_component& bit( - const char *name, - uint32_t value) + const char *name, + uint32_t value) { ecs_add_id(world_, id_, _::type::id(world_)); @@ -27172,7 +27172,7 @@ untyped_component& bit( ecs_entity_t eid = ecs_entity_init(world_, &desc); ecs_assert(eid != 0, ECS_INTERNAL_ERROR, NULL); - ecs_set_id(world_, eid, + ecs_set_id(world_, eid, ecs_pair(flecs::Constant, flecs::U32), sizeof(uint32_t), &value); @@ -27182,7 +27182,7 @@ untyped_component& bit( /** Register array metadata for component */ template untyped_component& array( - int32_t elem_count) + int32_t elem_count) { ecs_array_desc_t desc = {}; desc.entity = id_; @@ -27195,7 +27195,7 @@ untyped_component& array( /** Add member value range */ untyped_component& range( double min, - double max) + double max) { const flecs::member_t *m = ecs_cpp_last_member(world_, id_); if (!m) { @@ -27217,7 +27217,7 @@ untyped_component& range( /** Add member warning range */ untyped_component& warning_range( double min, - double max) + double max) { const flecs::member_t *m = ecs_cpp_last_member(world_, id_); if (!m) { @@ -27239,7 +27239,7 @@ untyped_component& warning_range( /** Add member error range */ untyped_component& error_range( double min, - double max) + double max) { const flecs::member_t *m = ecs_cpp_last_member(world_, id_); if (!m) { @@ -27270,7 +27270,7 @@ untyped_component& error_range( /** * @memberof flecs::component * @ingroup cpp_addons_metrics - * + * * @{ */ @@ -27278,11 +27278,11 @@ untyped_component& error_range( * When no explicit name is provided, this operation will derive the metric name * from the member name. When the member name is "value", the operation will use * the name of the component. - * - * When the brief parameter is provided, it is set on the metric as if - * set_doc_brief is used. The brief description can be obtained with + * + * When the brief parameter is provided, it is set on the metric as if + * set_doc_brief is used. The brief description can be obtained with * get_doc_brief. - * + * * @tparam Kind Metric kind (Counter, CounterIncrement or Gauge). * @param parent Parent entity of the metric (optional). * @param brief Description for metric (optional). @@ -27290,8 +27290,8 @@ untyped_component& error_range( */ template untyped_component& metric( - flecs::entity_t parent = 0, - const char *brief = nullptr, + flecs::entity_t parent = 0, + const char *brief = nullptr, const char *name = nullptr); /** @} */ @@ -28072,7 +28072,7 @@ template struct page_iterable; template -struct worker_iterable; +struct worker_iterable; template struct iterable { @@ -28138,7 +28138,7 @@ struct iterable { /** Page iterator. * Create an iterator that limits the returned entities with offset/limit. - * + * * @param offset How many entities to skip. * @param limit The maximum number of entities to return. * @return Iterable that can be iterated with each/iter. @@ -28148,7 +28148,7 @@ struct iterable { /** Worker iterator. * Create an iterator that divides the number of matched entities across * a number of resources. - * + * * @param index The index of the current resource. * @param count The total number of resources to divide entities between. * @return Iterable that can be iterated with each/iter. @@ -28214,7 +28214,7 @@ struct iterable { template struct iter_iterable final : iterable { template - iter_iterable(Iterable *it, flecs::world_t *world) + iter_iterable(Iterable *it, flecs::world_t *world) { it_ = it->get_iter(world); next_ = it->next_action(); @@ -28268,7 +28268,7 @@ struct iter_iterable final : iterable { */ /** Serialize iterator result to JSON. - * + * * @memberof flecs::iter * @ingroup cpp_addons_json */ @@ -28361,7 +28361,7 @@ iter_iterable iterable::iter(flecs::entity e) cons template struct page_iterable final : iterable { template - page_iterable(int32_t offset, int32_t limit, Iterable *it) + page_iterable(int32_t offset, int32_t limit, Iterable *it) : offset_(offset) , limit_(limit) { @@ -28385,15 +28385,15 @@ struct page_iterable final : iterable { template page_iterable iterable::page( - int32_t offset, - int32_t limit) + int32_t offset, + int32_t limit) { return page_iterable(offset, limit, this); } template struct worker_iterable final : iterable { - worker_iterable(int32_t offset, int32_t limit, iterable *it) + worker_iterable(int32_t offset, int32_t limit, iterable *it) : offset_(offset) , limit_(limit) { @@ -28417,8 +28417,8 @@ struct worker_iterable final : iterable { template worker_iterable iterable::worker( - int32_t index, - int32_t count) + int32_t index, + int32_t count) { return worker_iterable(index, count, this); } @@ -28508,26 +28508,26 @@ inline flecs::id world::id(Args&&... args) const { template inline flecs::id world::pair() const { return flecs::id( - world_, + world_, ecs_pair( - _::type::id(world_), + _::type::id(world_), _::type::id(world_))); } template inline flecs::id world::pair(entity_t o) const { - ecs_assert(!ECS_IS_PAIR(o), ECS_INVALID_PARAMETER, + ecs_assert(!ECS_IS_PAIR(o), ECS_INVALID_PARAMETER, "cannot create nested pairs"); return flecs::id( world_, ecs_pair( - _::type::id(world_), + _::type::id(world_), o)); } inline flecs::id world::pair(entity_t r, entity_t o) const { - ecs_assert(!ECS_IS_PAIR(r) && !ECS_IS_PAIR(o), ECS_INVALID_PARAMETER, + ecs_assert(!ECS_IS_PAIR(r) && !ECS_IS_PAIR(o), ECS_INVALID_PARAMETER, "cannot create nested pairs"); return flecs::id( @@ -28567,7 +28567,7 @@ const T* entity_view::get() const { if (c) { // Get constant value from constant entity const T* v = static_cast(ecs_get_id(world_, c, r)); - ecs_assert(v != NULL, ECS_INTERNAL_ERROR, + ecs_assert(v != NULL, ECS_INTERNAL_ERROR, "missing enum constant value"); return v; } else { @@ -28577,25 +28577,25 @@ const T* entity_view::get() const { } template -inline flecs::entity entity_view::target(int32_t index) const +inline flecs::entity entity_view::target(int32_t index) const { - return flecs::entity(world_, + return flecs::entity(world_, ecs_get_target(world_, id_, _::type::id(world_), index)); } inline flecs::entity entity_view::target( - flecs::entity_t relationship, - int32_t index) const + flecs::entity_t relationship, + int32_t index) const { - return flecs::entity(world_, + return flecs::entity(world_, ecs_get_target(world_, id_, relationship, index)); } inline flecs::entity entity_view::target_for( - flecs::entity_t relationship, - flecs::id_t id) const + flecs::entity_t relationship, + flecs::id_t id) const { - return flecs::entity(world_, + return flecs::entity(world_, ecs_get_target_for_id(world_, id_, relationship, id)); } @@ -28614,26 +28614,26 @@ inline flecs::entity entity_view::parent() const { } inline flecs::entity entity_view::mut(const flecs::world& stage) const { - ecs_assert(!stage.is_readonly(), ECS_INVALID_PARAMETER, + ecs_assert(!stage.is_readonly(), ECS_INVALID_PARAMETER, "cannot use readonly world/stage to create mutable handle"); return flecs::entity(id_).set_stage(stage.c_ptr()); } inline flecs::entity entity_view::mut(const flecs::iter& it) const { - ecs_assert(!it.world().is_readonly(), ECS_INVALID_PARAMETER, + ecs_assert(!it.world().is_readonly(), ECS_INVALID_PARAMETER, "cannot use iterator created for readonly world/stage to create mutable handle"); return flecs::entity(id_).set_stage(it.world().c_ptr()); } inline flecs::entity entity_view::mut(const flecs::entity_view& e) const { - ecs_assert(!e.world().is_readonly(), ECS_INVALID_PARAMETER, + ecs_assert(!e.world().is_readonly(), ECS_INVALID_PARAMETER, "cannot use entity created for readonly world/stage to create mutable handle"); return flecs::entity(id_).set_stage(e.world_); } inline flecs::entity entity_view::set_stage(world_t *stage) { return flecs::entity(stage, id_); -} +} inline flecs::type entity_view::type() const { return flecs::type(world_, ecs_get_type(world_, id_)); @@ -28646,7 +28646,7 @@ inline flecs::table entity_view::table() const { inline flecs::table_range entity_view::range() const { ecs_record_t *r = ecs_record_find(world_, id_); if (r) { - return flecs::table_range(world_, r->table, + return flecs::table_range(world_, r->table, ECS_RECORD_TO_ROW(r->row), 1); } return flecs::table_range(); @@ -28665,7 +28665,7 @@ inline void entity_view::each(const Func& func) const { for (int i = 0; i < count; i ++) { ecs_id_t id = ids[i]; flecs::id ent(world_, id); - func(ent); + func(ent); } } @@ -28691,7 +28691,7 @@ inline void entity_view::each(flecs::id_t pred, flecs::id_t obj, const Func& fun int32_t cur = 0; id_t *ids = type->array; - + while (-1 != (cur = ecs_search_offset(real_world, table, cur, pattern, 0))) { flecs::id ent(world_, ids[cur]); @@ -28711,7 +28711,7 @@ inline void entity_view::each(const flecs::entity_view& rel, const Func& func) c template ::value > > inline bool entity_view::get(const Func& func) const { return _::entity_with_delegate::invoke_get(world_, id_, func); -} +} inline flecs::entity entity_view::lookup(const char *path, bool search_path) const { ecs_assert(id_ != 0, ECS_INVALID_PARAMETER, "invalid lookup from null handle"); @@ -28749,7 +28749,7 @@ inline flecs::entity world::entity(E value) const { template inline flecs::entity world::entity(const char *name) const { - return flecs::entity(world_, + return flecs::entity(world_, _::type::id_explicit(world_, name, true, 0, false) ); } @@ -28826,7 +28826,7 @@ namespace _ { return flecs::InOut; } - template ::value || is_reference::value > = 0> constexpr flecs::inout_kind_t type_to_inout() { return flecs::InOutDefault; @@ -28844,11 +28844,11 @@ namespace _ { template struct sig { - sig(flecs::world_t *world) + sig(flecs::world_t *world) : world_(world) , ids({ (_::type>::id(world))... }) , inout ({ (type_to_inout())... }) - , oper ({ (type_to_oper())... }) + , oper ({ (type_to_oper())... }) { } flecs::world_t *world_; @@ -28864,9 +28864,9 @@ namespace _ { const flecs::type_info_t *ti = ecs_get_type_info(world_, id); if (ti) { // Union relationships always return a value of type - // flecs::entity_t which holds the target id of the + // flecs::entity_t which holds the target id of the // union relationship. - // If a union component with a non-zero size (like an + // If a union component with a non-zero size (like an // enum) is added to the query signature, the each/iter // functions would accept a parameter of the component // type instead of flecs::entity_t, which would cause @@ -28888,14 +28888,14 @@ namespace _ { } // namespace flecs -namespace flecs +namespace flecs { /** Term identifier builder. * A term identifier describes a single identifier in a term. Identifier * descriptions can reference entities by id, name or by variable, which means * the entity will be resolved when the term is evaluated. - * + * * @ingroup cpp_core_queries */ template @@ -28919,10 +28919,10 @@ struct term_ref_builder_i { } /* Specify value of identifier by id. Almost the same as id(entity), but this - * operation explicitly sets the flecs::IsEntity flag. This forces the id to + * operation explicitly sets the flecs::IsEntity flag. This forces the id to * be interpreted as entity, whereas not setting the flag would implicitly * convert ids for builtin variables such as flecs::This to a variable. - * + * * This function can also be used to disambiguate id(0), which would match * both id(entity_t) and id(const char*). */ @@ -28961,7 +28961,7 @@ struct term_ref_builder_i { virtual flecs::world_t* world_v() = 0; void assert_term_ref() { - ecs_assert(term_ref_ != NULL, ECS_INVALID_PARAMETER, + ecs_assert(term_ref_ != NULL, ECS_INVALID_PARAMETER, "no active term (call .with() first)"); } @@ -28971,16 +28971,16 @@ struct term_ref_builder_i { } }; -/** Term builder interface. - * A term is a single element of a query expression. - * +/** Term builder interface. + * A term is a single element of a query expression. + * * @ingroup cpp_core_queries */ template struct term_builder_i : term_ref_builder_i { term_builder_i() : term_(nullptr) { } - term_builder_i(ecs_term_t *term_ptr) { + term_builder_i(ecs_term_t *term_ptr) { set_term(term_ptr); } @@ -29004,7 +29004,7 @@ struct term_builder_i : term_ref_builder_i { return *this; } - /* Call prior to setting values for second identifier. This is the second + /* Call prior to setting values for second identifier. This is the second * element of a pair. Requires that first() is populated as well. */ Base& second() { this->assert_term(); @@ -29167,10 +29167,10 @@ struct term_builder_i : term_ref_builder_i { } /** Set read/write access for stage. Use this when a system reads or writes - * components other than the ones provided by the query. This information + * components other than the ones provided by the query. This information * can be used by schedulers to insert sync/merge points between systems * where deferred operations are flushed. - * + * * Setting this is optional. If not set, the value of the accessed component * may be out of sync for at most one frame. */ @@ -29183,8 +29183,8 @@ struct term_builder_i : term_ref_builder_i { return *this; } - /** Short for inout_stage(flecs::Out). - * Use when system uses add, remove or set. + /** Short for inout_stage(flecs::Out). + * Use when system uses add, remove or set. */ Base& write() { return this->inout_stage(flecs::Out); @@ -29269,9 +29269,9 @@ struct term_builder_i : term_ref_builder_i { /** Match singleton. */ Base& singleton() { this->assert_term(); - ecs_assert(term_->id || term_->first.id, ECS_INVALID_PARAMETER, + ecs_assert(term_->id || term_->first.id, ECS_INVALID_PARAMETER, "no component specified for singleton"); - + flecs::id_t sid = term_->id; if (!sid) { sid = term_->first.id; @@ -29309,13 +29309,13 @@ struct term_builder_i : term_ref_builder_i { private: void assert_term() { - ecs_assert(term_ != NULL, ECS_INVALID_PARAMETER, + ecs_assert(term_ != NULL, ECS_INVALID_PARAMETER, "no active term (call .with() first)"); } operator Base&() { return *static_cast(this); - } + } }; } @@ -29324,7 +29324,7 @@ struct term_builder_i : term_ref_builder_i { namespace flecs { /** Class that describes a term. - * + * * @ingroup cpp_core_queries */ struct term final : term_builder_i { @@ -29333,7 +29333,7 @@ struct term final : term_builder_i { , value({}) , world_(nullptr) { } - term(flecs::world_t *world_ptr) + term(flecs::world_t *world_ptr) : term_builder_i(&value) , value({}) , world_(world_ptr) { } @@ -29366,10 +29366,10 @@ struct term final : term_builder_i { this->set_term(&value); } - term(id_t id) + term(id_t id) : term_builder_i(&value) , value({}) - , world_(nullptr) { + , world_(nullptr) { if (id & ECS_ID_FLAGS_MASK) { value.id = id; } else { @@ -29377,10 +29377,10 @@ struct term final : term_builder_i { } } - term(id_t r, id_t o) + term(id_t r, id_t o) : term_builder_i(&value) , value({}) - , world_(nullptr) { + , world_(nullptr) { value.id = ecs_pair(r, o); } @@ -29467,7 +29467,7 @@ inline flecs::term world::term() const { /** * @file addons/cpp/utils/builder.hpp * @brief Builder base class. - * + * * Generic functionality for builder classes. */ @@ -29491,7 +29491,7 @@ struct builder : IBuilder , desc_{} , world_(world) { } - builder(const builder& f) + builder(const builder& f) : IBase(&desc_, f.term_index_) { world_ = f.world_; @@ -29529,16 +29529,16 @@ struct builder : IBuilder #pragma once -namespace flecs +namespace flecs { /** Query builder interface. - * + * * @ingroup cpp_core_queries */ template struct query_builder_i : term_builder_i { - query_builder_i(ecs_query_desc_t *desc, int32_t term_index = 0) + query_builder_i(ecs_query_desc_t *desc, int32_t term_index = 0) : term_index_(term_index) , expr_count_(0) , desc_(desc) { } @@ -29741,18 +29741,18 @@ struct query_builder_i : term_builder_i { Base& term() { if (this->term_) { - ecs_check(ecs_term_is_initialized(this->term_), - ECS_INVALID_OPERATION, + ecs_check(ecs_term_is_initialized(this->term_), + ECS_INVALID_OPERATION, "query_builder::term() called without initializing term"); } - ecs_check(term_index_ < FLECS_TERM_COUNT_MAX, + ecs_check(term_index_ < FLECS_TERM_COUNT_MAX, ECS_INVALID_PARAMETER, "maximum number of terms exceeded"); this->set_term(&desc_->terms[term_index_]); term_index_ ++; - + error: return *this; } @@ -29763,18 +29763,18 @@ struct query_builder_i : term_builder_i { term_index_ = term_index; this->term(); term_index_ = prev_index; - ecs_assert(ecs_term_is_initialized(this->term_), + ecs_assert(ecs_term_is_initialized(this->term_), ECS_INVALID_PARAMETER, NULL); return *this; } /** Sort the output of a query. * This enables sorting of entities across matched tables. As a result of this - * operation, the order of entities in the matched tables may be changed. + * operation, the order of entities in the matched tables may be changed. * Resorting happens when a query iterator is obtained, and only if the table * data has changed. * - * If multiple queries that match the same (down)set of tables specify different + * If multiple queries that match the same (down)set of tables specify different * sorting functions, resorting is likely to happen every time an iterator is * obtained, which can significantly slow down iterations. * @@ -29785,7 +29785,7 @@ struct query_builder_i : term_builder_i { * * @tparam T The component used to sort. * @param compare The compare function used to sort the components. - */ + */ template Base& order_by(int(*compare)(flecs::entity_t, const T*, flecs::entity_t, const T*)) { ecs_order_by_action_t cmp = reinterpret_cast(compare); @@ -29797,7 +29797,7 @@ struct query_builder_i : term_builder_i { * * @param component The component used to sort. * @param compare The compare function used to sort the components. - */ + */ Base& order_by(flecs::entity_t component, int(*compare)(flecs::entity_t, const void*, flecs::entity_t, const void*)) { desc_->order_by_callback = reinterpret_cast(compare); desc_->order_by = component; @@ -29807,12 +29807,12 @@ struct query_builder_i : term_builder_i { /** Group and sort matched tables. * Similar to ecs_query_order_by(), but instead of sorting individual entities, this * operation only sorts matched tables. This can be useful of a query needs to - * enforce a certain iteration order upon the tables it is iterating, for + * enforce a certain iteration order upon the tables it is iterating, for * example by giving a certain component or tag a higher priority. * * The sorting function assigns a "rank" to each type, which is then used to * sort the tables. Tables with higher ranks will appear later in the iteration. - * + * * Resorting happens when a query iterator is obtained, and only if the set of * matched tables for a query has changed. If table sorting is enabled together * with entity sorting, table sorting takes precedence, and entities will be @@ -29903,12 +29903,12 @@ namespace flecs { namespace _ { template using query_builder_base = builder< - query, ecs_query_desc_t, query_builder, + query, ecs_query_desc_t, query_builder, query_builder_i, Components ...>; } /** Query builder. - * + * * @ingroup cpp_core_queries */ template @@ -30357,7 +30357,7 @@ struct node_builder : IBuilder namespace flecs { /** Observer builder interface. - * + * * @ingroup cpp_observers */ template @@ -30368,7 +30368,7 @@ struct observer_builder_i : query_builder_i { , desc_(nullptr) , event_count_(0) { } - observer_builder_i(ecs_observer_desc_t *desc) + observer_builder_i(ecs_observer_desc_t *desc) : BaseClass(&desc->query) , desc_(desc) , event_count_(0) { } @@ -30427,12 +30427,12 @@ namespace flecs { namespace _ { template using observer_builder_base = node_builder< - observer, ecs_observer_desc_t, observer_builder, + observer, ecs_observer_desc_t, observer_builder, observer_builder_i, Components ...>; } /** Observer builder. - * + * * @ingroup cpp_observers */ template @@ -30447,7 +30447,7 @@ struct observer_builder final : _::observer_builder_base { } -namespace flecs +namespace flecs { struct observer final : entity @@ -30497,7 +30497,7 @@ inline observer_builder world::observer(Args &&... args) const { #pragma once -namespace flecs +namespace flecs { // Mixin implementation @@ -30518,7 +30518,7 @@ namespace _ { flecs::entity_t entity, ecs_iter_action_t callback, void *callback_ctx, - ecs_ctx_free_t callback_ctx_free) + ecs_ctx_free_t callback_ctx_free) { ecs_observer_desc_t desc = {}; desc.events[0] = event; @@ -30542,7 +30542,7 @@ namespace _ { { using Delegate = _::entity_observer_delegate; auto ctx = FLECS_NEW(Delegate)(FLECS_FWD(f)); - entity_observer_create(world, _::type::id(world), entity, Delegate::run, ctx, + entity_observer_create(world, _::type::id(world), entity, Delegate::run, ctx, reinterpret_cast(_::free_obj)); } @@ -30554,7 +30554,7 @@ namespace _ { { using Delegate = _::entity_payload_observer_delegate; auto ctx = FLECS_NEW(Delegate)(FLECS_FWD(f)); - entity_observer_create(world, _::type::id(world), entity, Delegate::run, ctx, + entity_observer_create(world, _::type::id(world), entity, Delegate::run, ctx, reinterpret_cast(_::free_obj)); } }; @@ -30760,11 +30760,11 @@ inline flecs::entity world::import() { #pragma once -namespace flecs +namespace flecs { /** System builder interface. - * + * * @ingroup cpp_addons_systems */ template @@ -30773,7 +30773,7 @@ struct system_builder_i : query_builder_i { using BaseClass = query_builder_i; public: - system_builder_i(ecs_system_desc_t *desc) + system_builder_i(ecs_system_desc_t *desc) : BaseClass(&desc->query) , desc_(desc) { } @@ -30843,7 +30843,7 @@ struct system_builder_i : query_builder_i { } /** Set system rate. - * This operation will cause the system to be ran at a multiple of the + * This operation will cause the system to be ran at a multiple of the * provided tick source. The tick source may be any entity, including * another system. * @@ -30857,7 +30857,7 @@ struct system_builder_i : query_builder_i { } /** Set system rate. - * This operation will cause the system to be ran at a multiple of the + * This operation will cause the system to be ran at a multiple of the * frame tick frequency. If a tick source was provided, this just updates * the rate of the system. * @@ -30919,12 +30919,12 @@ namespace flecs { namespace _ { template using system_builder_base = node_builder< - system, ecs_system_desc_t, system_builder, + system, ecs_system_desc_t, system_builder, system_builder_i, Components ...>; } /** System builder. - * + * * @ingroup cpp_addons_systems */ template @@ -30944,16 +30944,16 @@ struct system_builder final : _::system_builder_base { } -namespace flecs +namespace flecs { struct system_runner_fluent { system_runner_fluent( - world_t *world, - entity_t id, - int32_t stage_current, - int32_t stage_count, - ecs_ftime_t delta_time, + world_t *world, + entity_t id, + int32_t stage_current, + int32_t stage_count, + ecs_ftime_t delta_time, void *param) : stage_(world) , id_(id) @@ -30981,7 +30981,7 @@ struct system_runner_fluent { if (stage_count_) { ecs_run_worker( stage_, id_, stage_current_, stage_count_, delta_time_, - param_); + param_); } else { ecs_run(stage_, id_, delta_time_, param_); } @@ -31032,10 +31032,10 @@ struct system final : entity } system_runner_fluent run_worker( - int32_t stage_current, - int32_t stage_count, - ecs_ftime_t delta_time = 0.0f, - void *param = nullptr) const + int32_t stage_current, + int32_t stage_count, + ecs_ftime_t delta_time = 0.0f, + void *param = nullptr) const { return system_runner_fluent( world_, id_, stage_current, stage_count, delta_time, param); @@ -31152,12 +31152,12 @@ inline void system_init(flecs::world& world) { namespace flecs { /** Pipeline builder interface. - * + * * @ingroup cpp_pipelines */ template struct pipeline_builder_i : query_builder_i { - pipeline_builder_i(ecs_pipeline_desc_t *desc, int32_t term_index = 0) + pipeline_builder_i(ecs_pipeline_desc_t *desc, int32_t term_index = 0) : query_builder_i(&desc->query, term_index) , desc_(desc) { } @@ -31172,12 +31172,12 @@ namespace flecs { namespace _ { template using pipeline_builder_base = builder< - pipeline, ecs_pipeline_desc_t, pipeline_builder, + pipeline, ecs_pipeline_desc_t, pipeline_builder, pipeline_builder_i, Components ...>; } /** Pipeline builder. - * + * * @ingroup cpp_pipelines */ template @@ -31197,7 +31197,7 @@ namespace flecs { template struct pipeline : entity { - pipeline(world_t *world, ecs_pipeline_desc_t *desc) + pipeline(world_t *world, ecs_pipeline_desc_t *desc) : entity(world) { id_ = ecs_pipeline_init(world, desc); @@ -31543,7 +31543,7 @@ namespace _ { inline void init(flecs::world& world) { world.component("flecs::rest::Rest"); } - + } // namespace _ } // namespace rest } // namespace flecs @@ -31814,7 +31814,7 @@ inline units::units(flecs::world& world) { // Initialize current units world.entity - ("::flecs::units::ElectricCurrent::Ampere"); + ("::flecs::units::ElectricCurrent::Ampere"); // Initialize amount units world.entity("::flecs::units::Amount::Mole"); @@ -32019,7 +32019,7 @@ inline metric_builder& metric_builder::member(const char *name) { flecs::entity e (world_, _::type::id(world_)); flecs::entity_t m = e.lookup(name); if (!m) { - flecs::log::err("member '%s' not found in type '%s'", + flecs::log::err("member '%s' not found in type '%s'", name, e.path().c_str()); return *this; } @@ -32057,9 +32057,9 @@ inline flecs::metric_builder world::metric(Args &&... args) const { template inline untyped_component& untyped_component::metric( - flecs::entity_t parent, - const char *brief, - const char *metric_name) + flecs::entity_t parent, + const char *brief, + const char *metric_name) { flecs::world w(world_); flecs::entity e(world_, id_); @@ -32121,7 +32121,7 @@ inline untyped_component& untyped_component::metric( namespace flecs { /** Alert builder interface. - * + * * @ingroup cpp_addons_alerts */ template @@ -32134,21 +32134,21 @@ struct alert_builder_i : query_builder_i { : BaseClass(nullptr) , desc_(nullptr) { } - alert_builder_i(ecs_alert_desc_t *desc, int32_t term_index = 0) + alert_builder_i(ecs_alert_desc_t *desc, int32_t term_index = 0) : BaseClass(&desc->query, term_index) , desc_(desc) { } /** Alert message. * * @see ecs_alert_desc_t::message - */ + */ Base& message(const char *message) { desc_->message = message; return *this; } /** Set brief description for alert. - * + * * @see ecs_alert_desc_t::brief */ Base& brief(const char *brief) { @@ -32157,7 +32157,7 @@ struct alert_builder_i : query_builder_i { } /** Set doc name for alert. - * + * * @see ecs_alert_desc_t::doc_name */ Base& doc_name(const char *doc_name) { @@ -32165,8 +32165,8 @@ struct alert_builder_i : query_builder_i { return *this; } - /** Set severity of alert (default is Error) - * + /** Set severity of alert (default is Error) + * * @see ecs_alert_desc_t::severity */ Base& severity(flecs::entity_t kind) { @@ -32174,8 +32174,8 @@ struct alert_builder_i : query_builder_i { return *this; } - /* Set retain period of alert. - * + /* Set retain period of alert. + * * @see ecs_alert_desc_t::retain_period */ Base& retain_period(ecs_ftime_t period) { @@ -32183,8 +32183,8 @@ struct alert_builder_i : query_builder_i { return *this; } - /** Set severity of alert (default is Error) - * + /** Set severity of alert (default is Error) + * * @see ecs_alert_desc_t::severity */ template @@ -32194,10 +32194,10 @@ struct alert_builder_i : query_builder_i { /** Add severity filter */ Base& severity_filter(flecs::entity_t kind, flecs::id_t with, const char *var = nullptr) { - ecs_assert(severity_filter_count < ECS_ALERT_MAX_SEVERITY_FILTERS, + ecs_assert(severity_filter_count < ECS_ALERT_MAX_SEVERITY_FILTERS, ECS_INVALID_PARAMETER, "Maximum number of severity filters reached"); - ecs_alert_severity_filter_t *filter = + ecs_alert_severity_filter_t *filter = &desc_->severity_filters[severity_filter_count ++]; filter->severity = kind; @@ -32215,7 +32215,7 @@ struct alert_builder_i : query_builder_i { /** Add severity filter */ template ::value > = 0> Base& severity_filter(const char *var = nullptr) { - return severity_filter(_::type::id(world_v()), + return severity_filter(_::type::id(world_v()), _::type::id(world_v()), var); } @@ -32224,7 +32224,7 @@ struct alert_builder_i : query_builder_i { Base& severity_filter(T with, const char *var = nullptr) { flecs::world w(world_v()); flecs::entity constant = w.to_entity(with); - return severity_filter(_::type::id(world_v()), + return severity_filter(_::type::id(world_v()), w.pair(constant), var); } @@ -32277,12 +32277,12 @@ namespace flecs { namespace _ { template using alert_builder_base = builder< - alert, ecs_alert_desc_t, alert_builder, + alert, ecs_alert_desc_t, alert_builder, alert_builder_i, Components ...>; } /** Alert builder. - * + * * @ingroup cpp_addons_alerts */ template @@ -32354,7 +32354,7 @@ inline flecs::alert_builder world::alert(Args &&... args) const { #pragma once -namespace flecs +namespace flecs { inline flecs::entity script_builder::run() const { @@ -32383,8 +32383,8 @@ inline field::field(iter &iter, int32_t index) { template T& field::operator[](size_t index) const { - ecs_assert(data_ != nullptr, ECS_INVALID_OPERATION, - "invalid nullptr dereference of component type %s", + ecs_assert(data_ != nullptr, ECS_INVALID_OPERATION, + "invalid nullptr dereference of component type %s", _::type_name()); ecs_assert(index < count_, ECS_COLUMN_INDEX_OUT_OF_RANGE, "index %d out of range for array of component type %s", @@ -32402,8 +32402,8 @@ T& field::operator[](size_t index) const { */ template T& field::operator*() const { - ecs_assert(data_ != nullptr, ECS_INVALID_OPERATION, - "invalid nullptr dereference of component type %s", + ecs_assert(data_ != nullptr, ECS_INVALID_OPERATION, + "invalid nullptr dereference of component type %s", _::type_name()); return *data_; } @@ -32415,10 +32415,10 @@ T& field::operator*() const { */ template T* field::operator->() const { - ecs_assert(data_ != nullptr, ECS_INVALID_OPERATION, - "invalid nullptr dereference of component type %s", + ecs_assert(data_ != nullptr, ECS_INVALID_OPERATION, + "invalid nullptr dereference of component type %s", _::type_name()); - ecs_assert(data_ != nullptr, ECS_INVALID_OPERATION, + ecs_assert(data_ != nullptr, ECS_INVALID_OPERATION, "-> operator invalid for array with >1 element of " "component type %s, use [row] instead", _::type_name()); @@ -32454,7 +32454,7 @@ inline flecs::world iter::world() const { } inline flecs::entity iter::entity(size_t row) const { - ecs_assert(row < static_cast(iter_->count), + ecs_assert(row < static_cast(iter_->count), ECS_COLUMN_INDEX_OUT_OF_RANGE, NULL); return flecs::entity(iter_->world, iter_->entities[row]); } @@ -32488,7 +32488,7 @@ inline flecs::table iter::other_table() const { } inline flecs::table_range iter::range() const { - return flecs::table_range(iter_->real_world, iter_->table, + return flecs::table_range(iter_->real_world, iter_->table, iter_->offset, iter_->count); } @@ -32538,7 +32538,7 @@ inline flecs::entity iter::get_var(const char *name) const { #pragma once -namespace flecs +namespace flecs { inline void world::init_builtin_components() { @@ -32603,7 +32603,7 @@ inline flecs::entity world::get_scope() const { template inline flecs::entity world::set_scope() const { - return set_scope( _::type::id(world_) ); + return set_scope( _::type::id(world_) ); } inline entity world::lookup(const char *name, const char *sep, const char *root_sep, bool recursive) const { @@ -32887,3 +32887,4 @@ inline flecs::scoped_world world::scope(const char* name) const { #endif +