Skip to content
Flecs v4.1
flecs::_ Namespace Reference

Int to enum. More...

Classes

struct  builder
struct  chained_iterable
struct  component_binding_ctx
struct  component_id
struct  delegate
struct  each_callback_args
 Extract the component argument list from an each-callback signature. More...
struct  each_callback_args< arg_list< First, Args... >, if_t< is_same< decay_t< First >, flecs::entity >::value >, Normalize >
struct  each_callback_args< arg_list< First, Second, Args... >, if_t< is_same< decay_t< First >, flecs::iter >::value >, Normalize >
struct  each_delegate
struct  each_field
struct  each_normalize_args
 Strip references from each-callback argument types. More...
struct  each_normalize_args< arg_list< Args... >, Normalize >
struct  entity_observer_delegate
struct  entity_with_delegate
struct  entity_with_delegate_impl
struct  entity_with_delegate_impl< arg_list< Args... > >
struct  enum_constant
 Enumeration constant data. More...
struct  event_from_func
struct  event_from_func< Func, if_t< arity< Func >::value==1 > >
struct  event_from_func< Func, if_t< arity< Func >::value==2 > >
struct  field_ptr
struct  field_ptrs
struct  find_delegate
struct  has_cpp_meta_desc
struct  has_cpp_meta_desc< T, decltype(void(flecs_meta_cpp_desc(static_cast< T * >(nullptr))))>
struct  has_operator_equal
struct  has_operator_equal< T, void_t< decltype(std::declval< const T & >()==std::declval< const T & >())> >
struct  has_operator_greater
struct  has_operator_greater< T, void_t< decltype(std::declval< const T & >() > std::declval< const T & >())> >
struct  has_operator_less
struct  has_operator_less< T, void_t< decltype(std::declval< const T & >()< std::declval< const T & >())> >
struct  is_get_sparse_component
 Test if get/get_mut for a component can use ecs_get_sparse_id(). More...
struct  is_sparse_component
 Test if a component is sparse at compile time. More...
struct  is_sparse_field
struct  is_sparse_query
struct  is_sparse_query_field
struct  pair_base
struct  range_iterator
 Iterate over an integer range (used to iterate over entity range). More...
struct  run_delegate
struct  type
struct  type< T, if_not_t< is_pair< T >::value > >
struct  type< T, if_t< is_pair< T >::value > >
struct  type_impl
struct  validate_delegate
struct  value_type

Typedefs

template<typename ... Components>
using alert_builder_base
template<typename Func>
using event_from_func_t = typename event_from_func<Func>::type
template<typename ... Components>
using observer_builder_base
template<typename ... Components>
using pipeline_builder_base
template<typename ... Components>
using query_builder_base
template<typename ... Components>
using system_builder_base
template<typename... T>
using value_type_t = typename value_type<T...>::type

Functions

