Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs::untyped_field Struct Reference

Unsafe wrapper class around a field. More...

#include <field.hpp>

Public Member Functions

 untyped_field (void *array, size_t size, size_t count, bool is_shared=false)
 
void * operator[] (size_t index) const
 Return element in component array.
 

Protected Attributes

void * data_
 
size_t size_
 
size_t count_
 
bool is_shared_
 

Detailed Description

Unsafe wrapper class around a field.

This class can be used when a system does not know the type of a field at compile time.

Definition at line 26 of file field.hpp.

Constructor & Destructor Documentation

◆ untyped_field()

flecs::untyped_field::untyped_field ( void * array,
size_t size,
size_t count,
bool is_shared = false )
inline

Definition at line 27 of file field.hpp.

Member Function Documentation

◆ operator[]()

void * flecs::untyped_field::operator[] ( size_t index) const
inline

Return element in component array.

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

Parameters
indexIndex of element.
Returns
Reference to element.

Definition at line 39 of file field.hpp.

Member Data Documentation

◆ count_

size_t flecs::untyped_field::count_
protected

Definition at line 50 of file field.hpp.

◆ data_

void* flecs::untyped_field::data_
protected

Definition at line 48 of file field.hpp.

◆ is_shared_

bool flecs::untyped_field::is_shared_
protected

Definition at line 51 of file field.hpp.

◆ size_

size_t flecs::untyped_field::size_
protected

Definition at line 49 of file field.hpp.


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