Struct Storage

Synopsis

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

template<typename Entity>
struct Storage: type_list<
    type_info() const ENTT_NOEXCEPT,
    void(basic_registry<Entity> &, const Entity *, const Entity *)
>

Description

Basic poly storage implementation.

Template Parameters

Entity - A valid entity type (see entt_traits for more details).

Inheritance

Ancestors: type_list

Structures

typeConcept definition.

Source

Lines 20-66 in src/entt/entity/poly_storage.hpp.

template<typename Entity>
struct Storage: type_list<
    type_info() const ENTT_NOEXCEPT,
    void(basic_registry<Entity> &, const Entity *, const Entity *)
> {
    /*! @brief Underlying entity identifier. */
    using entity_type = Entity;
    /*! @brief Unsigned integer type. */
    using size_type = std::size_t;

    /**
     * @brief Concept definition.
     * @tparam Base Opaque base class from which to inherit.
     */
    template<typename Base>
    struct type: Base {
        /**
         * @brief Returns a type info for the contained objects.
         * @return The type info for the contained objects.
         */
        type_info value_type() const ENTT_NOEXCEPT {
            return poly_call<0>(*this);
        }

        /**
         * @brief Removes entities from a storage.
         * @param owner The registry that issued the request.
         * @param first An iterator to the first element of the range of
         * entities.
         * @param last An iterator past the last element of the range of
         * entities.
         */
        void remove(basic_registry<entity_type> &owner, const entity_type *first, const entity_type *last) {
            poly_call<1>(*this, owner, first, last);
        }
    };

    /**
     * @brief Concept implementation.
     * @tparam Type Type for which to generate an implementation.
     */
    template<typename Type>
    using impl = value_list<
        &type_id<typename Type::value_type>,
        &Type::template remove<const entity_type *>
    >;
};





Add Discussion

Log in to comment