Struct ecs_filter_t


#include <include/flecs.h>

struct ecs_filter_t


Filters alllow for ad-hoc quick filtering of entity tables.

A filter allows for uncached, ad hoc iteration over ECS data

Mentioned in


Lines 269-284 in include/flecs.h.

struct ecs_filter_t {
    ecs_term_t *terms;         /* Array containing terms for filter */
    int32_t term_count;        /* Number of elements in terms array */
    int32_t term_count_actual; /* Processed count, which folds OR terms */

    ecs_term_t term_cache[ECS_TERM_CACHE_SIZE]; /* Cache for small filters */
    bool term_cache_used;

    bool match_this;           /* Has terms that match EcsThis */
    bool match_only_this;      /* Has only terms that match EcsThis */
    bool match_prefab;         /* Does filter match prefabs */
    bool match_disabled;       /* Does filter match disabled entities */

    char *name;                /* Name of filter (optional) */
    char *expr;                /* Expression of filter (if provided) */