template<typename T>
const char * component_symbol_name ()
template<>
const char * component_symbol_name< uint8_t > ()
template<>
const char * component_symbol_name< uint16_t > ()
template<>
const char * component_symbol_name< uint32_t > ()
template<>
const char * component_symbol_name< uint64_t > ()
template<>
const char * component_symbol_name< int8_t > ()
template<>
const char * component_symbol_name< int16_t > ()
template<>
const char * component_symbol_name< int32_t > ()
template<>
const char * component_symbol_name< int64_t > ()
template<>
const char * component_symbol_name< float > ()
template<>
const char * component_symbol_name< double > ()
template<typename T>
void register_lifecycle_actions (ecs_world_t *world, ecs_entity_t component)
template<typename T>
ecs_cpp_type_action_t lifecycle_action ()
template<typename T>
ecs_cpp_type_action_t enum_action ()
template<typename T>
void register_cpp_meta (ecs_world_t *world, ecs_entity_t component)
template<typename Delegate, ecs_iter_action_t Action, bool Run, typename Desc, typename Func>
void set_callback (Desc &desc, Func &&func)
template<bool Run, typename Desc, typename Func, typename... Components>
void set_each_callback (Desc &desc, Func &&func, arg_list< Components... >)
template<typename T, bool Destroy>
ecs_xtor_t xtor (ecs_flags32_t &flags)
template<typename T, bool Move, bool Construct, bool Destroy = false>
conditional_t< Move, ecs_move_t, ecs_copy_ttransfer (ecs_flags32_t &flags)
template<typename T>
int compare_impl (const void *a, const void *b, const ecs_type_info_t *)
template<typename T>
ecs_cmp_t compare ()
template<typename T>
bool equals_impl (const void *a, const void *b, const ecs_type_info_t *)
template<typename T>
ecs_equals_t equals ()
template<bool Match, typename Func>
void each_id (flecs::world_t *world, flecs::entity_t entity, flecs::id_t pattern, const Func &func)
template<typename Event = void, typename Func>
void entity_observer_create (world_t *world, entity_t event, entity_t entity, Func &&func)
template<typename T>
ecs_entity_t do_import (world &world, const char *symbol)
template<typename T>
flecs::entity import (world &world)
template<typename Func, typename... Components>
void world_each (const flecs::world &world, Func &&func, arg_list< Components... >)
ecs_value_t get_const_var (const flecs::world_t *world, const char *name)
template<bool Mutable, typename T>
std::conditional_t< std::is_arithmetic_v< T >, T, const T & > get_script_var (flecs::world_t *world, const char *name, const T &default_value)
const char * get_const_string (const flecs::world_t *world, const char *name, ecs_value_t value, const char *default_value)
void system_init (flecs::world &world)
void timer_init (flecs::world &world)
template<typename T>
flecs::entity_t entity_id (world_t *world, T value)
template<typename T>
auto resolve_id (world_t *world, arg_list< T >)
template<typename First, typename Second>
auto resolve_id (world_t *world, arg_list< First, Second >)
template<typename First, typename Second>
auto resolve_id (world_t *world, arg_list< First >, Second second)
template<typename T>
auto resolve_id (world_t *world, arg_list<>, T value)
auto resolve_id (world_t *, arg_list<>, flecs::entity_t first, flecs::entity_t second)
template<typename... T, typename... Args>
auto make_id (world_t *world, Args... args)
template<typename... T, typename A>
auto value_id (world_t *world, const A &)
template<typename Second>
auto second_id (world_t *world, flecs::entity_t first)
template<typename First, typename Second>
auto second_id (world_t *world)
template<typename Id>
void add_component (world_t *world, flecs::entity_t entity, Id id)
template<typename Id>
bool has_component (world_t *world, flecs::entity_t entity, Id id)
template<bool Mutable, bool Required, bool Ensure = false, typename Id>
decltype(auto) get_component (world_t *world, flecs::entity_t entity, Id id)
template<size_t N>
constexpr size_t enum_template_arg_separator (const char(&func_name)[N], size_t pos, size_t end, size_t depth=0)
template<typename E, E C>
constexpr bool enum_constant_is_valid ()
template<typename V>
enable_if_t< is_pointer< V >::value, V > map_value_cast (ecs_map_val_t v)
template<typename V>
enable_if_t<!is_pointer< V >::value, V > map_value_cast (ecs_map_val_t v)
template<typename T>
constexpr flecs::inout_kind_t type_to_inout ()
template<typename T>
constexpr flecs::oper_kind_t type_to_oper ()
template<typename... Components, typename Builder>
void populate_signature (flecs::world_t *world, Builder *builder)
template<auto Write, typename T>
void write_component (world_t *world, flecs::entity_t entity, T &&value, flecs::id_t id)

Variables

template<typename T>
bool type_impl< T >::s_has_data
template<typename E, underlying_type_t< E > Value>
constexpr E to_constant< E, Value >::value

Detailed Description

Int to enum.

Typedef Documentation

◆ alert_builder_base

template<typename ... Components>
using flecs::_::alert_builder_base
Initial value:
alert<Components...>, ecs_alert_desc_t, alert_builder<Components...>,
alert_builder_i, Components ...>
Alert descriptor, used with ecs_alert_init().
Definition alerts.h:78
Alert builder interface.
Definition builder_i.hpp:17
Alert builder.
Definition builder.hpp:24

Definition at line 14 of file builder.hpp.

◆ event_from_func_t

template<typename Func>
using flecs::_::event_from_func_t = typename event_from_func<Func>::type

