From adfc47898761d229e006fdee341b9b89aae22cb3 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 89a2624c5..bd0a7f632 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) @@ -634,14 +634,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" @@ -662,7 +662,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. */ @@ -693,8 +693,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. */ @@ -1368,7 +1368,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( @@ -1440,7 +1440,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). */ @@ -1558,24 +1558,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 @@ -1627,7 +1627,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); @@ -1639,7 +1639,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); @@ -1950,7 +1950,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 @@ -1977,17 +1977,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 @@ -2543,7 +2543,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; @@ -2551,10 +2551,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(); @@ -2565,25 +2565,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 @@ -2592,13 +2592,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 */ @@ -2767,7 +2767,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 */ @@ -2775,67 +2775,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. */ @@ -2843,15 +2843,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 */ @@ -2873,18 +2873,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 = {}; @@ -2892,7 +2892,7 @@ void ecs_sleepf( * // code * double elapsed = ecs_time_measure(&t); * @endcode - * + * * @param start The starting timestamp. * @return The time elapsed since start. */ @@ -2900,8 +2900,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. @@ -2911,8 +2911,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. */ @@ -2920,8 +2920,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. @@ -3067,8 +3067,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; @@ -3146,7 +3146,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. */ @@ -3402,7 +3402,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 @@ -3437,7 +3437,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 { @@ -3464,7 +3464,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 */ @@ -3482,7 +3482,7 @@ struct ecs_query_t { */ struct ecs_observer_t { ecs_header_t hdr; /**< Object header */ - + ecs_query_t *query; /**< Observer query */ /** Observer events */ @@ -3576,7 +3576,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. */ @@ -3624,7 +3624,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 */ @@ -3632,8 +3632,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; @@ -3701,7 +3701,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) @@ -3742,9 +3742,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 @@ -3777,8 +3777,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 */ @@ -3890,12 +3890,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 { @@ -3950,12 +3950,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))) @@ -4221,28 +4221,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)) { @@ -4352,7 +4352,7 @@ struct ecs_iter_t { /** Used with ecs_query_init(). - * + * * \ingroup queries */ typedef struct ecs_query_desc_t { @@ -4653,10 +4653,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. */ @@ -4799,7 +4799,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: @@ -4813,19 +4813,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; @@ -4908,7 +4908,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; @@ -5144,7 +5144,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); @@ -5152,17 +5152,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. */ @@ -5303,7 +5303,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 @@ -5312,7 +5312,7 @@ void ecs_set_target_fps( * - `EcsQueryMatchEmptyTables` * - `EcsQueryMatchDisabled` * - `EcsQueryMatchPrefab` - * + * * @param world The world. * @param flags The query flags. */ @@ -5331,35 +5331,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); @@ -5369,26 +5369,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 @@ -5657,7 +5657,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 @@ -6078,44 +6078,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 @@ -6248,7 +6248,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. * @@ -6268,7 +6268,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. @@ -6364,9 +6364,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. @@ -6500,17 +6500,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. @@ -6524,13 +6524,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. @@ -6747,7 +6747,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. * @@ -7588,7 +7588,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); @@ -7657,13 +7657,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); /** @} */ @@ -7673,11 +7673,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); @@ -7687,10 +7687,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)) { @@ -7700,7 +7700,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. @@ -7711,7 +7711,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. */ @@ -7724,7 +7724,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. @@ -7737,7 +7737,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. */ @@ -7755,7 +7755,7 @@ bool ecs_children_next( */ /** Create a query. - * + * * @param world The world. * @param desc The descriptor (see ecs_query_desc_t) * @return The query. @@ -7784,7 +7784,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. @@ -7811,42 +7811,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)) { @@ -7854,21 +7854,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 ++) { * // ... * } @@ -7901,7 +7901,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; @@ -7909,7 +7909,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. @@ -7925,7 +7925,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; @@ -7933,7 +7933,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. @@ -7949,9 +7949,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 = { @@ -7959,13 +7959,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. @@ -7977,10 +7977,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. */ @@ -8008,7 +8008,7 @@ char* ecs_query_plan( * @code * it.flags |= EcsIterProfile * @endcode - * + * * The returned string must be freed with ecs_os_free(). * * @param query The query. @@ -8029,7 +8029,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. @@ -8159,8 +8159,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. */ @@ -8216,10 +8216,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. */ @@ -8351,13 +8351,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 @@ -8486,10 +8486,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. */ @@ -8592,18 +8592,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); @@ -8627,10 +8627,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); @@ -8641,7 +8641,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. @@ -8904,9 +8904,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. */ @@ -8916,7 +8916,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. */ @@ -11493,7 +11493,7 @@ void ecs_rest_server_fini( * @code * ECS_IMPORT(world, FlecsRest) * @endcode - * + * * @param world The world. */ FLECS_API @@ -11770,7 +11770,7 @@ void ecs_set_tick_source( * @code * ECS_IMPORT(world, FlecsTimer) * @endcode - * + * * @param world The world. */ FLECS_API @@ -11839,7 +11839,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); @@ -11859,19 +11859,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, ...)\ @@ -11884,25 +11884,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. @@ -11911,7 +11911,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. @@ -12019,9 +12019,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( @@ -12039,18 +12039,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. */ @@ -12067,7 +12067,7 @@ bool ecs_using_task_threads( * @code * ECS_IMPORT(world, FlecsPipeline) * @endcode - * + * * @param world The world. */ FLECS_API @@ -12147,7 +12147,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 @@ -12171,7 +12171,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; @@ -12253,7 +12253,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. @@ -12396,7 +12396,7 @@ ecs_entity_t ecs_run_worker( * @code * ECS_IMPORT(world, FlecsSystem) * @endcode - * + * * @param world The world. */ FLECS_API @@ -12428,7 +12428,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. */ @@ -12596,7 +12596,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()) */ @@ -12695,7 +12695,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); @@ -12894,7 +12894,7 @@ typedef struct { * @code * ECS_IMPORT(world, FlecsStats) * @endcode - * + * * @param world The world. */ FLECS_API @@ -13087,7 +13087,7 @@ ecs_entity_t ecs_metric_init( * @code * ECS_IMPORT(world, FlecsMetrics) * @endcode - * + * * @param world The world. */ FLECS_API @@ -13171,7 +13171,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 @@ -13317,7 +13317,7 @@ ecs_entity_t ecs_get_alert( * @code * ECS_IMPORT(world, FlecsAlerts) * @endcode - * + * * @param world The world. */ FLECS_API @@ -14077,7 +14077,7 @@ FLECS_API extern ecs_entity_t EcsDeciBel; /**< DeciBel unit. */ * @code * ECS_IMPORT(world, FlecsUnits) * @endcode - * + * * @param world The world. */ FLECS_API @@ -14164,7 +14164,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 { @@ -14178,7 +14178,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. @@ -14192,7 +14192,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. */ @@ -14202,7 +14202,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. @@ -14216,13 +14216,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. @@ -14251,7 +14251,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. @@ -14264,7 +14264,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. */ @@ -14330,19 +14330,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 @@ -14360,10 +14360,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. * @@ -14389,11 +14389,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. @@ -14406,13 +14406,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. @@ -14428,10 +14428,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. @@ -14605,7 +14605,7 @@ int ecs_ptr_to_str_buf( * @code * ECS_IMPORT(world, FlecsScript) * @endcode - * + * * @param world The world. */ FLECS_API @@ -14661,22 +14661,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; @@ -14870,7 +14870,7 @@ const char* ecs_doc_get_color( * @code * ECS_IMPORT(world, FlecsDoc) * @endcode - * + * * @param world The world. */ FLECS_API @@ -15270,7 +15270,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. */ @@ -15387,8 +15387,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. */ @@ -15450,7 +15450,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) @@ -15489,12 +15489,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. @@ -15507,7 +15507,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. */ @@ -15516,7 +15516,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. */ @@ -15525,7 +15525,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. */ @@ -15535,7 +15535,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. @@ -15547,7 +15547,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. @@ -15558,7 +15558,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. */ @@ -15567,7 +15567,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. */ @@ -15576,7 +15576,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. */ @@ -15585,7 +15585,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. */ @@ -15594,7 +15594,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. */ @@ -15603,7 +15603,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. */ @@ -15612,7 +15612,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. */ @@ -15625,7 +15625,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. @@ -15636,7 +15636,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. @@ -15647,7 +15647,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. @@ -15658,7 +15658,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. @@ -15669,7 +15669,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. @@ -15680,7 +15680,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. @@ -15691,7 +15691,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. @@ -15702,7 +15702,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. @@ -15713,7 +15713,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. @@ -15724,7 +15724,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. */ @@ -15733,7 +15733,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. @@ -15746,7 +15746,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. */ @@ -15755,7 +15755,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. */ @@ -15764,7 +15764,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. */ @@ -15773,7 +15773,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. */ @@ -15782,7 +15782,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. */ @@ -15793,7 +15793,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. */ @@ -15802,8 +15802,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. */ @@ -15812,16 +15812,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. @@ -15839,8 +15839,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. @@ -15857,8 +15857,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. @@ -15875,8 +15875,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. @@ -15894,8 +15894,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. @@ -15912,8 +15912,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. @@ -15930,8 +15930,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. @@ -15965,7 +15965,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. @@ -16005,8 +16005,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. @@ -16029,8 +16029,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. @@ -16041,8 +16041,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. @@ -16100,7 +16100,7 @@ ecs_entity_t ecs_quantity_init( * @code * ECS_IMPORT(world, FlecsMeta) * @endcode - * + * * @param world The world. */ FLECS_API @@ -16498,7 +16498,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); @@ -16568,7 +16568,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 @@ -16577,7 +16577,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 @@ -16985,7 +16985,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. */ @@ -17021,7 +17021,7 @@ struct array_iterator int index_; }; -template +template struct array final { }; template @@ -17104,16 +17104,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) { } @@ -17171,7 +17171,7 @@ struct string { bool operator!=(const flecs::string& str) const { return !(*this == str); - } + } bool operator==(const char *str) const { if (const_str_ == str) { @@ -17187,7 +17187,7 @@ struct string { bool operator!=(const char *str) const { return !(*this == str); - } + } const char* c_str() const { return const_str_; @@ -17751,7 +17751,7 @@ enum_data enum_type(flecs::world_t *world) { namespace flecs { struct stringstream { - explicit stringstream() + explicit stringstream() : buf_({}) { } ~stringstream() { @@ -17773,7 +17773,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); @@ -17834,16 +17834,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 {}; @@ -17851,7 +17851,7 @@ struct function_traits_impl template struct function_traits_impl : function_traits_defs {}; - + template struct function_traits_impl : function_traits_defs {}; @@ -17863,7 +17863,7 @@ struct function_traits_impl template struct function_traits_impl : function_traits_defs {}; - + template struct function_traits_impl : function_traits_defs {}; @@ -17879,7 +17879,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 @@ -18192,8 +18192,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. @@ -18201,11 +18201,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. @@ -18215,7 +18215,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. @@ -19471,8 +19471,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; } @@ -20091,10 +20091,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) { @@ -20143,7 +20143,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 ++) { @@ -20153,10 +20153,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); @@ -20167,10 +20167,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); @@ -20181,10 +20181,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); @@ -20195,10 +20195,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); @@ -20210,10 +20210,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); @@ -20227,10 +20227,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); @@ -20247,10 +20247,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); @@ -20270,7 +20270,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; }; @@ -20284,7 +20284,7 @@ ecs_xtor_t ctor() { } // Not constructible by flecs -template ::value > = 0> ecs_xtor_t ctor() { return ecs_ctor_illegal; @@ -20315,7 +20315,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; } @@ -20599,8 +20599,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. @@ -20608,14 +20608,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); } @@ -20663,7 +20663,7 @@ struct world { } } world_ = nullptr; - } + } } ~world() { @@ -20676,7 +20676,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. */ @@ -20759,7 +20759,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() @@ -20771,7 +20771,7 @@ struct world { } /** End readonly mode. - * + * * @see ecs_readonly_end() * @see flecs::world::is_readonly() * @see flecs::world::readonly_begin() @@ -20882,8 +20882,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); } @@ -21641,35 +21641,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; @@ -21680,7 +21680,7 @@ flecs::id pair(entity_t r, entity_t o) const; */ /** Find or register component. - * + * * @ingroup cpp_components * @memberof flecs::world */ @@ -21689,7 +21689,7 @@ flecs::component component(Args &&... args) const; /** Find or register untyped component. * Method available on flecs::world class. - * + * * @ingroup cpp_components * @memberof flecs::world */ @@ -21702,7 +21702,7 @@ flecs::untyped_component component(Args &&... args) const; */ /** Create an entity. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21710,7 +21710,7 @@ template flecs::entity entity(Args &&... args) const; /** Convert enum constant to entity. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21718,7 +21718,7 @@ template ::value > = 0> flecs::id id(E value) const; /** Convert enum constant to entity. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21726,7 +21726,7 @@ template ::value > = 0> flecs::entity entity(E value) const; /** Create a prefab. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21734,7 +21734,7 @@ template flecs::entity prefab(Args &&... args) const; /** Create an entity that's associated with a type. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21742,7 +21742,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 */ @@ -21796,7 +21796,7 @@ flecs::event_builder_typed event() const; */ /** Create a term. - * + * */ template flecs::term term(Args &&... args) const; @@ -21804,7 +21804,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. */ @@ -21819,7 +21819,7 @@ flecs::term term() const; */ /** Observer builder. - * + * * @memberof flecs::world * @ingroup cpp_observers * @@ -21828,14 +21828,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. @@ -21858,20 +21858,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 @@ -21889,7 +21889,7 @@ flecs::query_builder query_builder(Args &&... args) const; * @code * void(*)(flecs::entity, T&, U&, ...) * @endcode - * + * */ template void each(Func&& func) const; @@ -21906,7 +21906,7 @@ void each(Func&& func) const; * @code * void(*)(flecs::entity, T&) * @endcode - * + * */ template void each(Func&& func) const; @@ -21923,7 +21923,7 @@ void each(flecs::id_t term_id, Func&& func) const; */ /** Convert enum constant to entity. - * + * * @memberof flecs::world * @ingroup cpp_entities */ @@ -21937,17 +21937,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. */ @@ -21955,7 +21955,7 @@ template flecs::entity module(const char *name = nullptr) const; /** Import a module. - * + * * @tparam Module module class. * @return Module entity. */ @@ -22069,7 +22069,7 @@ bool using_task_threads() const; * @brief System module world mixin. */ -/** +/** * @memberof flecs::world * @ingroup cpp_addons_systems * @@ -22078,14 +22078,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. @@ -22182,7 +22182,7 @@ flecs::string to_expr(const T* value) { /** * @memberof flecs::world * @ingroup cpp_addons_meta - * + * * @{ */ @@ -22225,7 +22225,7 @@ flecs::entity vector(); */ /** Serialize untyped value to JSON. - * + * * @memberof flecs::world * @ingroup cpp_addons_json */ @@ -22235,7 +22235,7 @@ flecs::string to_json(flecs::entity_t tid, const void* value) { } /** Serialize value to JSON. - * + * * @memberof flecs::world * @ingroup cpp_addons_json */ @@ -22246,7 +22246,7 @@ flecs::string to_json(const T* value) { } /** Serialize world to JSON. - * + * * @memberof flecs::world * @ingroup cpp_addons_json */ @@ -22255,7 +22255,7 @@ flecs::string to_json() { } /** Deserialize value from JSON. - * + * * @memberof flecs::world * @ingroup cpp_addons_json */ @@ -22264,7 +22264,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 */ @@ -22275,7 +22275,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 */ @@ -22284,7 +22284,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 */ @@ -22307,9 +22307,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() { @@ -22324,7 +22324,7 @@ flecs::app_builder app() { # ifdef FLECS_METRICS /** Create metric. - * + * * @ingroup cpp_addons_metrics * @memberof flecs::world */ @@ -22335,7 +22335,7 @@ flecs::metric_builder metric(Args &&... args) const; # ifdef FLECS_ALERTS /** Create alert. - * + * * @ingroup cpp_addons_alerts * @memberof flecs::world */ @@ -22871,10 +22871,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() { @@ -22954,7 +22954,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); } @@ -22977,10 +22977,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. @@ -22998,7 +22998,7 @@ namespace flecs /** Entity view. * Class with read operations for entities. Base for flecs::entity. - * + * * @ingroup cpp_entities */ struct entity_view : public id { @@ -23011,13 +23011,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. @@ -23034,7 +23034,7 @@ struct entity_view : public id { bool is_valid() const { return world_ && ecs_is_valid(world_, id_); } - + explicit operator bool() const { return is_valid(); } @@ -23069,7 +23069,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. * @@ -23159,10 +23159,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); } @@ -23174,7 +23174,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 { @@ -23202,7 +23202,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 { @@ -23215,10 +23215,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 { @@ -23226,7 +23226,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. @@ -23242,12 +23242,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_); @@ -23262,14 +23262,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. @@ -23284,7 +23284,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. @@ -23297,7 +23297,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. @@ -23308,7 +23308,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. @@ -23325,25 +23325,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; * }); @@ -23356,7 +23356,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. */ @@ -23392,7 +23392,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. @@ -23408,12 +23408,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_); @@ -23428,14 +23428,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. @@ -23443,14 +23443,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. @@ -23463,7 +23463,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. @@ -23474,7 +23474,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. @@ -23494,7 +23494,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))); @@ -23538,15 +23538,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. @@ -23580,11 +23580,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". @@ -23602,7 +23602,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. * @@ -23627,7 +23627,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> @@ -23807,11 +23807,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. * @@ -23820,7 +23820,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. @@ -23839,7 +23839,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. @@ -23854,7 +23854,7 @@ struct entity_view : public id { */ /** Serialize entity to JSON. - * + * * @memberof flecs::entity_view * @ingroup cpp_addons_json */ @@ -23943,7 +23943,7 @@ const char* doc_color() const { */ /** Return number of alerts for entity. - * + * * @memberof flecs::entity_view * @ingroup cpp_addons_alerts */ @@ -23959,7 +23959,7 @@ int32_t alert_count(flecs::entity_t alert = 0) const { */ /** Convert entity to enum constant. - * + * * @memberof flecs::entity_view * @ingroup cpp_entities */ @@ -23973,9 +23973,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 { @@ -23986,17 +23986,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> @@ -24005,9 +24005,9 @@ void emit() const { } /** Emit event with payload for entity. - * + * * @memberof flecs::entity_view - * + * * @tparam Evt The event to emit. */ template ::value> = 0> @@ -24021,9 +24021,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 { @@ -24034,17 +24034,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> @@ -24053,9 +24053,9 @@ void enqueue() const { } /** Enqueue event with payload for entity. - * + * * @memberof flecs::entity_view - * + * * @tparam Evt The event to enqueue. */ template ::value> = 0> @@ -24086,7 +24086,7 @@ void enqueue(const Evt& payload) const { namespace flecs { -/** Entity builder. +/** Entity builder. * @ingroup cpp_entities */ template @@ -24096,7 +24096,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 @@ -24110,10 +24110,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> @@ -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 component The component to add. */ @@ -24213,7 +24213,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. */ @@ -24228,7 +24228,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. @@ -24250,7 +24250,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. @@ -24262,7 +24262,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. @@ -24274,7 +24274,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. */ @@ -24339,7 +24339,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: @@ -24354,7 +24354,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. @@ -24385,7 +24385,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> @@ -24458,7 +24458,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) @@ -24570,8 +24570,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); @@ -24584,8 +24584,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)); @@ -24601,10 +24601,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. @@ -24614,18 +24614,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. @@ -24638,7 +24638,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 { @@ -24649,7 +24649,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). * @@ -24657,7 +24657,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. @@ -24784,7 +24784,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)); @@ -24806,7 +24806,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)); @@ -24821,7 +24821,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); @@ -24839,7 +24839,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(); } @@ -24855,7 +24855,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(); } @@ -24886,7 +24886,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(); } @@ -24902,7 +24902,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(); } @@ -24911,7 +24911,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 @@ -24942,7 +24942,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. * @@ -24954,15 +24954,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)...); @@ -24971,7 +24971,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(); @@ -24979,7 +24979,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(); @@ -25018,7 +25018,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); @@ -25145,13 +25145,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, @@ -25172,7 +25172,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, @@ -25192,7 +25192,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 @@ -25236,13 +25236,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); @@ -25260,57 +25260,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( @@ -25319,14 +25319,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( @@ -25342,9 +25342,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. @@ -25353,9 +25353,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. @@ -25364,7 +25364,7 @@ template const Self& observe(Func&& callback) const; /** Observe event on entity - * + * * @memberof flecs::entity_builder * * @param callback The observer callback. @@ -25706,7 +25706,7 @@ struct entity : entity_builder # ifdef FLECS_JSON /** Deserialize entity to JSON. - * + * * @memberof flecs::entity * @ingroup cpp_addons_json */ @@ -26987,7 +26987,7 @@ struct untyped_component : entity { /** * @memberof flecs::component * @ingroup cpp_addons_meta - * + * * @{ */ @@ -26995,12 +26995,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; @@ -27021,44 +27021,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); } @@ -27067,7 +27067,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); @@ -27077,8 +27077,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); @@ -27088,8 +27088,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); @@ -27099,9 +27099,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); @@ -27111,7 +27111,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_); @@ -27121,9 +27121,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_); @@ -27131,11 +27131,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)); @@ -27143,12 +27143,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)); @@ -27156,11 +27156,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_); @@ -27171,7 +27171,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_)); @@ -27181,7 +27181,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); @@ -27190,8 +27190,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_)); @@ -27201,7 +27201,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); @@ -27211,7 +27211,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_; @@ -27224,7 +27224,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) { @@ -27246,7 +27246,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) { @@ -27268,7 +27268,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) { @@ -27299,7 +27299,7 @@ untyped_component& error_range( /** * @memberof flecs::component * @ingroup cpp_addons_metrics - * + * * @{ */ @@ -27307,11 +27307,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). @@ -27319,8 +27319,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); /** @} */ @@ -28101,7 +28101,7 @@ template struct page_iterable; template -struct worker_iterable; +struct worker_iterable; template struct iterable { @@ -28167,7 +28167,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. @@ -28177,7 +28177,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. @@ -28243,7 +28243,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(); @@ -28297,7 +28297,7 @@ struct iter_iterable final : iterable { */ /** Serialize iterator result to JSON. - * + * * @memberof flecs::iter * @ingroup cpp_addons_json */ @@ -28390,7 +28390,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) { @@ -28414,15 +28414,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) { @@ -28446,8 +28446,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); } @@ -28537,26 +28537,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( @@ -28596,7 +28596,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 { @@ -28606,25 +28606,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)); } @@ -28643,26 +28643,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_)); @@ -28675,7 +28675,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(); @@ -28694,7 +28694,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); } } @@ -28720,7 +28720,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]); @@ -28740,7 +28740,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"); @@ -28778,7 +28778,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) ); } @@ -28855,7 +28855,7 @@ namespace _ { return flecs::InOut; } - template ::value || is_reference::value > = 0> constexpr flecs::inout_kind_t type_to_inout() { return flecs::InOutDefault; @@ -28873,11 +28873,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_; @@ -28893,9 +28893,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 @@ -28917,14 +28917,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 @@ -28948,10 +28948,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*). */ @@ -28990,7 +28990,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)"); } @@ -29000,16 +29000,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); } @@ -29033,7 +29033,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(); @@ -29196,10 +29196,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. */ @@ -29212,8 +29212,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); @@ -29298,9 +29298,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; @@ -29338,13 +29338,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); - } + } }; } @@ -29353,7 +29353,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 { @@ -29362,7 +29362,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) { } @@ -29395,10 +29395,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 { @@ -29406,10 +29406,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); } @@ -29496,7 +29496,7 @@ inline flecs::term world::term() const { /** * @file addons/cpp/utils/builder.hpp * @brief Builder base class. - * + * * Generic functionality for builder classes. */ @@ -29520,7 +29520,7 @@ struct builder : IBuilder , desc_{} , world_(world) { } - builder(const builder& f) + builder(const builder& f) : IBase(&desc_, f.term_index_) { world_ = f.world_; @@ -29558,16 +29558,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) { } @@ -29770,18 +29770,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; } @@ -29792,18 +29792,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. * @@ -29814,7 +29814,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); @@ -29826,7 +29826,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; @@ -29836,12 +29836,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 @@ -29932,12 +29932,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 @@ -30386,7 +30386,7 @@ struct node_builder : IBuilder namespace flecs { /** Observer builder interface. - * + * * @ingroup cpp_observers */ template @@ -30397,7 +30397,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) { } @@ -30462,12 +30462,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 @@ -30482,7 +30482,7 @@ struct observer_builder final : _::observer_builder_base { } -namespace flecs +namespace flecs { struct observer final : entity @@ -30532,7 +30532,7 @@ inline observer_builder world::observer(Args &&... args) const { #pragma once -namespace flecs +namespace flecs { // Mixin implementation @@ -30553,7 +30553,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; @@ -30577,7 +30577,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)); } @@ -30589,7 +30589,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)); } }; @@ -30795,11 +30795,11 @@ inline flecs::entity world::import() { #pragma once -namespace flecs +namespace flecs { /** System builder interface. - * + * * @ingroup cpp_addons_systems */ template @@ -30808,7 +30808,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) { } @@ -30878,7 +30878,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. * @@ -30892,7 +30892,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. * @@ -30954,12 +30954,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 @@ -30979,16 +30979,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) @@ -31016,7 +31016,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_); } @@ -31067,10 +31067,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); @@ -31187,12 +31187,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) { } @@ -31207,12 +31207,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 @@ -31232,7 +31232,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); @@ -31578,7 +31578,7 @@ namespace _ { inline void init(flecs::world& world) { world.component("flecs::rest::Rest"); } - + } // namespace _ } // namespace rest } // namespace flecs @@ -31849,7 +31849,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"); @@ -32054,7 +32054,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; } @@ -32092,9 +32092,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_); @@ -32156,7 +32156,7 @@ inline untyped_component& untyped_component::metric( namespace flecs { /** Alert builder interface. - * + * * @ingroup cpp_addons_alerts */ template @@ -32169,21 +32169,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) { @@ -32192,7 +32192,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) { @@ -32200,8 +32200,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) { @@ -32209,8 +32209,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) { @@ -32218,8 +32218,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 @@ -32229,10 +32229,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; @@ -32250,7 +32250,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); } @@ -32259,7 +32259,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); } @@ -32312,12 +32312,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 @@ -32389,7 +32389,7 @@ inline flecs::alert_builder world::alert(Args &&... args) const { #pragma once -namespace flecs +namespace flecs { inline flecs::entity script_builder::run() const { @@ -32418,8 +32418,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", @@ -32437,8 +32437,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_; } @@ -32450,10 +32450,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()); @@ -32489,7 +32489,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]); } @@ -32523,7 +32523,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); } @@ -32573,7 +32573,7 @@ inline flecs::entity iter::get_var(const char *name) const { #pragma once -namespace flecs +namespace flecs { inline void world::init_builtin_components() { @@ -32638,7 +32638,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 { @@ -32922,3 +32922,4 @@ inline flecs::scoped_world world::scope(const char* name) const { #endif +