Class tree_iterator

Synopsis

#include <include/flecs/cpp/filter_iterator.hpp>

class tree_iterator

Description

No description yet.

Methods

tree_iterator overload
operator!=
operator*
operator++

Source

Lines 59-88 in include/flecs/cpp/filter_iterator.hpp.

class tree_iterator
{
public:
    tree_iterator()
        : m_has_next(false)
        , m_iter{ } { }

    tree_iterator(flecs::world_t *world, const flecs::entity_t entity) 
        : m_iter( ecs_scope_iter(world, entity ))
    {
        m_has_next = ecs_scope_next(&m_iter);
    }

    bool operator!=(tree_iterator const& other) const {
        return m_has_next != other.m_has_next;
    }

    flecs::iter const operator*() const {
        return flecs::iter(&m_iter);
    }

    tree_iterator& operator++() {
        m_has_next = ecs_scope_next(&m_iter);
        return *this;
    }

private:
    bool m_has_next;
    ecs_iter_t m_iter;
};