Skip to content
Flecs v4.1
flecs::base_field< T > Struct Template Reference

Wrapper class around a field matched through component inheritance. More...

#include <field.hpp>

Public Member Functions

 base_field (T *array, size_t stride, size_t count, bool is_shared=false)
 base_field (iter &iter, int field)
T & operator[] (size_t index) const
T & operator* () const
T * operator-> () const

Protected Attributes

T * data_
size_t stride_
size_t count_
bool is_shared_

Detailed Description

template<typename T>
struct flecs::base_field< T >

Wrapper class around a field matched through component inheritance.

Same interface as field, but uses a runtime stride so it can iterate a field whose stored (derived) component is larger than T. Unlike field, this does not assert when the matched id is a subtype of T.

Template Parameters
TBase component type of the field.

Definition at line 122 of file field.hpp.

Constructor & Destructor Documentation

◆ base_field()

template<typename T>
flecs::base_field< T >::base_field ( T * array,
size_t stride,
size_t count,
bool is_shared = false )
inline

Definition at line 126 of file field.hpp.

Member Function Documentation

◆ operator*()

template<typename T>
T & flecs::base_field< T >::operator* ( ) const

Definition at line 90 of file field.hpp.

◆ operator->()

template<typename T>
T * flecs::base_field< T >::operator-> ( ) const

Definition at line 98 of file field.hpp.

◆ operator[]()

template<typename T>
T & flecs::base_field< T >::operator[] ( size_t index) const

Definition at line 76 of file field.hpp.

Member Data Documentation

◆ count_

template<typename T>
size_t flecs::base_field< T >::count_
protected

Definition at line 141 of file field.hpp.

◆ data_

template<typename T>
T* flecs::base_field< T >::data_
protected

Definition at line 139 of file field.hpp.

◆ is_shared_

template<typename T>
bool flecs::base_field< T >::is_shared_
protected

Definition at line 142 of file field.hpp.

◆ stride_

template<typename T>
size_t flecs::base_field< T >::stride_
protected

Definition at line 140 of file field.hpp.


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