Function field

Summary

#include <include/flecs/addons/cpp/iter.hpp>

(1) template <typename T, typename A = actual_type_t<T>, typename std::enable_if< std::is_const< T >::value, void >::type * = nullptr>
    flecs::column< A > field(int32_t index) const

(2) template <typename T, typename A = actual_type_t<T>, typename std::enable_if< std::is_const< T >::value==false, void >::type * = nullptr>
    flecs::column< A > field(int32_t index) const

(3) flecs::unchecked_column field(int32_t index) const

Function overload

Synopsis

#include <include/flecs/addons/cpp/iter.hpp>

template <typename T, typename A = actual_type_t<T>, typename std::enable_if< std::is_const< T >::value, void >::type * = nullptr>
flecs::column< A > field(int32_t index) const

Description

Get readonly access to field data. If the specified field index does not match with the provided type, the function will assert.

Template Parameters

T - Type of the field.

Parameters

index - The field index.

Returns
The field data.

Mentioned in

Source

Lines 309-311 in include/flecs/addons/cpp/iter.hpp.

flecs::column<A> field(int32_t index) const {
    return get_field<A>(index);
}

Synopsis

#include <include/flecs/addons/cpp/iter.hpp>

template <typename T, typename A = actual_type_t<T>, typename std::enable_if< std::is_const< T >::value==false, void >::type * = nullptr>
flecs::column< A > field(int32_t index) const

Description

Get read/write access to field data. If the matched id for the specified field does not match with the provided type or if the field is readonly, the function will assert.

Template Parameters

T - Type of the field.

Parameters

index - The field index.

Returns
The field data.

Mentioned in

Source

Lines 325-329 in include/flecs/addons/cpp/iter.hpp.

flecs::column<A> field(int32_t index) const {
    ecs_assert(!ecs_field_is_readonly(m_iter, index), 
        ECS_ACCESS_VIOLATION, NULL);
    return get_field<A>(index);
}

Synopsis

#include <include/flecs/addons/cpp/iter.hpp>

flecs::unchecked_column field(int32_t index) const

Description

Get unchecked access to field data. Unchecked access is required when a system does not know the type of a field at compile time.

Parameters

index - The field index.

Mentioned in

Source

Lines 337-339 in include/flecs/addons/cpp/iter.hpp.

flecs::unchecked_column field(int32_t index) const {
    return get_unchecked_field(index);
}