![]() |
Flecs v4.1
A fast entity component system (ECS) for C & C++
|
Wrapper class around a field. More...
#include <field.hpp>
Public Member Functions | |
| field (T *array, size_t count, bool is_shared=false) | |
| Create a field from a component array. | |
| field (iter &iter, int field) | |
| Create a field from an iterator. | |
| T & | operator[] (size_t index) const |
| Return an element in the component array. | |
| T & | operator* () const |
| Return the first element of the component array. | |
| T * | operator-> () const |
| Return the first element of the component array. | |
Protected Attributes | |
| T * | data_ |
| size_t | count_ |
| bool | is_shared_ |
Wrapper class around a field.
| T | Component type of the field. |
|
inline |
| flecs::field< T >::field | ( | iter & | iter, |
| int | field ) |
Create a field from an iterator.
| iter | Iterator object. |
| field | Index of the field in the query being iterated over. |
| T & flecs::field< T >::operator* | ( | ) | const |
| T * flecs::field< T >::operator-> | ( | ) | const |
| T & flecs::field< T >::operator[] | ( | size_t | index | ) | const |
Return an element in the component array.
Access an element at an index in the field.
This operator may only be used if the field is not shared.
| index | Index of element. |
| index | The element index. |
|
protected |
|
protected |
|
protected |