Function invoke_read

Synopsis

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

template <typename Func>
static bool invoke_read(world_t *world, entity_t e, const Func &func)

Description

No description yet.

Source

Lines 490-511 in include/flecs/addons/cpp/invoker.hpp.

template <typename Func>
static bool invoke_read(world_t *world, entity_t e, const Func& func) {
    const ecs_record_t *r = ecs_read_begin(world, e);
    if (!r) {
        return false;
    }
    ecs_table_t *table = r->table;
    if (!table) {
        return false;
    }
    ArrayType ptrs;
    bool has_components;
    if ((has_components = get_ptrs(world, r, table, ptrs))) {
        invoke_callback(func, 0, ptrs);
    }
    ecs_read_end(r);
    return has_components;
}