Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs::table_range Struct Reference

Table range. More...

#include <table.hpp>

Inheritance diagram for flecs::table_range:
[legend]

Public Member Functions

 table_range ()
 Default constructor.
 
 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.
 
int32_t offset () const
 Get the offset of the range.
 
int32_t count () const
 Get the number of entities in the range.
 
void * get_column (int32_t index) const override
 Get a pointer to the component array by column index.
 
- Public Member Functions inherited from flecs::table
 table ()
 Default constructor.
 
 table (world_t *world, table_t *t)
 Construct a table from a world and C table pointer.
 
virtual ~table ()
 Destructor.
 
flecs::string str () const
 Convert the table type to a string.
 
flecs::type type () const
 Get the table type.
 
int32_t count () const
 Get the table count.
 
int32_t size () const
 Get the number of allocated elements in the table.
 
const flecs::entity_tentities () const
 Get the array of entity IDs.
 
void clear_entities () const
 Delete entities in the table.
 
int32_t type_index (flecs::id_t id) const
 Find the type index for a (component) ID.
 
template<typename T >
int32_t type_index () const
 Find the type index for a type.
 
int32_t type_index (flecs::entity_t first, flecs::entity_t second) const
 Find the type index for a pair.
 
template<typename First >
int32_t type_index (flecs::entity_t second) const
 Find the type index for a pair.
 
template<typename First , typename Second >
int32_t type_index () const
 Find the type index for a pair.
 
int32_t column_index (flecs::id_t id) const
 Find the column index for a (component) ID.
 
template<typename T >
int32_t column_index () const
 Find the column index for a type.
 
int32_t column_index (flecs::entity_t first, flecs::entity_t second) const
 Find the column index for a pair.
 
template<typename First >
int32_t column_index (flecs::entity_t second) const
 Find the column index for a pair.
 
template<typename First , typename Second >
int32_t column_index () const
 Find the column index for a pair.
 
bool has (flecs::id_t id) const
 Test if the table has a (component) ID.
 
template<typename T >
bool has () const
 Test if the table has the type.
 
bool has (flecs::entity_t first, flecs::entity_t second) const
 Test if the table has the pair.
 
template<typename First >
bool has (flecs::entity_t second) const
 Test if the table has the pair.
 
template<typename First , typename Second >
bool has () const
 Test if the table has the pair.
 
void * try_get (flecs::id_t id) const
 Get a pointer to the component array by component.
 
void * try_get (flecs::entity_t first, flecs::entity_t second) const
 Get a pointer to the component array by pair.
 
template<typename T , if_t< is_actual< T >::value > = 0>
T * try_get () const
 Get a pointer to the component array by component.
 
template<typename T , typename A = actual_type_t<T>, if_t< flecs::is_pair< T >::value > = 0>
A * try_get () const
 Get a pointer to the component array by component.
 
template<typename First >
First * try_get (flecs::entity_t second) const
 Get a pointer to the component array by pair.
 
void * get (flecs::id_t id) const
 Get a pointer to the component array by component.
 
void * get (flecs::entity_t first, flecs::entity_t second) const
 Get a pointer to the component array by pair.
 
template<typename T , if_t< is_actual< T >::value > = 0>
T * get () const
 Get a pointer to the component array by component.
 
template<typename T , typename A = actual_type_t<T>, if_t< flecs::is_pair< T >::value > = 0>
A * get () const
 Get a pointer to the component array by component.
 
template<typename First >
First * get (flecs::entity_t second) const
 Get a pointer to the component array by pair.
 
template<typename First , typename Second , typename P = flecs::pair<First, Second>, typename A = actual_type_t<P>, if_not_t< flecs::is_pair< First >::value > = 0>
A * get () const
 Get a pointer to the component array by pair.
 
size_t column_size (int32_t index) const
 Get the column size.
 
int32_t depth (flecs::entity_t rel) const
 Get the depth for a given relationship.
 
template<typename Rel >
int32_t depth () const
 Get the depth for a given relationship.
 
ecs_table_records_t records () const
 Get the table records array.
 
uint64_t id () const
 Get the table ID.
 
void lock () const
 Lock the table.
 
void unlock () const
 Unlock the table.
 
bool has_flags (ecs_flags32_t flags) const
 Check if the table has flags.
 
table_tget_table () const
 Get the table.
 
 operator table_t * () const
 Implicit conversion to table_t*.
 

Additional Inherited Members

- Protected Attributes inherited from flecs::table
world_tworld_
 
table_ttable_
 

Detailed Description

Table range.

A table range represents a contiguous range of entities in a table.

Definition at line 449 of file table.hpp.

Constructor & Destructor Documentation

◆ table_range() [1/2]

flecs::table_range::table_range ( )
inline

Default constructor.

Definition at line 451 of file table.hpp.

◆ table_range() [2/2]

flecs::table_range::table_range ( world_t * world,
table_t * t,
int32_t offset,
int32_t count )
inline

Construct a table range from a world, table, offset, and count.

Parameters
worldThe world.
tPointer to the C table.
offsetThe starting row offset.
countThe number of rows in the range.

Definition at line 463 of file table.hpp.

Member Function Documentation

◆ count()

int32_t flecs::table_range::count ( ) const
inline

Get the number of entities in the range.

Definition at line 474 of file table.hpp.

◆ get_column()

void * flecs::table_range::get_column ( int32_t index) const
inlineoverridevirtual

Get a pointer to the component array by column index.

Parameters
indexThe column index.
Returns
Pointer to the column, NULL if not a component.

Reimplemented from flecs::table.

Definition at line 483 of file table.hpp.

◆ offset()

int32_t flecs::table_range::offset ( ) const
inline

Get the offset of the range.

Definition at line 469 of file table.hpp.


The documentation for this struct was generated from the following file: