Function component_for_id

Synopsis

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

template <typename T>
void component_for_id(flecs::world_t *world, flecs::id_t id)

Description

No description yet.

Source

Lines 621-630 in include/flecs/addons/cpp/component.hpp.

template <typename T>
void component_for_id(flecs::world_t *world, flecs::id_t id) {
    flecs::entity result = component<T>(world, nullptr, true, id);

    ecs_assert(result.id() == id, ECS_INTERNAL_ERROR, NULL);

    if (_::cpp_type<T>::size()) {
        _::register_lifecycle_actions<T>(world, result);
    }
}