Definition at line 34 of file decl.hpp.

◆ observer_builder_base

template<typename ... Components>
using flecs::_::observer_builder_base
Initial value:
observer_builder_i, Components ...>
Used with ecs_observer_init().
Definition flecs.h:1399
Observer builder interface.
Definition builder_i.hpp:17
Observer builder.
Definition builder.hpp:24
Observer.
Definition impl.hpp:18

Definition at line 14 of file builder.hpp.

◆ pipeline_builder_base

template<typename ... Components>
using flecs::_::pipeline_builder_base
Initial value:
pipeline<Components...>, ecs_pipeline_desc_t, pipeline_builder<Components...>,
pipeline_builder_i, Components ...>
Pipeline descriptor, used with ecs_pipeline_init().
Definition pipeline.h:88
Pipeline builder interface.
Definition builder_i.hpp:17
Pipeline builder.
Definition builder.hpp:24
Forward declaration for pipeline.
Definition impl.hpp:13

Definition at line 14 of file builder.hpp.

◆ query_builder_base

template<typename ... Components>
using flecs::_::query_builder_base
Initial value:
query<Components...>, ecs_query_desc_t, query_builder<Components...>,
query_builder_i, Components ...>
Used with ecs_query_init().
Definition flecs.h:1325
Query builder interface.
Definition builder_i.hpp:18
Query builder.
Definition builder.hpp:24
Typed query.
Definition impl.hpp:266

Definition at line 14 of file builder.hpp.

◆ system_builder_base

template<typename ... Components>
using flecs::_::system_builder_base
Initial value:
system_builder_i, Components ...>
Use with ecs_system_init() and ecs_system_update().
Definition system.h:38
System builder interface.
Definition builder_i.hpp:18
System builder.
Definition builder.hpp:25
System.
Definition impl.hpp:78

Definition at line 15 of file builder.hpp.

◆ value_type_t

template<typename... T>
using flecs::_::value_type_t = typename value_type<T...>::type

Definition at line 83 of file component_id.hpp.

Function Documentation

◆ add_component()

template<typename Id>
void flecs::_::add_component ( world_t * world,
flecs::entity_t entity,
Id id )

Definition at line 111 of file component_id.hpp.

◆ compare()

template<typename T>
ecs_cmp_t flecs::_::compare ( )

Definition at line 171 of file lifecycle_traits.hpp.

◆ compare_impl()

template<typename T>
int flecs::_::compare_impl ( const void * a,
const void * b,
const ecs_type_info_t *  )

Definition at line 133 of file lifecycle_traits.hpp.

◆ component_symbol_name()

template<typename T>
const char * flecs::_::component_symbol_name ( )
inline

Definition at line 21 of file component.hpp.

◆ component_symbol_name< double >()

template<>
const char * flecs::_::component_symbol_name< double > ( )
inline

Definition at line 52 of file component.hpp.

◆ component_symbol_name< float >()

template<>
const char * flecs::_::component_symbol_name< float > ( )
inline

Definition at line 49 of file component.hpp.

◆ component_symbol_name< int16_t >()

template<>
const char * flecs::_::component_symbol_name< int16_t > ( )
inline

Definition at line 40 of file component.hpp.

◆ component_symbol_name< int32_t >()

template<>
const char * flecs::_::component_symbol_name< int32_t > ( )
inline

Definition at line 43 of file component.hpp.

◆ component_symbol_name< int64_t >()

template<>
const char * flecs::_::component_symbol_name< int64_t > ( )
inline

Definition at line 46 of file component.hpp.

◆ component_symbol_name< int8_t >()

template<>
const char * flecs::_::component_symbol_name< int8_t > ( )
inline

Definition at line 37 of file component.hpp.

◆ component_symbol_name< uint16_t >()

template<>
const char * flecs::_::component_symbol_name< uint16_t > ( )
inline

Definition at line 28 of file component.hpp.

◆ component_symbol_name< uint32_t >()

template<>
const char * flecs::_::component_symbol_name< uint32_t > ( )
inline

Definition at line 31 of file component.hpp.

◆ component_symbol_name< uint64_t >()

