Wrapper class around a field.
More...
#include <field.hpp>
|
| | 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.
|
template<typename T>
struct flecs::field< T >
Wrapper class around a field.
- Template Parameters
-
Definition at line 61 of file field.hpp.
◆ field() [1/2]
template<typename T>
| flecs::field< T >::field |
( |
T * | array, |
|
|
size_t | count, |
|
|
bool | is_shared = false ) |
|
inline |
Create a field from a component array.
- Parameters
-
| array | Pointer to the component array. |
| count | Number of elements in the component array. |
| is_shared | Whether the component is shared. |
Definition at line 71 of file field.hpp.
◆ field() [2/2]
Create a field from an iterator.
- Parameters
-
| iter | Iterator object. |
| field | Index of the field in the query being iterated over. |
◆ operator*()
Return the first element of the component array.
This operator is typically used when the field is shared.
- Returns
- Reference to the first element.
Definition at line 46 of file field.hpp.
◆ operator->()
Return the first element of the component array.
This operator is typically used when the field is shared.
- Returns
- Pointer to the first element.
Definition at line 59 of file field.hpp.
◆ operator[]()
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.
- Parameters
-
- Returns
- Reference to element.
- Parameters
-
- Returns
- Reference to the element.
Definition at line 27 of file field.hpp.
◆ count_
◆ data_
◆ is_shared_
The documentation for this struct was generated from the following files: