Flecs v4.0
A fast entity component system (ECS) for C & C++
|
Public Member Functions | |
template<typename Func > | |
void | each (Func &&func) const |
Each iterator. | |
template<typename Func > | |
void | run (Func &&func) const |
Run iterator. | |
template<typename Func > | |
flecs::entity | find (Func &&func) const |
iter_iterable< Components... > | iter (flecs::world_t *world=nullptr) const |
Create iterator. | |
iter_iterable< Components... > | iter (flecs::iter &iter) const |
Create iterator. | |
iter_iterable< Components... > | iter (flecs::entity e) const |
Create iterator. | |
page_iterable< Components... > | page (int32_t offset, int32_t limit) |
Page iterator. | |
worker_iterable< Components... > | worker (int32_t index, int32_t count) |
Worker iterator. | |
int32_t | count () const |
Return number of entities matched by iterable. | |
bool | is_true () const |
Return whether iterable has any matches. | |
flecs::entity | first () const |
Return first entity matched by iterable. | |
iter_iterable< Components... > | set_var (int var_id, flecs::entity_t value) |
iter_iterable< Components... > | set_var (const char *name, flecs::entity_t value) |
iter_iterable< Components... > | set_var (const char *name, flecs::table_t *value) |
iter_iterable< Components... > | set_var (const char *name, ecs_table_range_t value) |
iter_iterable< Components... > | set_var (const char *name, flecs::table_range value) |
iter_iterable< Components... > | set_group (uint64_t group_id) |
template<typename Group > | |
iter_iterable< Components... > | set_group () |
Protected Member Functions | |
virtual ecs_iter_t | get_iter (flecs::world_t *stage) const =0 |
virtual ecs_iter_next_action_t | next_action () const =0 |
Protected Attributes | |
friend | iter_iterable< Components... > |
friend | page_iterable< Components... > |
friend | worker_iterable< Components... > |
Definition at line 18 of file iterable.hpp.
|
inlinevirtual |
Definition at line 144 of file iterable.hpp.
|
inline |
Return number of entities matched by iterable.
Definition at line 99 of file iterable.hpp.
|
inline |
Each iterator.
The "each" iterator accepts a function that is invoked for each matching entity. The following function signatures are valid:
Definition at line 28 of file iterable.hpp.
|
inline |
Definition at line 48 of file iterable.hpp.
|
inline |
Return first entity matched by iterable.
Definition at line 109 of file iterable.hpp.
|
inline |
Return whether iterable has any matches.
Definition at line 104 of file iterable.hpp.
iter_iterable< Components... > flecs::iterable< Components >::iter | ( | flecs::entity | e | ) | const |
Create iterator.
Create an iterator object that can be modified before iterating.
Definition at line 282 of file iterable.hpp.
iter_iterable< Components... > flecs::iterable< Components >::iter | ( | flecs::iter & | iter | ) | const |
Create iterator.
Create an iterator object that can be modified before iterating.
Definition at line 276 of file iterable.hpp.
iter_iterable< Components... > flecs::iterable< Components >::iter | ( | flecs::world_t * | world = nullptr | ) | const |
Create iterator.
Create an iterator object that can be modified before iterating.
Definition at line 270 of file iterable.hpp.
page_iterable< Components... > flecs::iterable< Components >::page | ( | int32_t | offset, |
int32_t | limit ) |
Page iterator.
Create an iterator that limits the returned entities with offset/limit.
offset | How many entities to skip. |
limit | The maximum number of entities to return. |
Definition at line 313 of file iterable.hpp.
|
inline |
Run iterator.
The "each" iterator accepts a function that is invoked once for a query with a valid iterator. The following signature is valid:
Definition at line 42 of file iterable.hpp.
|
inline |
Definition at line 140 of file iterable.hpp.
|
inline |
Definition at line 134 of file iterable.hpp.
|
inline |
Definition at line 125 of file iterable.hpp.
|
inline |
Definition at line 117 of file iterable.hpp.
|
inline |
Definition at line 129 of file iterable.hpp.
|
inline |
Definition at line 121 of file iterable.hpp.
|
inline |
Definition at line 113 of file iterable.hpp.
worker_iterable< Components... > flecs::iterable< Components >::worker | ( | int32_t | index, |
int32_t | count ) |
Worker iterator.
Create an iterator that divides the number of matched entities across a number of resources.
index | The index of the current resource. |
count | The total number of resources to divide entities between. |
Definition at line 345 of file iterable.hpp.
|
protected |
Definition at line 146 of file iterable.hpp.
|
protected |
Definition at line 147 of file iterable.hpp.
|
protected |
Definition at line 148 of file iterable.hpp.