19 table() : world_(
nullptr), table_(
nullptr) { }
81 int32_t
type_index(flecs::entity_t first, flecs::entity_t second)
const {
90 template <
typename First>
100 template <
typename First,
typename Second>
119 template <
typename T>
129 int32_t
column_index(flecs::entity_t first, flecs::entity_t second)
const {
138 template <
typename First>
148 template <
typename First,
typename Second>
158 bool has(flecs::id_t
id)
const {
167 template <
typename T>
169 return type_index<T>() != -1;
178 bool has(flecs::entity_t first, flecs::entity_t second)
const {
188 template <
typename First>
189 bool has(flecs::entity_t second)
const {
190 return type_index<First>(second) != -1;
199 template <
typename First,
typename Second>
201 return type_index<First, Second>() != -1;
235 void*
try_get(flecs::entity_t first, flecs::entity_t second)
const {
236 return try_get(ecs_pair(first, second));
244 template <typename T, if_t< is_actual<T>::value > = 0>
254 template <
typename T,
typename A = actual_type_t<T>,
255 if_t< flecs::is_pair<T>::value > = 0>
266 template <
typename First>
267 First*
try_get(flecs::entity_t second)
const {
279 void*
get(flecs::id_t
id)
const {
285 ecs_assert(r !=
nullptr, ECS_INVALID_OPERATION,
286 "invalid get_mut: table does not have component (use try_get)");
296 void*
get(flecs::entity_t first, flecs::entity_t second)
const {
297 return get(ecs_pair(first, second));
305 template <typename T, if_t< is_actual<T>::value > = 0>
315 template <
typename T,
typename A = actual_type_t<T>,
316 if_t< flecs::is_pair<T>::value > = 0>
327 template <
typename First>
328 First*
get(flecs::entity_t second)
const {
339 template <
typename First,
typename Second,
typename P = flecs::pair<First, Second>,
340 typename A = actual_type_t<P>, if_not_t< flecs::is_pair<First>::value> = 0>
355 int32_t
depth(flecs::entity_t rel)
const {
364 template <
typename Rel>
371 return flecs_table_records(table_);
375 uint64_t
id()
const {
376 return flecs_table_id(table_);
403 operator table_t*()
const {
423 int32_t offset()
const {
427 int32_t count()
const {
#define ecs_assert(condition, error_code,...)
Assert.
char * ecs_table_str(const ecs_world_t *world, const ecs_table_t *table)
Convert table to string.
const ecs_type_t * ecs_table_get_type(const ecs_table_t *table)
Get type for table.
int32_t ecs_table_size(const ecs_table_t *table)
Returns allocated size of table.
bool ecs_table_has_flags(ecs_table_t *table, ecs_flags32_t flags)
Test table for flags.
void * ecs_table_get_column(const ecs_table_t *table, int32_t index, int32_t offset)
Get column from table by column index.
int32_t ecs_table_count(const ecs_table_t *table)
Returns the number of entities in the table.
const ecs_entity_t * ecs_table_entities(const ecs_table_t *table)
Returns array with entity ids for 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 depth for table in tree for relationship rel.
int32_t ecs_table_get_column_index(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id)
Get column index for id.
void ecs_table_lock(ecs_world_t *world, ecs_table_t *table)
Lock a table.
int32_t ecs_table_get_type_index(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id)
Get type index for id.
size_t ecs_table_get_column_size(const ecs_table_t *table, int32_t index)
Get column size from table.
void ecs_table_clear_entities(ecs_world_t *world, ecs_table_t *table)
Remove all entities in a table.
void * get_column(int32_t index) const override
Get pointer to component array by column index.
T * get() const
Get pointer to component array by component.
int32_t type_index(flecs::entity_t first, flecs::entity_t second) const
Find type index for pair.
int32_t depth() const
Get depth for given relationship.
First * get(flecs::entity_t second) const
Get pointer to component array by pair.
A * try_get() const
Get pointer to component array by component.
uint64_t id() const
Get table id.
flecs::string str() const
Convert table type to string.
int32_t column_index(flecs::id_t id) const
Find column index for (component) id.
T * try_get() const
Get pointer to component array by component.
bool has(flecs::id_t id) const
Test if table has (component) id.
int32_t type_index() const
Find type index for pair.
int32_t depth(flecs::entity_t rel) const
Get depth for given relationship.
int32_t count() const
Get table count.
bool has(flecs::entity_t second) const
Test if table has the pair.
void * get(flecs::id_t id) const
Get pointer to component array by component.
First * try_get(flecs::entity_t second) const
Get pointer to component array by pair.
int32_t type_index() const
Find type index for type.
int32_t column_index() const
Find column index for pair.
bool has_flags(ecs_flags32_t flags) const
Check if table has flags.
const flecs::entity_t * entities() const
Get array with entity ids.
bool has(flecs::entity_t first, flecs::entity_t second) const
Test if table has the pair.
A * get() const
Get pointer to component array by pair.
void * get(flecs::entity_t first, flecs::entity_t second) const
Get pointer to component array by pair.
int32_t column_index(flecs::entity_t second) const
Find column index for pair.
bool has() const
Test if table has the type.
void lock() const
Lock table.
void * try_get(flecs::entity_t first, flecs::entity_t second) const
Get pointer to component array by pair.
bool has() const
Test if table has the pair.
table_t * get_table() const
Get table.
size_t column_size(int32_t index) const
Get column size.
int32_t type_index(flecs::id_t id) const
Find type index for (component) id.
int32_t column_index() const
Find column index for type.
void clear_entities() const
Delete entities in table.
flecs::type type() const
Get table type.
int32_t column_index(flecs::entity_t first, flecs::entity_t second) const
Find column index for pair.
int32_t size() const
Get number of allocated elements in table.
ecs_table_records_t records() const
Get table records array.
void unlock() const
Unlock table.
A * get() const
Get pointer to component array by component.
virtual void * get_column(int32_t index) const
Get pointer to component array by column index.
void * try_get(flecs::id_t id) const
Get pointer to component array by component.
int32_t type_index(flecs::entity_t second) const
Find type index for pair.