template<>
const char * flecs::_::component_symbol_name< uint64_t > ( )
inline

Definition at line 34 of file component.hpp.

◆ component_symbol_name< uint8_t >()

template<>
const char * flecs::_::component_symbol_name< uint8_t > ( )
inline

Definition at line 25 of file component.hpp.

◆ do_import()

template<typename T>
ecs_entity_t flecs::_::do_import ( world & world,
const char * symbol )

Definition at line 13 of file impl.hpp.

◆ each_id()

template<bool Match, typename Func>
void flecs::_::each_id ( flecs::world_t * world,
flecs::entity_t entity,
flecs::id_t pattern,
const Func & func )

Definition at line 114 of file impl.hpp.

◆ entity_id()

template<typename T>
flecs::entity_t flecs::_::entity_id ( world_t * world,
T value )

Definition at line 25 of file component_id.hpp.

◆ entity_observer_create()

template<typename Event = void, typename Func>
void flecs::_::entity_observer_create ( world_t * world,
entity_t event,
entity_t entity,
Func && func )

Definition at line 26 of file impl.hpp.

◆ enum_action()

template<typename T>
ecs_cpp_type_action_t flecs::_::enum_action ( )
inline

Definition at line 114 of file component.hpp.

◆ enum_constant_is_valid()

template<typename E, E C>
bool flecs::_::enum_constant_is_valid ( )
constexpr

Definition at line 128 of file enum.hpp.

◆ enum_template_arg_separator()

template<size_t N>
size_t flecs::_::enum_template_arg_separator ( const char(&) func_name[N],
size_t pos,
size_t end,
size_t depth = 0 )
constexpr

Definition at line 104 of file enum.hpp.

◆ equals()

template<typename T>
ecs_equals_t flecs::_::equals ( )

Definition at line 188 of file lifecycle_traits.hpp.

◆ equals_impl()

template<typename T>
bool flecs::_::equals_impl ( const void * a,
const void * b,
const ecs_type_info_t *  )

Definition at line 181 of file lifecycle_traits.hpp.

◆ get_component()

template<bool Mutable, bool Required, bool Ensure = false, typename Id>
decltype(auto) flecs::_::get_component ( world_t * world,
flecs::entity_t entity,
Id id )

Definition at line 130 of file component_id.hpp.

◆ get_const_string()

const char * flecs::_::get_const_string ( const flecs::world_t * world,
const char * name,
ecs_value_t value,
const char * default_value )
inline

Definition at line 132 of file impl.hpp.

◆ get_const_var()

ecs_value_t flecs::_::get_const_var ( const flecs::world_t * world,
const char * name )
inline

Definition at line 65 of file impl.hpp.

◆ get_script_var()

template<bool Mutable, typename T>
std::conditional_t< std::is_arithmetic_v< T >, T, const T & > flecs::_::get_script_var ( flecs::world_t * world,
const char * name,
const T & default_value )
inline

Definition at line 85 of file impl.hpp.

◆ has_component()

template<typename Id>
bool flecs::_::has_component ( world_t * world,
flecs::entity_t entity,
Id id )

Definition at line 119 of file component_id.hpp.

◆ import()

template<typename T>
flecs::entity flecs::_::import ( world & world)

Definition at line 49 of file impl.hpp.

◆ lifecycle_action()

template<typename T>
ecs_cpp_type_action_t flecs::_::lifecycle_action ( )
inline

Definition at line 94 of file component.hpp.

◆ make_id()

template<typename... T, typename... Args>
auto flecs::_::make_id ( world_t * world,
Args... args )

Definition at line 75 of file component_id.hpp.

◆ map_value_cast() [1/2]

template<typename V>
enable_if_t<!is_pointer< V >::value, V > flecs::_::map_value_cast ( ecs_map_val_t v)
inline

Definition at line 19 of file map.hpp.

◆ map_value_cast() [2/2]

template<typename V>
enable_if_t< is_pointer< V >::value, V > flecs::_::map_value_cast ( ecs_map_val_t v)
inline

Definition at line 13 of file map.hpp.

◆ populate_signature()

template<typename... Components, typename Builder>
void flecs::_::populate_signature ( flecs::world_t * world,
Builder * builder )

