Function with

Summary

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

(1) template <typename Func>
    void with(id_t with_id, const Func &func) const

(2) template <typename T, typename Func>
    void with(const Func &func) const

(3) template <typename First, typename Second, typename Func>
    void with(const Func &func) const

(4) template <typename First, typename Func>
    void with(id_t second, const Func &func) const

(5) template <typename Func>
    void with(id_t first, id_t second, const Func &func) const

Function overload

Synopsis

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

template <typename Func>
void with(id_t with_id, const Func &func) const

Description

All entities created in function are created with id.

Source

Lines 649-654 in include/flecs/addons/cpp/world.hpp.

template <typename Func>
void with(id_t with_id, const Func& func) const {
    ecs_id_t prev = ecs_set_with(m_world, with_id);
    func();
    ecs_set_with(m_world, prev);    
}

Synopsis

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

template <typename T, typename Func>
void with(const Func &func) const

Description

All entities created in function are created with type.

Source

Lines 658-661 in include/flecs/addons/cpp/world.hpp.

template <typename T, typename Func>
void with(const Func& func) const {
    with(this->id<T>(), func);
}

Synopsis

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

template <typename First, typename Second, typename Func>
void with(const Func &func) const

Description

All entities created in function are created with pair.

Source

Lines 665-668 in include/flecs/addons/cpp/world.hpp.

template <typename First, typename Second, typename Func>
void with(const Func& func) const {
    with(ecs_pair(this->id<First>(), this->id<Second>()), func);
}

Synopsis

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

template <typename First, typename Func>
void with(id_t second, const Func &func) const

Description

All entities created in function are created with pair.

Source

Lines 672-675 in include/flecs/addons/cpp/world.hpp.

template <typename First, typename Func>
void with(id_t second, const Func& func) const {
    with(ecs_pair(this->id<First>(), second), func);
} 

Synopsis

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

template <typename Func>
void with(id_t first, id_t second, const Func &func) const

Description

All entities created in function are created with pair.

Source

Lines 679-682 in include/flecs/addons/cpp/world.hpp.

template <typename Func>
void with(id_t first, id_t second, const Func& func) const {
    with(ecs_pair(first, second), func);
}