25 table() : world_(nullptr), table_(nullptr) { }
104 template <
typename First>
115 template <
typename First,
typename Second>
134 template <
typename T>
155 template <
typename First>
166 template <
typename First,
typename Second>
185 template <
typename T>
187 return type_index<T>() != -1;
206 template <
typename First>
208 return type_index<First>(second) != -1;
217 template <
typename First,
typename Second>
219 return type_index<First, Second>() != -1;
254 return try_get(ecs_pair(first, second));
262 template <typename T, if_t< is_actual<T>::value > = 0>
272 template <
typename T,
typename A = actual_type_t<T>,
273 if_t< flecs::is_pair<T>::value > = 0>
284 template <
typename First>
304 "invalid get: table does not have component (use try_get())");
315 return get(ecs_pair(first, second));
323 template <typename T, if_t< is_actual<T>::value > = 0>
333 template <
typename T,
typename A = actual_type_t<T>,
334 if_t< flecs::is_pair<T>::value > = 0>
345 template <
typename First>
357 template <
typename First,
typename Second,
typename P = flecs::pair<First, Second>,
358 typename A = actual_type_t<P>, if_not_t< flecs::is_pair<First>::value> = 0>
386 template <
typename Rel>
396 return flecs_table_records(table_);
403 uint64_t
id()
const {
404 return flecs_table_id(table_);
#define ecs_assert(condition, error_code,...)
Assert.
#define ECS_INVALID_OPERATION
Invalid operation error code.
ecs_table_t table_t
Table type.
ecs_entity_t entity_t
Entity type.
ecs_world_t world_t
World type.
char * ecs_table_str(const ecs_world_t *world, const ecs_table_t *table)
Convert a table to a string.
const ecs_type_t * ecs_table_get_type(const ecs_table_t *table)
Get the type for a table.
int32_t ecs_table_get_column_index(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t component)
Get the column index for a component.
int32_t ecs_table_size(const ecs_table_t *table)
Return the allocated size of the table.
bool ecs_table_has_flags(ecs_table_t *table, ecs_flags32_t flags)
Test a table for flags.
void * ecs_table_get_column(const ecs_table_t *table, int32_t index, int32_t offset)
Get a column from a table by column index.
int32_t ecs_table_count(const ecs_table_t *table)
Return the number of entities in the table.
const ecs_entity_t * ecs_table_entities(const ecs_table_t *table)
Return the array with entity IDs for the table.
void ecs_table_unlock(ecs_world_t *world, ecs_table_t *table)
Unlock a table.
int32_t ecs_table_get_depth(const ecs_world_t *world, const ecs_table_t *table, ecs_entity_t rel)
Return the depth for a table in the tree for the specified relationship.
void ecs_table_lock(ecs_world_t *world, ecs_table_t *table)
Lock a table.
size_t ecs_table_get_column_size(const ecs_table_t *table, int32_t index)
Get the column size from a table.
int32_t ecs_table_get_type_index(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t component)
Get the type index for a component.
void ecs_table_clear_entities(ecs_world_t *world, ecs_table_t *table)
Remove all entities in a table.
table_range(world_t *world, table_t *t, int32_t offset, int32_t count)
Construct a table range from a world, table, offset, and count.
void * get_column(int32_t index) const override
Get a pointer to the component array by column index.
int32_t count() const
Get the number of entities in the range.
int32_t offset() const
Get the offset of the range.
table_range()
Default constructor.
T * get() const
Get a pointer to the component array by component.
int32_t type_index(flecs::entity_t first, flecs::entity_t second) const
Find the type index for a pair.
int32_t depth() const
Get the depth for a given relationship.
First * get(flecs::entity_t second) const
Get a pointer to the component array by pair.
A * try_get() const
Get a pointer to the component array by component.
uint64_t id() const
Get the table ID.
flecs::string str() const
Convert the table type to a string.
int32_t column_index(flecs::id_t id) const
Find the column index for a (component) ID.
T * try_get() const
Get a pointer to the component array by component.
table(world_t *world, table_t *t)
Construct a table from a world and C table pointer.
bool has(flecs::id_t id) const
Test if the table has a (component) ID.
int32_t type_index() const
Find the type index for a pair.
int32_t depth(flecs::entity_t rel) const
Get the depth for a given relationship.
int32_t count() const
Get the table count.
virtual ~table()
Destructor.
bool has(flecs::entity_t second) const
Test if the table has the pair.
void * get(flecs::id_t id) const
Get a pointer to the component array by component.
First * try_get(flecs::entity_t second) const
Get a pointer to the component array by pair.
table()
Default constructor.
int32_t type_index() const
Find the type index for a type.
int32_t column_index() const
Find the column index for a pair.
bool has_flags(ecs_flags32_t flags) const
Check if the table has flags.
const flecs::entity_t * entities() const
Get the array of entity IDs.
bool has(flecs::entity_t first, flecs::entity_t second) const
Test if the table has the pair.
A * get() const
Get a pointer to the component array by pair.
void * get(flecs::entity_t first, flecs::entity_t second) const
Get a pointer to the component array by pair.
int32_t column_index(flecs::entity_t second) const
Find the column index for a pair.
bool has() const
Test if the table has the type.
void lock() const
Lock the table.
void * try_get(flecs::entity_t first, flecs::entity_t second) const
Get a pointer to the component array by pair.
bool has() const
Test if the table has the pair.
table_t * get_table() const
Get the table.
size_t column_size(int32_t index) const
Get the column size.
int32_t type_index(flecs::id_t id) const
Find the type index for a (component) ID.
int32_t column_index() const
Find the column index for a type.
void clear_entities() const
Delete entities in the table.
flecs::type type() const
Get the table type.
int32_t column_index(flecs::entity_t first, flecs::entity_t second) const
Find the column index for a pair.
int32_t size() const
Get the number of allocated elements in the table.
ecs_table_records_t records() const
Get the table records array.
void unlock() const
Unlock the table.
A * get() const
Get a pointer to the component array by component.
virtual void * get_column(int32_t index) const
Get a pointer to the component array by column index.
void * try_get(flecs::id_t id) const
Get a pointer to the component array by component.
int32_t type_index(flecs::entity_t second) const
Find the type index for a pair.