Function resolve

Summary

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

(1) template <typename Type>
    meta_type resolve() noexcept

(2) meta_type resolve(const id_type id) noexcept

(3) meta_type resolve(const type_info info) noexcept

Function overload

Synopsis

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

template <typename Type>
meta_type resolve() noexcept

Description

Returns the meta type associated with a given type.

Returns a range to use to visit all meta types.

Template Parameters

Type - Type to use to search for a meta type.

Returns
The meta type associated with the given type, if any.
Returns
An iterable range to use to visit all meta types.

Mentioned in

Source

Lines 20-23 in src/entt/meta/resolve.hpp.

template<typename Type>
[[nodiscard]] meta_type resolve() ENTT_NOEXCEPT {
    return internal::meta_info<Type>::resolve();
}

Synopsis

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

meta_type resolve(const id_type id) noexcept

Description

Returns the meta type associated with a given identifier, if any.

Parameters

id - Unique identifier.

Returns
The meta type associated with the given identifier, if any.

Mentioned in

Source

Lines 40-48 in src/entt/meta/resolve.hpp.

[[nodiscard]] inline meta_type resolve(const id_type id) ENTT_NOEXCEPT {
    for(auto *curr = *internal::meta_context::global(); curr; curr = curr->next) {
        if(curr->id == id) {
            return curr;
        }
    }

    return {};
}

Synopsis

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

meta_type resolve(const type_info info) noexcept

Description

Returns the meta type associated with a given type info object, if any.

Parameters

info - The type info object of the requested type.

Returns
The meta type associated with the given type info object, if any.

Mentioned in

Source

Lines 57-65 in src/entt/meta/resolve.hpp.

[[nodiscard]] inline meta_type resolve(const type_info info) ENTT_NOEXCEPT {
    for(auto *curr = *internal::meta_context::global(); curr; curr = curr->next) {
        if(curr->info == info) {
            return curr;
        }
    }

    return {};
}





Add Discussion

Log in to comment