Definition at line 23 of file signature.hpp.

◆ register_cpp_meta()

template<typename T>
void flecs::_::register_cpp_meta ( ecs_world_t * world,
ecs_entity_t component )
inline

Definition at line 134 of file component.hpp.

◆ register_lifecycle_actions()

template<typename T>
void flecs::_::register_lifecycle_actions ( ecs_world_t * world,
ecs_entity_t component )

Definition at line 61 of file component.hpp.

◆ resolve_id() [1/5]

auto flecs::_::resolve_id ( world_t * ,
arg_list<> ,
flecs::entity_t first,
flecs::entity_t second )
inline

Definition at line 70 of file component_id.hpp.

◆ resolve_id() [2/5]

template<typename First, typename Second>
auto flecs::_::resolve_id ( world_t * world,
arg_list< First > ,
Second second )

Definition at line 55 of file component_id.hpp.

◆ resolve_id() [3/5]

template<typename First, typename Second>
auto flecs::_::resolve_id ( world_t * world,
arg_list< First, Second >  )

Definition at line 48 of file component_id.hpp.

◆ resolve_id() [4/5]

template<typename T>
auto flecs::_::resolve_id ( world_t * world,
arg_list< T >  )

Definition at line 37 of file component_id.hpp.

◆ resolve_id() [5/5]

template<typename T>
auto flecs::_::resolve_id ( world_t * world,
arg_list<> ,
T value )

Definition at line 61 of file component_id.hpp.

◆ second_id() [1/2]

template<typename First, typename Second>
auto flecs::_::second_id ( world_t * world)

Definition at line 105 of file component_id.hpp.

◆ second_id() [2/2]

template<typename Second>
auto flecs::_::second_id ( world_t * world,
flecs::entity_t first )

Definition at line 95 of file component_id.hpp.

◆ set_callback()

template<typename Delegate, ecs_iter_action_t Action, bool Run, typename Desc, typename Func>
void flecs::_::set_callback ( Desc & desc,
Func && func )

Definition at line 488 of file delegate.hpp.

◆ set_each_callback()

template<bool Run, typename Desc, typename Func, typename... Components>
void flecs::_::set_each_callback ( Desc & desc,
Func && func,
arg_list< Components... >  )

Definition at line 495 of file delegate.hpp.

◆ timer_init()

void flecs::_::timer_init ( flecs::world & world)
inline

Definition at line 119 of file impl.hpp.

◆ transfer()

template<typename T, bool Move, bool Construct, bool Destroy = false>
conditional_t< Move, ecs_move_t, ecs_copy_t > flecs::_::transfer ( ecs_flags32_t & flags)

Definition at line 45 of file lifecycle_traits.hpp.

◆ type_to_inout()

template<typename T>
flecs::inout_kind_t flecs::_::type_to_inout ( )
constexpr

Definition at line 12 of file signature.hpp.

◆ type_to_oper()

template<typename T>
flecs::oper_kind_t flecs::_::type_to_oper ( )
constexpr

Definition at line 18 of file signature.hpp.

◆ value_id()

template<typename... T, typename A>
auto flecs::_::value_id ( world_t * world,
const A &  )

Definition at line 86 of file component_id.hpp.

◆ world_each()

template<typename Func, typename... Components>
void flecs::_::world_each ( const flecs::world & world,
Func && func,
arg_list< Components... >  )

Definition at line 349 of file impl.hpp.

◆ write_component()

template<auto Write, typename T>
void flecs::_::write_component ( world_t * world,
flecs::entity_t entity,
T && value,
flecs::id_t id )

Definition at line 14 of file world.hpp.

◆ xtor()

template<typename T, bool Destroy>
ecs_xtor_t flecs::_::xtor ( ecs_flags32_t & flags)

Definition at line 19 of file lifecycle_traits.hpp.

Variable Documentation

◆ to_constant< E, Value >::value

template<typename E, underlying_type_t< E > Value>
E flecs::_::to_constant< E, Value >::value
constexpr

Definition at line 54 of file enum.hpp.

◆ type_impl< T >::s_has_data

template<typename T>
bool flecs::_::type_impl< T >::s_has_data
inline

Definition at line 336 of file component.hpp.