Struct scoped_world

Synopsis

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

struct scoped_world : world

Description

No description yet.

Inheritance

Ancestors: world

Methods

scoped_world overload
~scoped_world

Source

Lines 874-895 in include/flecs/addons/cpp/world.hpp.

struct scoped_world : world {
    scoped_world(
        flecs::world_t *w, 
        flecs::entity_t s) : world(nullptr)
    {
        m_prev_scope = ecs_set_scope(w, s);
        m_world = w;
        m_owned = false;
    }

    ~scoped_world() {
        ecs_set_scope(m_world, m_prev_scope);
    }

    scoped_world(const scoped_world& obj) : world(nullptr) {
        m_prev_scope = obj.m_prev_scope;
        m_world = obj.m_world;
        m_owned = obj.m_owned;
    }

    flecs::entity_t m_prev_scope;
};