Flecs v3.2
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs::column< T > Struct Template Reference

Wrapper class around a column. More...

#include <iter.hpp>

Public Member Functions

 column (T *array, size_t count, bool is_shared=false)
 Create column from component array.
 
 column (iter &iter, int column)
 Create column from iterator.
 
T & operator[] (size_t index) const
 Return element in component array.
 
T & operator* () const
 Return first element of component array.
 
T * operator-> () const
 Return first element of component array.
 

Protected Attributes

T * m_array
 
size_t m_count
 
bool m_is_shared
 

Detailed Description

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

Wrapper class around a column.

Template Parameters
Tcomponent type of the column.

Definition at line 58 of file iter.hpp.

Constructor & Destructor Documentation

◆ column() [1/2]

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

Create column from component array.

Parameters
arrayPointer to the component array.
countNumber of elements in component array.
is_sharedIs the component shared or not.

Definition at line 68 of file iter.hpp.

◆ column() [2/2]

template<typename T >
flecs::column< T >::column ( iter & iter,
int column )

Create column from iterator.

Parameters
iterIterator object.
columnIndex of the signature of the query being iterated over.

Member Function Documentation

◆ operator*()

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

Return first element of component array.

This operator is typically used when the column is shared.

Returns
Reference to the first element.

Definition at line 98 of file iter.hpp.

◆ operator->()

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

Return first element of component array.

This operator is typically used when the column is shared.

Returns
Pointer to the first element.

Definition at line 108 of file iter.hpp.

◆ operator[]()

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

Return element in component array.

This operator may only be used if the column is not shared.

Parameters
indexIndex of element.
Returns
Reference to element.

Definition at line 86 of file iter.hpp.

Member Data Documentation

◆ m_array

template<typename T >
T* flecs::column< T >::m_array
protected

Definition at line 114 of file iter.hpp.

◆ m_count

template<typename T >
size_t flecs::column< T >::m_count
protected

Definition at line 115 of file iter.hpp.

◆ m_is_shared

template<typename T >
bool flecs::column< T >::m_is_shared
protected

Definition at line 116 of file iter.hpp.


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