19 table() : m_world(
nullptr), m_table(
nullptr) { }
47 int32_t
search(flecs::id_t
id)
const {
66 int32_t
search(flecs::entity_t first, flecs::entity_t second)
const {
67 return search(ecs_pair(first, second));
75 template <
typename First>
76 int32_t
search(flecs::entity_t second)
const {
85 template <
typename First,
typename Second>
95 bool has(flecs::id_t
id)
const {
104 template <
typename T>
106 return search<T>() != -1;
115 bool has(flecs::entity_t first, flecs::entity_t second)
const {
116 return search(first, second) != -1;
125 template <
typename First>
126 bool has(flecs::entity_t second)
const {
127 return search<First>(second) != -1;
136 template <
typename First,
typename Second>
138 return search<First, Second>() != -1;
155 void*
get(flecs::id_t
id)
const {
156 int32_t index =
search(
id);
169 void*
get(flecs::entity_t first, flecs::entity_t second)
const {
170 return get(ecs_pair(first, second));
178 template <typename T, if_t< is_actual<T>::value > = 0>
188 template <
typename T,
typename A = actual_type_t<T>,
189 if_t< flecs::is_pair<T>::value > = 0>
200 template <
typename First>
201 First*
get(flecs::entity_t second)
const {
211 template <
typename First,
typename Second,
typename P = flecs::pair<First, Second>,
212 typename A = actual_type_t<P>, if_not_t< flecs::is_pair<First>::value> = 0>
227 int32_t
depth(flecs::entity_t rel) {
236 template <
typename Rel>
242 operator table_t*()
const {
262 int32_t offset()
const {
266 int32_t count()
const {
280 int32_t m_offset = 0;
char * ecs_table_str(const ecs_world_t *world, const ecs_table_t *table)
Convert table to string.
int32_t ecs_search(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id, ecs_id_t *id_out)
Search for component id in table type.
const ecs_type_t * ecs_table_get_type(const ecs_table_t *table)
Get type for table.
void * ecs_table_get_column(const ecs_table_t *table, int32_t index, int32_t offset)
Get column from table.
int32_t ecs_table_count(const ecs_table_t *table)
Returns the number of records in the 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.
size_t ecs_table_get_column_size(const ecs_table_t *table, int32_t index)
Get column size from table.
void * get_by_index(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 search(flecs::entity_t second) const
Find index for pair.
int32_t search() const
Find index for pair.
First * get(flecs::entity_t second) const
Get pointer to component array by pair.
flecs::string str() const
Convert table type to string.
int32_t search() const
Find index for type.
bool has(flecs::id_t id) const
Test if table has (component) id.
size_t column_size(int32_t column_index)
Get column size.
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.
int32_t depth()
Get depth for given relationship.
int32_t search(flecs::entity_t first, flecs::entity_t second) const
Find index for pair.
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.
bool has() const
Test if table has the type.
bool has() const
Test if table has the pair.
int32_t depth(flecs::entity_t rel)
Get depth for given relationship.
int32_t search(flecs::id_t id) const
Find index for (component) id.
flecs::type type() const
Get table type.
virtual void * get_by_index(int32_t index) const
Get pointer to component array by column index.
A * get() const
Get pointer to component array by component.