Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs::enum_data< E > Struct Template Reference

Convenience type with enum reflection data. More...

#include <enum.hpp>

Public Types

using U = underlying_type_t<E>
 

Public Member Functions

 enum_data (flecs::world_t *world, _::enum_data_impl< E > &impl)
 
bool is_valid (U value)
 Checks if a given integral value is a valid enum value.
 
bool is_valid (E value)
 Checks if a given enum value is valid.
 
int index_by_value (U value) const
 Finds the index into the constants array for a value, if one exists.
 
int index_by_value (E value) const
 Finds the index into the constants array for an enum value, if one exists.
 
int first () const
 
int last () const
 
int next (int cur) const
 
flecs::entity entity () const
 
flecs::entity entity (U value) const
 
flecs::entity entity (E value) const
 

Public Attributes

flecs::world_t * world_
 
_::enum_data_impl< E > & impl_
 

Detailed Description

template<typename E>
struct flecs::enum_data< E >

Convenience type with enum reflection data.

Enumeration type data wrapper with world pointer.

Definition at line 408 of file enum.hpp.

Member Typedef Documentation

◆ U

template<typename E >
using flecs::enum_data< E >::U = underlying_type_t<E>

Definition at line 409 of file enum.hpp.

Constructor & Destructor Documentation

◆ enum_data()

template<typename E >
flecs::enum_data< E >::enum_data ( flecs::world_t * world,
_::enum_data_impl< E > & impl )
inline

Definition at line 411 of file enum.hpp.

Member Function Documentation

◆ entity() [1/2]

template<typename E >
flecs::entity flecs::enum_data< E >::entity ( ) const
inline

Definition at line 277 of file world.hpp.

◆ entity() [2/2]

template<typename E >
flecs::entity flecs::enum_data< E >::entity ( E value) const
inline

Definition at line 307 of file world.hpp.

◆ first()

template<typename E >
int flecs::enum_data< E >::first ( ) const
inline

Definition at line 475 of file enum.hpp.

◆ index_by_value() [1/2]

template<typename E >
int flecs::enum_data< E >::index_by_value ( E value) const
inline

Finds the index into the constants array for an enum value, if one exists.

Parameters
valueThe enum value.
Returns
int The index of the enum value.

Definition at line 471 of file enum.hpp.

◆ index_by_value() [2/2]

template<typename E >
int flecs::enum_data< E >::index_by_value ( U value) const
inline

Finds the index into the constants array for a value, if one exists.

Parameters
valueThe enum value.
Returns
int The index of the enum value.

Definition at line 447 of file enum.hpp.

◆ is_valid() [1/2]

template<typename E >
bool flecs::enum_data< E >::is_valid ( E value)
inline

Checks if a given enum value is valid.

Parameters
valueThe enum value.
Returns
true If the value is valid.
false If the value is not valid.

Definition at line 437 of file enum.hpp.

◆ is_valid() [2/2]

template<typename E >
bool flecs::enum_data< E >::is_valid ( U value)
inline

Checks if a given integral value is a valid enum value.

Parameters
valueThe integral value.
Returns
true If the value is a valid enum value.
false If the value is not a valid enum value.

Definition at line 422 of file enum.hpp.

◆ last()

template<typename E >
int flecs::enum_data< E >::last ( ) const
inline

Definition at line 479 of file enum.hpp.

◆ next()

template<typename E >
int flecs::enum_data< E >::next ( int cur) const
inline

Definition at line 483 of file enum.hpp.

Member Data Documentation

◆ impl_

template<typename E >
_::enum_data_impl<E>& flecs::enum_data< E >::impl_

Definition at line 492 of file enum.hpp.

◆ world_

template<typename E >
flecs::world_t* flecs::enum_data< E >::world_

Definition at line 491 of file enum.hpp.


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