Function basic_runtime_view

Summary

#include <src/entt/entity/runtime_view.hpp>

(1) basic_runtime_view() noexcept

(2) basic_runtime_view(std::vector< const basic_sparse_set< Entity > * > cpools, std::vector< const basic_sparse_set< Entity > * > epools) noexcept

Function overload

Synopsis

#include <src/entt/entity/runtime_view.hpp>

basic_runtime_view() noexcept

Description

Default constructor to use to create empty, invalid views.

Source

Lines 142-145 in src/entt/entity/runtime_view.hpp.

basic_runtime_view() ENTT_NOEXCEPT
    : pools{},
      filter{}
{}

Synopsis

#include <src/entt/entity/runtime_view.hpp>

basic_runtime_view(std::vector< const basic_sparse_set< Entity > * > cpools, std::vector< const basic_sparse_set< Entity > * > epools) noexcept

Description

Constructs a runtime view from a set of storage classes.

Parameters

cpools - The storage for the types to iterate.

epools - The storage for the types used to filter the view.

Source

Lines 152-162 in src/entt/entity/runtime_view.hpp.

basic_runtime_view(std::vector<const basic_sparse_set<Entity> *> cpools, std::vector<const basic_sparse_set<Entity> *> epools) ENTT_NOEXCEPT
    : pools{std::move(cpools)},
      filter{std::move(epools)}
{
    const auto it = std::min_element(pools.begin(), pools.end(), [](const auto *lhs, const auto *rhs) {
        return (!lhs && rhs) || (lhs && rhs && lhs->size() < rhs->size());
    });
    // brings the best candidate (if any) on front of the vector
    std::rotate(pools.begin(), it, pools.end());
}





Add Discussion

Log in to comment