Flecs: flecs::enum_data< E > Struct Template Reference
Description: A fast entity component system (ECS) for C & C++

| 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_type< 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_
| Manually register constant for enum.
_::enum_type< 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 450 of file enum.hpp.

## Member Typedef Documentation

## ◆ U

template<typename E>

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

Definition at line 451 of file enum.hpp.

## Constructor & Destructor Documentation

## ◆ enum_data()

template<typename E>

flecs::enum_data< E >::enum_data | ( | flecs::world_t * | world,
|  | _::enum_type< E > & | impl )
| inline

Definition at line 453 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 370 of file world.hpp.

## ◆ entity() [2/2]

template<typename E>

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

Definition at line 399 of file world.hpp.

## ◆ first()

template<typename E>

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

Definition at line 518 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

  value | The enum value.

Returns
  int The index of the enum value.

Definition at line 514 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

  value | The enum value.

Returns
  int The index of the enum value.

Definition at line 489 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

  value | The enum value.

Returns
  true If the value is valid.
  false If the value is not valid.

Definition at line 479 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

  value | The 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 464 of file enum.hpp.

## ◆ last()

template<typename E>

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

Definition at line 522 of file enum.hpp.

## ◆ next()

template<typename E>

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

Definition at line 526 of file enum.hpp.

## Member Data Documentation

## ◆ impl_

template<typename E>

_::enum_type<E>& flecs::enum_data< E >::impl_

Definition at line 559 of file enum.hpp.

## ◆ world_

template<typename E>

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

Manually register constant for enum.

If automatic enum reflection is not supported, provide method for manually registering constant.

Definition at line 558 of file enum.hpp.

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

- include/flecs/addons/cpp/utils/enum.hpp
- include/flecs/addons/cpp/impl/world.hpp