Flecs: flecs::type Struct Reference
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.1 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
flecs::type Struct Reference
C++ API » Core » Types

Type class. More...

`#include <type.hpp>`

## Public Member Functions
| type ()
| Default constructor.
| type (world_t *world, const type_t *t)
| Construct a type from a world and C type pointer.
flecs::string | str () const
| Convert the type to a comma-separated string.
int32_t | count () const
| Return the number of IDs in the type.
flecs::id_t * | array () const
| Return a pointer to the ID array.
flecs::id | get (int32_t index) const
| Get the ID at a specified index in the type.
const flecs::id_t * | begin () const
| Get an iterator to the beginning of the type's ID array.
const flecs::id_t * | end () const
| Get an iterator to the end of the type's ID array.
| operator const type_t * () const
| Implicit conversion to type_t.

## Detailed Description

Type class.

A type is a vector of component IDs that can be requested from entities or tables.

Definition at line 21 of file type.hpp.

## Constructor & Destructor Documentation

## ◆ type() [1/2]

flecs::type::type | ( |  | ) |
| inline

Default constructor.

Creates an empty type.

Definition at line 23 of file type.hpp.

## ◆ type() [2/2]

flecs::type::type | ( | world_t * | world,
|  | const type_t * | t )
| inline

Construct a type from a world and C type pointer.

Parameters

  world | The world.
  t | Pointer to the C type.

Definition at line 30 of file type.hpp.

## Member Function Documentation

## ◆ array()

flecs::id_t * flecs::type::array | ( |  | ) | const
| inline

Return a pointer to the ID array.

Returns
  Pointer to the array of IDs, or nullptr if empty.

Definition at line 57 of file type.hpp.

## ◆ begin()

const flecs::id_t * flecs::type::begin | ( |  | ) | const
| inline

Get an iterator to the beginning of the type's ID array.

Definition at line 79 of file type.hpp.

## ◆ count()

int32_t flecs::type::count | ( |  | ) | const
| inline

Return the number of IDs in the type.

Returns
  The number of IDs.

Definition at line 46 of file type.hpp.

## ◆ end()

const flecs::id_t * flecs::type::end | ( |  | ) | const
| inline

Get an iterator to the end of the type's ID array.

Definition at line 88 of file type.hpp.

## ◆ get()

flecs::id flecs::type::get | ( | int32_t | index | ) | const
| inline

Get the ID at a specified index in the type.

Parameters

  index | The index of the ID to get.

Returns
  The ID at the specified index.

Definition at line 69 of file type.hpp.

## ◆ operator const type_t *()

flecs::type::operator const type_t * | ( |  | ) | const
| inline

Implicit conversion to type_t.

Definition at line 97 of file type.hpp.

## ◆ str()

flecs::string flecs::type::str | ( |  | ) | const
| inline

Convert the type to a comma-separated string.

Returns
  String representation of the type.

Definition at line 38 of file type.hpp.

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

- include/flecs/addons/cpp/type.hpp