Class meta_sequence_container


#include <src/entt/meta/meta.hpp>

class meta_sequence_container


Proxy object for sequence containers.

Mentioned in


meta_sequence_container overloadDefault constructor.
meta_sequence_container overloadConstruct a proxy object for sequence containers.
beginReturns an iterator to the first element of a container.
clearClears the content of a container.
endReturns an iterator that is past the last element of a container.
eraseRemoves a given element from a container.
insertInserts an element at a specified location of a container.
operator boolReturns false if a proxy is invalid, true otherwise.
operator[]Returns a reference to the element at a given location of a container (no bounds checking is performed).
resizeResizes a container to contain a given number of elements.
sizeReturns the size of a container.
value_typeReturns the meta value type of a container.


Lines 29-75 in src/entt/meta/meta.hpp.

class meta_sequence_container {
    class meta_iterator;

    /*! @brief Unsigned integer type. */
    using size_type = std::size_t;
    /*! @brief Meta iterator type. */
    using iterator = meta_iterator;

    /*! @brief Default constructor. */
    meta_sequence_container() ENTT_NOEXCEPT = default;

     * @brief Construct a proxy object for sequence containers.
     * @tparam Type Type of container to wrap.
     * @param instance The container to wrap.
    template<typename Type>
    meta_sequence_container(std::in_place_type_t<Type>, any instance) ENTT_NOEXCEPT
        : value_type_node{internal::meta_node<std::remove_cv_t<std::remove_reference_t<typename Type::value_type>>>::resolve()},
          storage{std::move(instance)} {}

    [[nodiscard]] inline meta_type value_type() const ENTT_NOEXCEPT;
    [[nodiscard]] inline size_type size() const ENTT_NOEXCEPT;
    inline bool resize(const size_type);
    inline bool clear();
    [[nodiscard]] inline iterator begin();
    [[nodiscard]] inline iterator end();
    inline iterator insert(iterator, meta_any);
    inline iterator erase(iterator);
    [[nodiscard]] inline meta_any operator[](const size_type);
    [[nodiscard]] inline explicit operator bool() const ENTT_NOEXCEPT;

    internal::meta_type_node *value_type_node = nullptr;
    size_type (*size_fn)(const any &) ENTT_NOEXCEPT = nullptr;
    bool (*resize_fn)(any &, size_type) = nullptr;
    iterator (*iter_fn)(any &, const bool) = nullptr;
    iterator (*insert_fn)(any &, const std::ptrdiff_t, meta_any &) = nullptr;
    iterator (*erase_fn)(any &, const std::ptrdiff_t) = nullptr;
    any storage{};

Add Discussion

Log in to comment