Remove superfluous inlines (was PR #249)
This commit is contained in:
@@ -64,7 +64,7 @@ class hashed_string {
|
||||
};
|
||||
|
||||
// Fowler–Noll–Vo hash function v. 1a - the good
|
||||
inline static constexpr ENTT_ID_TYPE helper(ENTT_ID_TYPE partial, const char *curr) ENTT_NOEXCEPT {
|
||||
static constexpr ENTT_ID_TYPE helper(ENTT_ID_TYPE partial, const char *curr) ENTT_NOEXCEPT {
|
||||
return curr[0] == 0 ? partial : helper((partial^curr[0])*traits_type::prime, curr+1);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
* @return The numeric representation of the string.
|
||||
*/
|
||||
template<std::size_t N>
|
||||
inline static constexpr hash_type to_value(const char (&str)[N]) ENTT_NOEXCEPT {
|
||||
static constexpr hash_type to_value(const char (&str)[N]) ENTT_NOEXCEPT {
|
||||
return helper(traits_type::offset, str);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
* @param wrapper Helps achieving the purpose by relying on overloading.
|
||||
* @return The numeric representation of the string.
|
||||
*/
|
||||
inline static hash_type to_value(const_wrapper wrapper) ENTT_NOEXCEPT {
|
||||
static hash_type to_value(const_wrapper wrapper) ENTT_NOEXCEPT {
|
||||
return helper(traits_type::offset, wrapper.str);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
* @param size Length of the string to hash.
|
||||
* @return The numeric representation of the string.
|
||||
*/
|
||||
inline static hash_type to_value(const char *str, std::size_t size) ENTT_NOEXCEPT {
|
||||
static hash_type to_value(const char *str, std::size_t size) ENTT_NOEXCEPT {
|
||||
ENTT_ID_TYPE partial{traits_type::offset};
|
||||
while(size--) { partial = (partial^(str++)[0])*traits_type::prime; }
|
||||
return partial;
|
||||
|
||||
@@ -151,12 +151,12 @@ struct basic_actor {
|
||||
* @brief Returns a reference to the underlying registry.
|
||||
* @return A reference to the underlying registry.
|
||||
*/
|
||||
inline const registry_type & backend() const ENTT_NOEXCEPT {
|
||||
const registry_type & backend() const ENTT_NOEXCEPT {
|
||||
return *reg;
|
||||
}
|
||||
|
||||
/*! @copydoc backend */
|
||||
inline registry_type & backend() ENTT_NOEXCEPT {
|
||||
registry_type & backend() ENTT_NOEXCEPT {
|
||||
return const_cast<registry_type &>(std::as_const(*this).backend());
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ struct basic_actor {
|
||||
* @brief Returns the entity associated with an actor.
|
||||
* @return The entity associated with the actor.
|
||||
*/
|
||||
inline entity_type entity() const ENTT_NOEXCEPT {
|
||||
entity_type entity() const ENTT_NOEXCEPT {
|
||||
return entt;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class basic_group<Entity, get_t<Get...>> {
|
||||
{}
|
||||
|
||||
template<typename Func, typename... Weak>
|
||||
inline void traverse(Func func, type_list<Weak...>) const {
|
||||
void traverse(Func func, type_list<Weak...>) const {
|
||||
for(const auto entt: *handler) {
|
||||
if constexpr(std::is_invocable_v<Func, decltype(get<Weak>({}))...>) {
|
||||
func(std::get<pool_type<Weak> *>(pools)->get(entt)...);
|
||||
@@ -336,7 +336,7 @@ public:
|
||||
* @param func A valid function object.
|
||||
*/
|
||||
template<typename Func>
|
||||
inline void each(Func func) const {
|
||||
void each(Func func) const {
|
||||
traverse(std::move(func), type_list<Get...>{});
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ public:
|
||||
* @param func A valid function object.
|
||||
*/
|
||||
template<typename Func>
|
||||
inline void less(Func func) const {
|
||||
void less(Func func) const {
|
||||
using non_empty_get = type_list_cat_t<std::conditional_t<std::is_empty_v<Get>, type_list<>, type_list<Get>>...>;
|
||||
traverse(std::move(func), non_empty_get{});
|
||||
}
|
||||
@@ -458,7 +458,7 @@ class basic_group<Entity, get_t<Get...>, Owned...> {
|
||||
{}
|
||||
|
||||
template<typename Func, typename... Strong, typename... Weak>
|
||||
inline void traverse(Func func, type_list<Strong...>, type_list<Weak...>) const {
|
||||
void traverse(Func func, type_list<Strong...>, type_list<Weak...>) const {
|
||||
auto raw = std::make_tuple((std::get<pool_type<Strong> *>(pools)->end() - *length)...);
|
||||
[[maybe_unused]] auto data = std::get<0>(pools)->sparse_set<entity_type>::end() - *length;
|
||||
|
||||
@@ -700,7 +700,7 @@ public:
|
||||
* @param func A valid function object.
|
||||
*/
|
||||
template<typename Func>
|
||||
inline void each(Func func) const {
|
||||
void each(Func func) const {
|
||||
traverse(std::move(func), type_list<Owned...>{}, type_list<Get...>{});
|
||||
}
|
||||
|
||||
@@ -725,7 +725,7 @@ public:
|
||||
* @param func A valid function object.
|
||||
*/
|
||||
template<typename Func>
|
||||
inline void less(Func func) const {
|
||||
void less(Func func) const {
|
||||
using non_empty_owned = type_list_cat_t<std::conditional_t<std::is_empty_v<Owned>, type_list<>, type_list<Owned>>...>;
|
||||
using non_empty_get = type_list_cat_t<std::conditional_t<std::is_empty_v<Get>, type_list<>, type_list<Get>>...>;
|
||||
traverse(std::move(func), non_empty_owned{}, non_empty_get{});
|
||||
|
||||
@@ -34,7 +34,7 @@ struct as_view {
|
||||
* @return A newly created view.
|
||||
*/
|
||||
template<typename... Component>
|
||||
inline operator entt::basic_view<Entity, Component...>() const {
|
||||
operator entt::basic_view<Entity, Component...>() const {
|
||||
return reg.template view<Component...>();
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ struct as_group {
|
||||
* @return A newly created group.
|
||||
*/
|
||||
template<typename... Owned>
|
||||
inline operator entt::basic_group<Entity, get_t<>, Owned...>() const {
|
||||
operator entt::basic_group<Entity, get_t<>, Owned...>() const {
|
||||
return reg.template group<Owned...>();
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ void dependency(basic_registry<Entity> ®, const Entity entt, const Component
|
||||
* @param sink A sink object properly initialized.
|
||||
*/
|
||||
template<typename... Dependency, typename Component, typename Entity>
|
||||
inline void connect(sink<void(basic_registry<Entity> &, const Entity, Component &)> sink) {
|
||||
void connect(sink<void(basic_registry<Entity> &, const Entity, Component &)> sink) {
|
||||
sink.template connect<dependency<Entity, Component, Dependency...>>();
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ inline void connect(sink<void(basic_registry<Entity> &, const Entity, Component
|
||||
* @param sink A sink object properly initialized.
|
||||
*/
|
||||
template<typename... Dependency, typename Component, typename Entity>
|
||||
inline void disconnect(sink<void(basic_registry<Entity> &, const Entity, Component &)> sink) {
|
||||
void disconnect(sink<void(basic_registry<Entity> &, const Entity, Component &)> sink) {
|
||||
sink.template disconnect<dependency<Entity, Component, Dependency...>>();
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
|
||||
/*! @copydoc get */
|
||||
template<typename... Component>
|
||||
inline decltype(auto) get() ENTT_NOEXCEPT {
|
||||
decltype(auto) get() ENTT_NOEXCEPT {
|
||||
if constexpr(sizeof...(Component) == 1) {
|
||||
return (const_cast<Component &>(std::as_const(*this).template get<Component>()), ...);
|
||||
} else {
|
||||
@@ -214,7 +214,7 @@ public:
|
||||
|
||||
/*! @copydoc try_get */
|
||||
template<typename... Component>
|
||||
inline auto try_get() ENTT_NOEXCEPT {
|
||||
auto try_get() ENTT_NOEXCEPT {
|
||||
if constexpr(sizeof...(Component) == 1) {
|
||||
return (const_cast<Component *>(std::as_const(*this).template try_get<Component>()), ...);
|
||||
} else {
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
*
|
||||
* @return A valid entity identifier.
|
||||
*/
|
||||
inline entity_type create() const {
|
||||
entity_type create() const {
|
||||
return create(*reg);
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ public:
|
||||
*
|
||||
* @param dst A valid entity identifier.
|
||||
*/
|
||||
inline void assign(const entity_type dst) const {
|
||||
void assign(const entity_type dst) const {
|
||||
assign(*reg, dst);
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ public:
|
||||
*
|
||||
* @param dst A valid entity identifier.
|
||||
*/
|
||||
inline void assign_or_replace(const entity_type dst) const {
|
||||
void assign_or_replace(const entity_type dst) const {
|
||||
assign_or_replace(*reg, dst);
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ public:
|
||||
* @param other A valid reference to a registry.
|
||||
* @param dst A valid entity identifier.
|
||||
*/
|
||||
inline void operator()(registry_type &other, const entity_type dst) const ENTT_NOEXCEPT {
|
||||
void operator()(registry_type &other, const entity_type dst) const ENTT_NOEXCEPT {
|
||||
assign(other, dst);
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ public:
|
||||
*
|
||||
* @param dst A valid entity identifier.
|
||||
*/
|
||||
inline void operator()(const entity_type dst) const ENTT_NOEXCEPT {
|
||||
void operator()(const entity_type dst) const ENTT_NOEXCEPT {
|
||||
assign(*reg, dst);
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ public:
|
||||
* @param other A valid reference to a registry.
|
||||
* @return A valid entity identifier.
|
||||
*/
|
||||
inline entity_type operator()(registry_type &other) const ENTT_NOEXCEPT {
|
||||
entity_type operator()(registry_type &other) const ENTT_NOEXCEPT {
|
||||
return create(other);
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ public:
|
||||
*
|
||||
* @return A valid entity identifier.
|
||||
*/
|
||||
inline entity_type operator()() const ENTT_NOEXCEPT {
|
||||
entity_type operator()() const ENTT_NOEXCEPT {
|
||||
return create(*reg);
|
||||
}
|
||||
|
||||
@@ -461,12 +461,12 @@ public:
|
||||
* @brief Returns a reference to the underlying registry.
|
||||
* @return A reference to the underlying registry.
|
||||
*/
|
||||
inline const registry_type & backend() const ENTT_NOEXCEPT {
|
||||
const registry_type & backend() const ENTT_NOEXCEPT {
|
||||
return *reg;
|
||||
}
|
||||
|
||||
/*! @copydoc backend */
|
||||
inline registry_type & backend() ENTT_NOEXCEPT {
|
||||
registry_type & backend() ENTT_NOEXCEPT {
|
||||
return const_cast<registry_type &>(std::as_const(*this).backend());
|
||||
}
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ class basic_registry {
|
||||
}
|
||||
|
||||
template<typename Component>
|
||||
inline const auto * pool() const ENTT_NOEXCEPT {
|
||||
const auto * pool() const ENTT_NOEXCEPT {
|
||||
const auto ctype = type<Component>();
|
||||
|
||||
if constexpr(is_named_type_v<Component>) {
|
||||
@@ -254,7 +254,7 @@ class basic_registry {
|
||||
}
|
||||
|
||||
template<typename Component>
|
||||
inline auto * pool() ENTT_NOEXCEPT {
|
||||
auto * pool() ENTT_NOEXCEPT {
|
||||
return const_cast<pool_type<Component> *>(std::as_const(*this).template pool<Component>());
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ public:
|
||||
* @return Runtime numeric identifier of the given type of component.
|
||||
*/
|
||||
template<typename Component>
|
||||
inline static component_type type() ENTT_NOEXCEPT {
|
||||
static component_type type() ENTT_NOEXCEPT {
|
||||
return runtime_type<Component, component_family>();
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ public:
|
||||
|
||||
/*! @copydoc raw */
|
||||
template<typename Component>
|
||||
inline Component * raw() ENTT_NOEXCEPT {
|
||||
Component * raw() ENTT_NOEXCEPT {
|
||||
return const_cast<Component *>(std::as_const(*this).template raw<Component>());
|
||||
}
|
||||
|
||||
@@ -779,7 +779,7 @@ public:
|
||||
|
||||
/*! @copydoc get */
|
||||
template<typename... Component>
|
||||
inline decltype(auto) get([[maybe_unused]] const entity_type entity) ENTT_NOEXCEPT {
|
||||
decltype(auto) get([[maybe_unused]] const entity_type entity) ENTT_NOEXCEPT {
|
||||
ENTT_ASSERT(valid(entity));
|
||||
|
||||
if constexpr(sizeof...(Component) == 1) {
|
||||
@@ -846,7 +846,7 @@ public:
|
||||
|
||||
/*! @copydoc try_get */
|
||||
template<typename... Component>
|
||||
inline auto try_get([[maybe_unused]] const entity_type entity) ENTT_NOEXCEPT {
|
||||
auto try_get([[maybe_unused]] const entity_type entity) ENTT_NOEXCEPT {
|
||||
if constexpr(sizeof...(Component) == 1) {
|
||||
return (const_cast<Component *>(std::as_const(*this).template try_get<Component>(entity)), ...);
|
||||
} else {
|
||||
@@ -1276,7 +1276,7 @@ public:
|
||||
|
||||
/*! @copydoc view */
|
||||
template<typename... Component>
|
||||
inline entt::basic_view<Entity, Component...> view() const {
|
||||
entt::basic_view<Entity, Component...> view() const {
|
||||
static_assert(std::conjunction_v<std::is_const<Component>...>);
|
||||
return const_cast<basic_registry *>(this)->view<Component...>();
|
||||
}
|
||||
@@ -1320,7 +1320,7 @@ public:
|
||||
* @return A newly created group.
|
||||
*/
|
||||
template<typename... Owned, typename... Get, typename... Exclude>
|
||||
inline entt::basic_group<Entity, get_t<Get...>, Owned...> group(get_t<Get...>, exclude_t<Exclude...> = {}) {
|
||||
entt::basic_group<Entity, get_t<Get...>, Owned...> group(get_t<Get...>, exclude_t<Exclude...> = {}) {
|
||||
static_assert(sizeof...(Owned) + sizeof...(Get) > 0);
|
||||
static_assert(sizeof...(Owned) + sizeof...(Get) + sizeof...(Exclude) > 1);
|
||||
|
||||
@@ -1395,20 +1395,20 @@ public:
|
||||
|
||||
/*! @copydoc group */
|
||||
template<typename... Owned, typename... Get, typename... Exclude>
|
||||
inline entt::basic_group<Entity, get_t<Get...>, Owned...> group(get_t<Get...>, exclude_t<Exclude...> = {}) const {
|
||||
entt::basic_group<Entity, get_t<Get...>, Owned...> group(get_t<Get...>, exclude_t<Exclude...> = {}) const {
|
||||
static_assert(std::conjunction_v<std::is_const<Owned>..., std::is_const<Get>...>);
|
||||
return const_cast<basic_registry *>(this)->group<Owned...>(entt::get<Get...>, exclude<Exclude...>);
|
||||
}
|
||||
|
||||
/*! @copydoc group */
|
||||
template<typename... Owned, typename... Exclude>
|
||||
inline entt::basic_group<Entity, get_t<>, Owned...> group(exclude_t<Exclude...> = {}) {
|
||||
entt::basic_group<Entity, get_t<>, Owned...> group(exclude_t<Exclude...> = {}) {
|
||||
return group<Owned...>(entt::get<>, exclude<Exclude...>);
|
||||
}
|
||||
|
||||
/*! @copydoc group */
|
||||
template<typename... Owned, typename... Exclude>
|
||||
inline entt::basic_group<Entity, get_t<>, Owned...> group(exclude_t<Exclude...> = {}) const {
|
||||
entt::basic_group<Entity, get_t<>, Owned...> group(exclude_t<Exclude...> = {}) const {
|
||||
static_assert(std::conjunction_v<std::is_const<Owned>...>);
|
||||
return const_cast<basic_registry *>(this)->group<Owned...>(exclude<Exclude...>);
|
||||
}
|
||||
@@ -1653,7 +1653,7 @@ public:
|
||||
|
||||
/*! @copydoc try_ctx */
|
||||
template<typename Type>
|
||||
inline Type * try_ctx() ENTT_NOEXCEPT {
|
||||
Type * try_ctx() ENTT_NOEXCEPT {
|
||||
return const_cast<Type *>(std::as_const(*this).template try_ctx<Type>());
|
||||
}
|
||||
|
||||
@@ -1678,7 +1678,7 @@ public:
|
||||
|
||||
/*! @copydoc ctx */
|
||||
template<typename Type>
|
||||
inline Type & ctx() ENTT_NOEXCEPT {
|
||||
Type & ctx() ENTT_NOEXCEPT {
|
||||
return const_cast<Type &>(std::as_const(*this).template ctx<Type>());
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ class basic_runtime_view {
|
||||
return other.begin == begin;
|
||||
}
|
||||
|
||||
inline bool operator!=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
bool operator!=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ class basic_runtime_view {
|
||||
return begin.operator->();
|
||||
}
|
||||
|
||||
inline reference operator*() const ENTT_NOEXCEPT {
|
||||
reference operator*() const ENTT_NOEXCEPT {
|
||||
return *operator->();
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ class basic_runtime_view {
|
||||
return extent;
|
||||
}
|
||||
|
||||
inline bool valid() const ENTT_NOEXCEPT {
|
||||
bool valid() const ENTT_NOEXCEPT {
|
||||
return !pools.empty() && pools.front();
|
||||
}
|
||||
|
||||
|
||||
@@ -95,11 +95,11 @@ class sparse_set {
|
||||
return iterator{direct, index-value};
|
||||
}
|
||||
|
||||
inline iterator & operator-=(const difference_type value) ENTT_NOEXCEPT {
|
||||
iterator & operator-=(const difference_type value) ENTT_NOEXCEPT {
|
||||
return (*this += -value);
|
||||
}
|
||||
|
||||
inline iterator operator-(const difference_type value) const ENTT_NOEXCEPT {
|
||||
iterator operator-(const difference_type value) const ENTT_NOEXCEPT {
|
||||
return (*this + -value);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ class sparse_set {
|
||||
return other.index == index;
|
||||
}
|
||||
|
||||
inline bool operator!=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
bool operator!=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
@@ -128,11 +128,11 @@ class sparse_set {
|
||||
return index < other.index;
|
||||
}
|
||||
|
||||
inline bool operator<=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
bool operator<=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
return !(*this > other);
|
||||
}
|
||||
|
||||
inline bool operator>=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
bool operator>=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
return !(*this < other);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ class sparse_set {
|
||||
return &(*direct)[pos];
|
||||
}
|
||||
|
||||
inline reference operator*() const ENTT_NOEXCEPT {
|
||||
reference operator*() const ENTT_NOEXCEPT {
|
||||
return *operator->();
|
||||
}
|
||||
|
||||
|
||||
@@ -98,11 +98,11 @@ class basic_storage: public sparse_set<Entity> {
|
||||
return iterator{instances, index-value};
|
||||
}
|
||||
|
||||
inline iterator & operator-=(const difference_type value) ENTT_NOEXCEPT {
|
||||
iterator & operator-=(const difference_type value) ENTT_NOEXCEPT {
|
||||
return (*this += -value);
|
||||
}
|
||||
|
||||
inline iterator operator-(const difference_type value) const ENTT_NOEXCEPT {
|
||||
iterator operator-(const difference_type value) const ENTT_NOEXCEPT {
|
||||
return (*this + -value);
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ class basic_storage: public sparse_set<Entity> {
|
||||
return other.index == index;
|
||||
}
|
||||
|
||||
inline bool operator!=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
bool operator!=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
@@ -131,11 +131,11 @@ class basic_storage: public sparse_set<Entity> {
|
||||
return index < other.index;
|
||||
}
|
||||
|
||||
inline bool operator<=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
bool operator<=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
return !(*this > other);
|
||||
}
|
||||
|
||||
inline bool operator>=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
bool operator>=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
return !(*this < other);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ class basic_storage: public sparse_set<Entity> {
|
||||
return &(*instances)[pos];
|
||||
}
|
||||
|
||||
inline reference operator*() const ENTT_NOEXCEPT {
|
||||
reference operator*() const ENTT_NOEXCEPT {
|
||||
return *operator->();
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ public:
|
||||
}
|
||||
|
||||
/*! @copydoc cbegin */
|
||||
inline const_iterator_type begin() const ENTT_NOEXCEPT {
|
||||
const_iterator_type begin() const ENTT_NOEXCEPT {
|
||||
return cbegin();
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ public:
|
||||
}
|
||||
|
||||
/*! @copydoc cend */
|
||||
inline const_iterator_type end() const ENTT_NOEXCEPT {
|
||||
const_iterator_type end() const ENTT_NOEXCEPT {
|
||||
return cend();
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ public:
|
||||
}
|
||||
|
||||
/*! @copydoc get */
|
||||
inline object_type & get(const entity_type entt) ENTT_NOEXCEPT {
|
||||
object_type & get(const entity_type entt) ENTT_NOEXCEPT {
|
||||
return const_cast<object_type &>(std::as_const(*this).get(entt));
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ public:
|
||||
}
|
||||
|
||||
/*! @copydoc try_get */
|
||||
inline object_type * try_get(const entity_type entt) ENTT_NOEXCEPT {
|
||||
object_type * try_get(const entity_type entt) ENTT_NOEXCEPT {
|
||||
return const_cast<object_type *>(std::as_const(*this).try_get(entt));
|
||||
}
|
||||
|
||||
@@ -577,11 +577,11 @@ class basic_storage<Entity, Type, std::enable_if_t<std::is_empty_v<Type>>>: publ
|
||||
return iterator{index-value};
|
||||
}
|
||||
|
||||
inline iterator & operator-=(const difference_type value) ENTT_NOEXCEPT {
|
||||
iterator & operator-=(const difference_type value) ENTT_NOEXCEPT {
|
||||
return (*this += -value);
|
||||
}
|
||||
|
||||
inline iterator operator-(const difference_type value) const ENTT_NOEXCEPT {
|
||||
iterator operator-(const difference_type value) const ENTT_NOEXCEPT {
|
||||
return (*this + -value);
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ class basic_storage<Entity, Type, std::enable_if_t<std::is_empty_v<Type>>>: publ
|
||||
return other.index == index;
|
||||
}
|
||||
|
||||
inline bool operator!=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
bool operator!=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
@@ -609,11 +609,11 @@ class basic_storage<Entity, Type, std::enable_if_t<std::is_empty_v<Type>>>: publ
|
||||
return index < other.index;
|
||||
}
|
||||
|
||||
inline bool operator<=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
bool operator<=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
return !(*this > other);
|
||||
}
|
||||
|
||||
inline bool operator>=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
bool operator>=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
return !(*this < other);
|
||||
}
|
||||
|
||||
@@ -621,7 +621,7 @@ class basic_storage<Entity, Type, std::enable_if_t<std::is_empty_v<Type>>>: publ
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline reference operator*() const ENTT_NOEXCEPT {
|
||||
reference operator*() const ENTT_NOEXCEPT {
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -657,7 +657,7 @@ public:
|
||||
}
|
||||
|
||||
/*! @copydoc cbegin */
|
||||
inline iterator_type begin() const ENTT_NOEXCEPT {
|
||||
iterator_type begin() const ENTT_NOEXCEPT {
|
||||
return cbegin();
|
||||
}
|
||||
|
||||
@@ -680,7 +680,7 @@ public:
|
||||
}
|
||||
|
||||
/*! @copydoc cend */
|
||||
inline iterator_type end() const ENTT_NOEXCEPT {
|
||||
iterator_type end() const ENTT_NOEXCEPT {
|
||||
return cend();
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ class basic_view {
|
||||
return other.begin == begin;
|
||||
}
|
||||
|
||||
inline bool operator!=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
bool operator!=(const iterator &other) const ENTT_NOEXCEPT {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class basic_view {
|
||||
return begin.operator->();
|
||||
}
|
||||
|
||||
inline reference operator*() const ENTT_NOEXCEPT {
|
||||
reference operator*() const ENTT_NOEXCEPT {
|
||||
return *operator->();
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ class basic_view {
|
||||
}
|
||||
|
||||
template<typename Comp, typename Other>
|
||||
inline decltype(auto) get([[maybe_unused]] component_iterator_type<Comp> it, [[maybe_unused]] pool_type<Other> *cpool, [[maybe_unused]] const Entity entt) const ENTT_NOEXCEPT {
|
||||
decltype(auto) get([[maybe_unused]] component_iterator_type<Comp> it, [[maybe_unused]] pool_type<Other> *cpool, [[maybe_unused]] const Entity entt) const ENTT_NOEXCEPT {
|
||||
if constexpr(std::is_same_v<Comp, Other>) {
|
||||
return *it;
|
||||
} else {
|
||||
@@ -395,7 +395,7 @@ public:
|
||||
* @param func A valid function object.
|
||||
*/
|
||||
template<typename Func>
|
||||
inline void each(Func func) const {
|
||||
void each(Func func) const {
|
||||
const auto *view = candidate();
|
||||
((std::get<pool_type<Component> *>(pools) == view ? each<Component>(std::move(func)) : void()), ...);
|
||||
}
|
||||
@@ -431,7 +431,7 @@ public:
|
||||
* @param func A valid function object.
|
||||
*/
|
||||
template<typename Comp, typename Func>
|
||||
inline void each(Func func) const {
|
||||
void each(Func func) const {
|
||||
using other_type = type_list_cat_t<std::conditional_t<std::is_same_v<Comp, Component>, type_list<>, type_list<Component>>...>;
|
||||
traverse<Comp>(std::move(func), other_type{}, type_list<Component...>{});
|
||||
}
|
||||
@@ -457,7 +457,7 @@ public:
|
||||
* @param func A valid function object.
|
||||
*/
|
||||
template<typename Func>
|
||||
inline void less(Func func) const {
|
||||
void less(Func func) const {
|
||||
const auto *view = candidate();
|
||||
((std::get<pool_type<Component> *>(pools) == view ? less<Component>(std::move(func)) : void()), ...);
|
||||
}
|
||||
@@ -490,7 +490,7 @@ public:
|
||||
* @param func A valid function object.
|
||||
*/
|
||||
template<typename Comp, typename Func>
|
||||
inline void less(Func func) const {
|
||||
void less(Func func) const {
|
||||
using other_type = type_list_cat_t<std::conditional_t<std::is_same_v<Comp, Component>, type_list<>, type_list<Component>>...>;
|
||||
using non_empty_type = type_list_cat_t<std::conditional_t<std::is_empty_v<Component>, type_list<>, type_list<Component>>...>;
|
||||
traverse<Comp>(std::move(func), other_type{}, non_empty_type{});
|
||||
@@ -713,7 +713,7 @@ public:
|
||||
* @param func A valid function object.
|
||||
*/
|
||||
template<typename Func>
|
||||
inline void each(Func func) const {
|
||||
void each(Func func) const {
|
||||
if constexpr(std::is_invocable_v<Func, decltype(get({}))>) {
|
||||
std::for_each(pool->begin(), pool->end(), std::move(func));
|
||||
} else {
|
||||
@@ -752,7 +752,7 @@ public:
|
||||
* @param func A valid function object.
|
||||
*/
|
||||
template<typename Func>
|
||||
inline void less(Func func) const {
|
||||
void less(Func func) const {
|
||||
if constexpr(std::is_empty_v<Component>) {
|
||||
if constexpr(std::is_invocable_v<Func>) {
|
||||
for(auto pos = pool->size(); pos; --pos) {
|
||||
|
||||
@@ -35,7 +35,7 @@ struct service_locator {
|
||||
* @brief Tests if a valid service implementation is set.
|
||||
* @return True if the service is set, false otherwise.
|
||||
*/
|
||||
inline static bool empty() ENTT_NOEXCEPT {
|
||||
static bool empty() ENTT_NOEXCEPT {
|
||||
return !static_cast<bool>(service);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ struct service_locator {
|
||||
*
|
||||
* @return A reference to the service implementation currently set, if any.
|
||||
*/
|
||||
inline static std::weak_ptr<Service> get() ENTT_NOEXCEPT {
|
||||
static std::weak_ptr<Service> get() ENTT_NOEXCEPT {
|
||||
return service;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ struct service_locator {
|
||||
*
|
||||
* @return A reference to the service implementation currently set, if any.
|
||||
*/
|
||||
inline static Service & ref() ENTT_NOEXCEPT {
|
||||
static Service & ref() ENTT_NOEXCEPT {
|
||||
return *service;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ struct service_locator {
|
||||
* @param args Parameters to use to construct the service.
|
||||
*/
|
||||
template<typename Impl = Service, typename... Args>
|
||||
inline static void set(Args &&... args) {
|
||||
static void set(Args &&... args) {
|
||||
service = std::make_shared<Impl>(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ struct service_locator {
|
||||
* @brief Sets or replaces a service.
|
||||
* @param ptr Service to use to replace the current one.
|
||||
*/
|
||||
inline static void set(std::shared_ptr<Service> ptr) {
|
||||
static void set(std::shared_ptr<Service> ptr) {
|
||||
ENTT_ASSERT(static_cast<bool>(ptr));
|
||||
service = std::move(ptr);
|
||||
}
|
||||
@@ -96,7 +96,7 @@ struct service_locator {
|
||||
*
|
||||
* The service is no longer valid after a reset.
|
||||
*/
|
||||
inline static void reset() {
|
||||
static void reset() {
|
||||
service.reset();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ class meta_factory {
|
||||
static_assert(std::is_object_v<Type> && !(std::is_const_v<Type> || std::is_volatile_v<Type>));
|
||||
|
||||
template<typename Node>
|
||||
inline bool duplicate(const hashed_string &name, const Node *node) ENTT_NOEXCEPT {
|
||||
bool duplicate(const hashed_string &name, const Node *node) ENTT_NOEXCEPT {
|
||||
return node ? node->name == name || duplicate(name, node->next) : false;
|
||||
}
|
||||
|
||||
inline bool duplicate(const meta_any &key, const internal::meta_prop_node *node) ENTT_NOEXCEPT {
|
||||
bool duplicate(const meta_any &key, const internal::meta_prop_node *node) ENTT_NOEXCEPT {
|
||||
return node ? node->key() == key || duplicate(key, node->next) : false;
|
||||
}
|
||||
|
||||
@@ -674,7 +674,7 @@ inline meta_type resolve(const char *str) ENTT_NOEXCEPT {
|
||||
* @param op A valid function object.
|
||||
*/
|
||||
template<typename Op>
|
||||
void resolve(Op op) ENTT_NOEXCEPT {
|
||||
inline void resolve(Op op) ENTT_NOEXCEPT {
|
||||
internal::iterate([op = std::move(op)](auto *node) {
|
||||
op(node->meta());
|
||||
}, internal::meta_info<>::type);
|
||||
|
||||
@@ -142,12 +142,12 @@ struct meta_type_node {
|
||||
meta_type(* const remove_pointer)();
|
||||
bool(* const destroy)(meta_handle);
|
||||
meta_type(* const meta)();
|
||||
meta_base_node *base;
|
||||
meta_conv_node *conv;
|
||||
meta_ctor_node *ctor;
|
||||
meta_dtor_node *dtor;
|
||||
meta_data_node *data;
|
||||
meta_func_node *func;
|
||||
meta_base_node *base{nullptr};
|
||||
meta_conv_node *conv{nullptr};
|
||||
meta_ctor_node *ctor{nullptr};
|
||||
meta_dtor_node *dtor{nullptr};
|
||||
meta_data_node *data{nullptr};
|
||||
meta_func_node *func{nullptr};
|
||||
};
|
||||
|
||||
|
||||
@@ -309,13 +309,13 @@ class meta_any {
|
||||
using destroy_fn_type = void(*)(storage_type &);
|
||||
|
||||
template<typename Type>
|
||||
inline static auto compare(int, const Type &lhs, const Type &rhs)
|
||||
static auto compare(int, const Type &lhs, const Type &rhs)
|
||||
-> decltype(lhs == rhs, bool{}) {
|
||||
return lhs == rhs;
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
inline static bool compare(char, const Type &lhs, const Type &rhs) {
|
||||
static bool compare(char, const Type &lhs, const Type &rhs) {
|
||||
return &lhs == &rhs;
|
||||
}
|
||||
|
||||
@@ -459,12 +459,12 @@ public:
|
||||
* @brief Returns an opaque pointer to the contained instance.
|
||||
* @return An opaque pointer the contained instance, if any.
|
||||
*/
|
||||
inline const void * data() const ENTT_NOEXCEPT {
|
||||
const void * data() const ENTT_NOEXCEPT {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/*! @copydoc data */
|
||||
inline void * data() ENTT_NOEXCEPT {
|
||||
void * data() ENTT_NOEXCEPT {
|
||||
return const_cast<void *>(std::as_const(*this).data());
|
||||
}
|
||||
|
||||
@@ -474,7 +474,7 @@ public:
|
||||
* @return True if the cast is viable, false otherwise.
|
||||
*/
|
||||
template<typename Type>
|
||||
inline bool can_cast() const ENTT_NOEXCEPT {
|
||||
bool can_cast() const ENTT_NOEXCEPT {
|
||||
const auto *type = internal::meta_info<Type>::resolve();
|
||||
return internal::can_cast_or_convert<&internal::meta_type_node::base>(node, type);
|
||||
}
|
||||
@@ -494,14 +494,14 @@ public:
|
||||
* @return A reference to the contained instance.
|
||||
*/
|
||||
template<typename Type>
|
||||
inline const Type & cast() const ENTT_NOEXCEPT {
|
||||
const Type & cast() const ENTT_NOEXCEPT {
|
||||
ENTT_ASSERT(can_cast<Type>());
|
||||
return *internal::try_cast<Type>(node, instance);
|
||||
}
|
||||
|
||||
/*! @copydoc cast */
|
||||
template<typename Type>
|
||||
inline Type & cast() ENTT_NOEXCEPT {
|
||||
Type & cast() ENTT_NOEXCEPT {
|
||||
return const_cast<Type &>(std::as_const(*this).cast<Type>());
|
||||
}
|
||||
|
||||
@@ -511,7 +511,7 @@ public:
|
||||
* @return True if the conversion is viable, false otherwise.
|
||||
*/
|
||||
template<typename Type>
|
||||
inline bool can_convert() const ENTT_NOEXCEPT {
|
||||
bool can_convert() const ENTT_NOEXCEPT {
|
||||
const auto *type = internal::meta_info<Type>::resolve();
|
||||
return internal::can_cast_or_convert<&internal::meta_type_node::conv>(node, type);
|
||||
}
|
||||
@@ -523,7 +523,7 @@ public:
|
||||
* one otherwise.
|
||||
*/
|
||||
template<typename Type>
|
||||
inline meta_any convert() const ENTT_NOEXCEPT {
|
||||
meta_any convert() const ENTT_NOEXCEPT {
|
||||
const auto *type = internal::meta_info<Type>::resolve();
|
||||
meta_any any{};
|
||||
|
||||
@@ -548,7 +548,7 @@ public:
|
||||
* @return True if the conversion is possible, false otherwise.
|
||||
*/
|
||||
template<typename Type>
|
||||
inline bool convert() ENTT_NOEXCEPT {
|
||||
bool convert() ENTT_NOEXCEPT {
|
||||
bool valid = (node == internal::meta_info<Type>::resolve());
|
||||
|
||||
if(!valid) {
|
||||
@@ -567,7 +567,7 @@ public:
|
||||
* @brief Returns false if a container is empty, true otherwise.
|
||||
* @return False if the container is empty, true otherwise.
|
||||
*/
|
||||
inline explicit operator bool() const ENTT_NOEXCEPT {
|
||||
explicit operator bool() const ENTT_NOEXCEPT {
|
||||
return destroy_fn;
|
||||
}
|
||||
|
||||
@@ -577,7 +577,7 @@ public:
|
||||
* @return False if the two containers differ in their content, true
|
||||
* otherwise.
|
||||
*/
|
||||
inline bool operator==(const meta_any &other) const ENTT_NOEXCEPT {
|
||||
bool operator==(const meta_any &other) const ENTT_NOEXCEPT {
|
||||
return (!instance && !other.instance) || (instance && other.instance && node == other.node && compare_fn(instance, other.instance));
|
||||
}
|
||||
|
||||
@@ -683,13 +683,13 @@ public:
|
||||
* @return A pointer to the contained instance.
|
||||
*/
|
||||
template<typename Type>
|
||||
inline const Type * try_cast() const ENTT_NOEXCEPT {
|
||||
const Type * try_cast() const ENTT_NOEXCEPT {
|
||||
return internal::try_cast<Type>(node, instance);
|
||||
}
|
||||
|
||||
/*! @copydoc try_cast */
|
||||
template<typename Type>
|
||||
inline Type * try_cast() ENTT_NOEXCEPT {
|
||||
Type * try_cast() ENTT_NOEXCEPT {
|
||||
return const_cast<Type *>(std::as_const(*this).try_cast<Type>());
|
||||
}
|
||||
|
||||
@@ -697,12 +697,12 @@ public:
|
||||
* @brief Returns an opaque pointer to the contained instance.
|
||||
* @return An opaque pointer the contained instance, if any.
|
||||
*/
|
||||
inline const void * data() const ENTT_NOEXCEPT {
|
||||
const void * data() const ENTT_NOEXCEPT {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/*! @copydoc data */
|
||||
inline void * data() ENTT_NOEXCEPT {
|
||||
void * data() ENTT_NOEXCEPT {
|
||||
return const_cast<void *>(std::as_const(*this).data());
|
||||
}
|
||||
|
||||
@@ -710,7 +710,7 @@ public:
|
||||
* @brief Returns false if a handle is empty, true otherwise.
|
||||
* @return False if the handle is empty, true otherwise.
|
||||
*/
|
||||
inline explicit operator bool() const ENTT_NOEXCEPT {
|
||||
explicit operator bool() const ENTT_NOEXCEPT {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -741,13 +741,13 @@ class meta_prop {
|
||||
/*! @brief A meta factory is allowed to create meta objects. */
|
||||
template<typename> friend class meta_factory;
|
||||
|
||||
inline meta_prop(const internal::meta_prop_node *curr) ENTT_NOEXCEPT
|
||||
meta_prop(const internal::meta_prop_node *curr) ENTT_NOEXCEPT
|
||||
: node{curr}
|
||||
{}
|
||||
|
||||
public:
|
||||
/*! @brief Default constructor. */
|
||||
inline meta_prop() ENTT_NOEXCEPT
|
||||
meta_prop() ENTT_NOEXCEPT
|
||||
: node{nullptr}
|
||||
{}
|
||||
|
||||
@@ -755,7 +755,7 @@ public:
|
||||
* @brief Returns the stored key.
|
||||
* @return A meta any containing the key stored with the given property.
|
||||
*/
|
||||
inline meta_any key() const ENTT_NOEXCEPT {
|
||||
meta_any key() const ENTT_NOEXCEPT {
|
||||
return node->key();
|
||||
}
|
||||
|
||||
@@ -763,7 +763,7 @@ public:
|
||||
* @brief Returns the stored value.
|
||||
* @return A meta any containing the value stored with the given property.
|
||||
*/
|
||||
inline meta_any value() const ENTT_NOEXCEPT {
|
||||
meta_any value() const ENTT_NOEXCEPT {
|
||||
return node->value();
|
||||
}
|
||||
|
||||
@@ -771,7 +771,7 @@ public:
|
||||
* @brief Returns true if a meta object is valid, false otherwise.
|
||||
* @return True if the meta object is valid, false otherwise.
|
||||
*/
|
||||
inline explicit operator bool() const ENTT_NOEXCEPT {
|
||||
explicit operator bool() const ENTT_NOEXCEPT {
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -781,7 +781,7 @@ public:
|
||||
* @return True if the two meta objects refer to the same node, false
|
||||
* otherwise.
|
||||
*/
|
||||
inline bool operator==(const meta_prop &other) const ENTT_NOEXCEPT {
|
||||
bool operator==(const meta_prop &other) const ENTT_NOEXCEPT {
|
||||
return node == other.node;
|
||||
}
|
||||
|
||||
@@ -811,13 +811,13 @@ class meta_base {
|
||||
/*! @brief A meta factory is allowed to create meta objects. */
|
||||
template<typename> friend class meta_factory;
|
||||
|
||||
inline meta_base(const internal::meta_base_node *curr) ENTT_NOEXCEPT
|
||||
meta_base(const internal::meta_base_node *curr) ENTT_NOEXCEPT
|
||||
: node{curr}
|
||||
{}
|
||||
|
||||
public:
|
||||
/*! @brief Default constructor. */
|
||||
inline meta_base() ENTT_NOEXCEPT
|
||||
meta_base() ENTT_NOEXCEPT
|
||||
: node{nullptr}
|
||||
{}
|
||||
|
||||
@@ -838,7 +838,7 @@ public:
|
||||
* @param instance The instance to cast.
|
||||
* @return An opaque pointer to the base type.
|
||||
*/
|
||||
inline void * cast(void *instance) const ENTT_NOEXCEPT {
|
||||
void * cast(void *instance) const ENTT_NOEXCEPT {
|
||||
return node->cast(instance);
|
||||
}
|
||||
|
||||
@@ -846,7 +846,7 @@ public:
|
||||
* @brief Returns true if a meta object is valid, false otherwise.
|
||||
* @return True if the meta object is valid, false otherwise.
|
||||
*/
|
||||
inline explicit operator bool() const ENTT_NOEXCEPT {
|
||||
explicit operator bool() const ENTT_NOEXCEPT {
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -856,7 +856,7 @@ public:
|
||||
* @return True if the two meta objects refer to the same node, false
|
||||
* otherwise.
|
||||
*/
|
||||
inline bool operator==(const meta_base &other) const ENTT_NOEXCEPT {
|
||||
bool operator==(const meta_base &other) const ENTT_NOEXCEPT {
|
||||
return node == other.node;
|
||||
}
|
||||
|
||||
@@ -886,13 +886,13 @@ class meta_conv {
|
||||
/*! @brief A meta factory is allowed to create meta objects. */
|
||||
template<typename> friend class meta_factory;
|
||||
|
||||
inline meta_conv(const internal::meta_conv_node *curr) ENTT_NOEXCEPT
|
||||
meta_conv(const internal::meta_conv_node *curr) ENTT_NOEXCEPT
|
||||
: node{curr}
|
||||
{}
|
||||
|
||||
public:
|
||||
/*! @brief Default constructor. */
|
||||
inline meta_conv() ENTT_NOEXCEPT
|
||||
meta_conv() ENTT_NOEXCEPT
|
||||
: node{nullptr}
|
||||
{}
|
||||
|
||||
@@ -913,7 +913,7 @@ public:
|
||||
* @param instance The instance to convert.
|
||||
* @return An opaque pointer to the instance to convert.
|
||||
*/
|
||||
inline meta_any convert(void *instance) const ENTT_NOEXCEPT {
|
||||
meta_any convert(void *instance) const ENTT_NOEXCEPT {
|
||||
return node->conv(instance);
|
||||
}
|
||||
|
||||
@@ -921,7 +921,7 @@ public:
|
||||
* @brief Returns true if a meta object is valid, false otherwise.
|
||||
* @return True if the meta object is valid, false otherwise.
|
||||
*/
|
||||
inline explicit operator bool() const ENTT_NOEXCEPT {
|
||||
explicit operator bool() const ENTT_NOEXCEPT {
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -931,7 +931,7 @@ public:
|
||||
* @return True if the two meta objects refer to the same node, false
|
||||
* otherwise.
|
||||
*/
|
||||
inline bool operator==(const meta_conv &other) const ENTT_NOEXCEPT {
|
||||
bool operator==(const meta_conv &other) const ENTT_NOEXCEPT {
|
||||
return node == other.node;
|
||||
}
|
||||
|
||||
@@ -961,7 +961,7 @@ class meta_ctor {
|
||||
/*! @brief A meta factory is allowed to create meta objects. */
|
||||
template<typename> friend class meta_factory;
|
||||
|
||||
inline meta_ctor(const internal::meta_ctor_node *curr) ENTT_NOEXCEPT
|
||||
meta_ctor(const internal::meta_ctor_node *curr) ENTT_NOEXCEPT
|
||||
: node{curr}
|
||||
{}
|
||||
|
||||
@@ -970,7 +970,7 @@ public:
|
||||
using size_type = typename internal::meta_ctor_node::size_type;
|
||||
|
||||
/*! @brief Default constructor. */
|
||||
inline meta_ctor() ENTT_NOEXCEPT
|
||||
meta_ctor() ENTT_NOEXCEPT
|
||||
: node{nullptr}
|
||||
{}
|
||||
|
||||
@@ -984,7 +984,7 @@ public:
|
||||
* @brief Returns the number of arguments accepted by a meta constructor.
|
||||
* @return The number of arguments accepted by the meta constructor.
|
||||
*/
|
||||
inline size_type size() const ENTT_NOEXCEPT {
|
||||
size_type size() const ENTT_NOEXCEPT {
|
||||
return node->size;
|
||||
}
|
||||
|
||||
@@ -993,7 +993,7 @@ public:
|
||||
* @param index The index of the argument of which to return the meta type.
|
||||
* @return The meta type of the i-th argument of a meta constructor, if any.
|
||||
*/
|
||||
inline meta_type arg(size_type index) const ENTT_NOEXCEPT;
|
||||
meta_type arg(size_type index) const ENTT_NOEXCEPT;
|
||||
|
||||
/**
|
||||
* @brief Creates an instance of the underlying type, if possible.
|
||||
@@ -1024,7 +1024,7 @@ public:
|
||||
* @param op A valid function object.
|
||||
*/
|
||||
template<typename Op>
|
||||
inline std::enable_if_t<std::is_invocable_v<Op, meta_prop>, void>
|
||||
std::enable_if_t<std::is_invocable_v<Op, meta_prop>, void>
|
||||
prop(Op op) const ENTT_NOEXCEPT {
|
||||
internal::iterate([op = std::move(op)](auto *curr) {
|
||||
op(curr->meta());
|
||||
@@ -1038,7 +1038,7 @@ public:
|
||||
* @return The property associated with the given key, if any.
|
||||
*/
|
||||
template<typename Key>
|
||||
inline std::enable_if_t<!std::is_invocable_v<Key, meta_prop>, meta_prop>
|
||||
std::enable_if_t<!std::is_invocable_v<Key, meta_prop>, meta_prop>
|
||||
prop(Key &&key) const ENTT_NOEXCEPT {
|
||||
const auto *curr = internal::find_if([key = meta_any{std::forward<Key>(key)}](auto *candidate) {
|
||||
return candidate->key() == key;
|
||||
@@ -1051,7 +1051,7 @@ public:
|
||||
* @brief Returns true if a meta object is valid, false otherwise.
|
||||
* @return True if the meta object is valid, false otherwise.
|
||||
*/
|
||||
inline explicit operator bool() const ENTT_NOEXCEPT {
|
||||
explicit operator bool() const ENTT_NOEXCEPT {
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1061,7 +1061,7 @@ public:
|
||||
* @return True if the two meta objects refer to the same node, false
|
||||
* otherwise.
|
||||
*/
|
||||
inline bool operator==(const meta_ctor &other) const ENTT_NOEXCEPT {
|
||||
bool operator==(const meta_ctor &other) const ENTT_NOEXCEPT {
|
||||
return node == other.node;
|
||||
}
|
||||
|
||||
@@ -1091,13 +1091,13 @@ class meta_dtor {
|
||||
/*! @brief A meta factory is allowed to create meta objects. */
|
||||
template<typename> friend class meta_factory;
|
||||
|
||||
inline meta_dtor(const internal::meta_dtor_node *curr) ENTT_NOEXCEPT
|
||||
meta_dtor(const internal::meta_dtor_node *curr) ENTT_NOEXCEPT
|
||||
: node{curr}
|
||||
{}
|
||||
|
||||
public:
|
||||
/*! @brief Default constructor. */
|
||||
inline meta_dtor() ENTT_NOEXCEPT
|
||||
meta_dtor() ENTT_NOEXCEPT
|
||||
: node{nullptr}
|
||||
{}
|
||||
|
||||
@@ -1117,7 +1117,7 @@ public:
|
||||
* @param handle An opaque pointer to an instance of the underlying type.
|
||||
* @return True in case of success, false otherwise.
|
||||
*/
|
||||
inline bool invoke(meta_handle handle) const {
|
||||
bool invoke(meta_handle handle) const {
|
||||
return node->invoke(handle);
|
||||
}
|
||||
|
||||
@@ -1125,7 +1125,7 @@ public:
|
||||
* @brief Returns true if a meta object is valid, false otherwise.
|
||||
* @return True if the meta object is valid, false otherwise.
|
||||
*/
|
||||
inline explicit operator bool() const ENTT_NOEXCEPT {
|
||||
explicit operator bool() const ENTT_NOEXCEPT {
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1135,7 +1135,7 @@ public:
|
||||
* @return True if the two meta objects refer to the same node, false
|
||||
* otherwise.
|
||||
*/
|
||||
inline bool operator==(const meta_dtor &other) const ENTT_NOEXCEPT {
|
||||
bool operator==(const meta_dtor &other) const ENTT_NOEXCEPT {
|
||||
return node == other.node;
|
||||
}
|
||||
|
||||
@@ -1165,13 +1165,13 @@ class meta_data {
|
||||
/*! @brief A meta factory is allowed to create meta objects. */
|
||||
template<typename> friend class meta_factory;
|
||||
|
||||
inline meta_data(const internal::meta_data_node *curr) ENTT_NOEXCEPT
|
||||
meta_data(const internal::meta_data_node *curr) ENTT_NOEXCEPT
|
||||
: node{curr}
|
||||
{}
|
||||
|
||||
public:
|
||||
/*! @brief Default constructor. */
|
||||
inline meta_data() ENTT_NOEXCEPT
|
||||
meta_data() ENTT_NOEXCEPT
|
||||
: node{nullptr}
|
||||
{}
|
||||
|
||||
@@ -1179,7 +1179,7 @@ public:
|
||||
* @brief Returns the name assigned to a given meta data.
|
||||
* @return The name assigned to the meta data.
|
||||
*/
|
||||
inline const char * name() const ENTT_NOEXCEPT {
|
||||
const char * name() const ENTT_NOEXCEPT {
|
||||
return node->name;
|
||||
}
|
||||
|
||||
@@ -1193,7 +1193,7 @@ public:
|
||||
* @brief Indicates whether a given meta data is constant or not.
|
||||
* @return True if the meta data is constant, false otherwise.
|
||||
*/
|
||||
inline bool is_const() const ENTT_NOEXCEPT {
|
||||
bool is_const() const ENTT_NOEXCEPT {
|
||||
return node->is_const;
|
||||
}
|
||||
|
||||
@@ -1205,7 +1205,7 @@ public:
|
||||
*
|
||||
* @return True if the meta data is static, false otherwise.
|
||||
*/
|
||||
inline bool is_static() const ENTT_NOEXCEPT {
|
||||
bool is_static() const ENTT_NOEXCEPT {
|
||||
return node->is_static;
|
||||
}
|
||||
|
||||
@@ -1230,7 +1230,7 @@ public:
|
||||
* @return True in case of success, false otherwise.
|
||||
*/
|
||||
template<typename Type>
|
||||
inline bool set(meta_handle handle, Type &&value) const {
|
||||
bool set(meta_handle handle, Type &&value) const {
|
||||
return node->set(handle, meta_any{}, std::forward<Type>(value));
|
||||
}
|
||||
|
||||
@@ -1250,7 +1250,7 @@ public:
|
||||
* @return True in case of success, false otherwise.
|
||||
*/
|
||||
template<typename Type>
|
||||
inline bool set(meta_handle handle, std::size_t index, Type &&value) const {
|
||||
bool set(meta_handle handle, std::size_t index, Type &&value) const {
|
||||
ENTT_ASSERT(index < node->type()->extent);
|
||||
return node->set(handle, index, std::forward<Type>(value));
|
||||
}
|
||||
@@ -1264,7 +1264,7 @@ public:
|
||||
* @param handle An opaque pointer to an instance of the underlying type.
|
||||
* @return A meta any containing the value of the underlying variable.
|
||||
*/
|
||||
inline meta_any get(meta_handle handle) const ENTT_NOEXCEPT {
|
||||
meta_any get(meta_handle handle) const ENTT_NOEXCEPT {
|
||||
return node->get(handle, meta_any{});
|
||||
}
|
||||
|
||||
@@ -1278,7 +1278,7 @@ public:
|
||||
* @param index Position of the underlying element to get.
|
||||
* @return A meta any containing the value of the underlying element.
|
||||
*/
|
||||
inline meta_any get(meta_handle handle, std::size_t index) const ENTT_NOEXCEPT {
|
||||
meta_any get(meta_handle handle, std::size_t index) const ENTT_NOEXCEPT {
|
||||
ENTT_ASSERT(index < node->type()->extent);
|
||||
return node->get(handle, index);
|
||||
}
|
||||
@@ -1289,7 +1289,7 @@ public:
|
||||
* @param op A valid function object.
|
||||
*/
|
||||
template<typename Op>
|
||||
inline std::enable_if_t<std::is_invocable_v<Op, meta_prop>, void>
|
||||
std::enable_if_t<std::is_invocable_v<Op, meta_prop>, void>
|
||||
prop(Op op) const ENTT_NOEXCEPT {
|
||||
internal::iterate([op = std::move(op)](auto *curr) {
|
||||
op(curr->meta());
|
||||
@@ -1303,7 +1303,7 @@ public:
|
||||
* @return The property associated with the given key, if any.
|
||||
*/
|
||||
template<typename Key>
|
||||
inline std::enable_if_t<!std::is_invocable_v<Key, meta_prop>, meta_prop>
|
||||
std::enable_if_t<!std::is_invocable_v<Key, meta_prop>, meta_prop>
|
||||
prop(Key &&key) const ENTT_NOEXCEPT {
|
||||
const auto *curr = internal::find_if([key = meta_any{std::forward<Key>(key)}](auto *candidate) {
|
||||
return candidate->key() == key;
|
||||
@@ -1316,7 +1316,7 @@ public:
|
||||
* @brief Returns true if a meta object is valid, false otherwise.
|
||||
* @return True if the meta object is valid, false otherwise.
|
||||
*/
|
||||
inline explicit operator bool() const ENTT_NOEXCEPT {
|
||||
explicit operator bool() const ENTT_NOEXCEPT {
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1326,7 +1326,7 @@ public:
|
||||
* @return True if the two meta objects refer to the same node, false
|
||||
* otherwise.
|
||||
*/
|
||||
inline bool operator==(const meta_data &other) const ENTT_NOEXCEPT {
|
||||
bool operator==(const meta_data &other) const ENTT_NOEXCEPT {
|
||||
return node == other.node;
|
||||
}
|
||||
|
||||
@@ -1356,7 +1356,7 @@ class meta_func {
|
||||
/*! @brief A meta factory is allowed to create meta objects. */
|
||||
template<typename> friend class meta_factory;
|
||||
|
||||
inline meta_func(const internal::meta_func_node *curr) ENTT_NOEXCEPT
|
||||
meta_func(const internal::meta_func_node *curr) ENTT_NOEXCEPT
|
||||
: node{curr}
|
||||
{}
|
||||
|
||||
@@ -1365,7 +1365,7 @@ public:
|
||||
using size_type = typename internal::meta_func_node::size_type;
|
||||
|
||||
/*! @brief Default constructor. */
|
||||
inline meta_func() ENTT_NOEXCEPT
|
||||
meta_func() ENTT_NOEXCEPT
|
||||
: node{nullptr}
|
||||
{}
|
||||
|
||||
@@ -1373,7 +1373,7 @@ public:
|
||||
* @brief Returns the name assigned to a given meta function.
|
||||
* @return The name assigned to the meta function.
|
||||
*/
|
||||
inline const char * name() const ENTT_NOEXCEPT {
|
||||
const char * name() const ENTT_NOEXCEPT {
|
||||
return node->name;
|
||||
}
|
||||
|
||||
@@ -1387,7 +1387,7 @@ public:
|
||||
* @brief Returns the number of arguments accepted by a meta function.
|
||||
* @return The number of arguments accepted by the meta function.
|
||||
*/
|
||||
inline size_type size() const ENTT_NOEXCEPT {
|
||||
size_type size() const ENTT_NOEXCEPT {
|
||||
return node->size;
|
||||
}
|
||||
|
||||
@@ -1395,7 +1395,7 @@ public:
|
||||
* @brief Indicates whether a given meta function is constant or not.
|
||||
* @return True if the meta function is constant, false otherwise.
|
||||
*/
|
||||
inline bool is_const() const ENTT_NOEXCEPT {
|
||||
bool is_const() const ENTT_NOEXCEPT {
|
||||
return node->is_const;
|
||||
}
|
||||
|
||||
@@ -1407,7 +1407,7 @@ public:
|
||||
*
|
||||
* @return True if the meta function is static, false otherwise.
|
||||
*/
|
||||
inline bool is_static() const ENTT_NOEXCEPT {
|
||||
bool is_static() const ENTT_NOEXCEPT {
|
||||
return node->is_static;
|
||||
}
|
||||
|
||||
@@ -1457,7 +1457,7 @@ public:
|
||||
* @param op A valid function object.
|
||||
*/
|
||||
template<typename Op>
|
||||
inline std::enable_if_t<std::is_invocable_v<Op, meta_prop>, void>
|
||||
std::enable_if_t<std::is_invocable_v<Op, meta_prop>, void>
|
||||
prop(Op op) const ENTT_NOEXCEPT {
|
||||
internal::iterate([op = std::move(op)](auto *curr) {
|
||||
op(curr->meta());
|
||||
@@ -1471,7 +1471,7 @@ public:
|
||||
* @return The property associated with the given key, if any.
|
||||
*/
|
||||
template<typename Key>
|
||||
inline std::enable_if_t<!std::is_invocable_v<Key, meta_prop>, meta_prop>
|
||||
std::enable_if_t<!std::is_invocable_v<Key, meta_prop>, meta_prop>
|
||||
prop(Key &&key) const ENTT_NOEXCEPT {
|
||||
const auto *curr = internal::find_if([key = meta_any{std::forward<Key>(key)}](auto *candidate) {
|
||||
return candidate->key() == key;
|
||||
@@ -1484,7 +1484,7 @@ public:
|
||||
* @brief Returns true if a meta object is valid, false otherwise.
|
||||
* @return True if the meta object is valid, false otherwise.
|
||||
*/
|
||||
inline explicit operator bool() const ENTT_NOEXCEPT {
|
||||
explicit operator bool() const ENTT_NOEXCEPT {
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1494,7 +1494,7 @@ public:
|
||||
* @return True if the two meta objects refer to the same node, false
|
||||
* otherwise.
|
||||
*/
|
||||
inline bool operator==(const meta_func &other) const ENTT_NOEXCEPT {
|
||||
bool operator==(const meta_func &other) const ENTT_NOEXCEPT {
|
||||
return node == other.node;
|
||||
}
|
||||
|
||||
@@ -1527,7 +1527,7 @@ class meta_type {
|
||||
/*! @brief A meta node is allowed to create meta objects. */
|
||||
template<typename...> friend struct internal::meta_node;
|
||||
|
||||
inline meta_type(const internal::meta_type_node *curr) ENTT_NOEXCEPT
|
||||
meta_type(const internal::meta_type_node *curr) ENTT_NOEXCEPT
|
||||
: node{curr}
|
||||
{}
|
||||
|
||||
@@ -1536,7 +1536,7 @@ public:
|
||||
using size_type = typename internal::meta_type_node::size_type;
|
||||
|
||||
/*! @brief Default constructor. */
|
||||
inline meta_type() ENTT_NOEXCEPT
|
||||
meta_type() ENTT_NOEXCEPT
|
||||
: node{nullptr}
|
||||
{}
|
||||
|
||||
@@ -1544,7 +1544,7 @@ public:
|
||||
* @brief Returns the name assigned to a given meta type.
|
||||
* @return The name assigned to the meta type.
|
||||
*/
|
||||
inline const char * name() const ENTT_NOEXCEPT {
|
||||
const char * name() const ENTT_NOEXCEPT {
|
||||
return node->name;
|
||||
}
|
||||
|
||||
@@ -1552,7 +1552,7 @@ public:
|
||||
* @brief Indicates whether a given meta type refers to void or not.
|
||||
* @return True if the underlying type is void, false otherwise.
|
||||
*/
|
||||
inline bool is_void() const ENTT_NOEXCEPT {
|
||||
bool is_void() const ENTT_NOEXCEPT {
|
||||
return node->is_void;
|
||||
}
|
||||
|
||||
@@ -1561,7 +1561,7 @@ public:
|
||||
* not.
|
||||
* @return True if the underlying type is an integral type, false otherwise.
|
||||
*/
|
||||
inline bool is_integral() const ENTT_NOEXCEPT {
|
||||
bool is_integral() const ENTT_NOEXCEPT {
|
||||
return node->is_integral;
|
||||
}
|
||||
|
||||
@@ -1571,7 +1571,7 @@ public:
|
||||
* @return True if the underlying type is a floating-point type, false
|
||||
* otherwise.
|
||||
*/
|
||||
inline bool is_floating_point() const ENTT_NOEXCEPT {
|
||||
bool is_floating_point() const ENTT_NOEXCEPT {
|
||||
return node->is_floating_point;
|
||||
}
|
||||
|
||||
@@ -1580,7 +1580,7 @@ public:
|
||||
* not.
|
||||
* @return True if the underlying type is an array type, false otherwise.
|
||||
*/
|
||||
inline bool is_array() const ENTT_NOEXCEPT {
|
||||
bool is_array() const ENTT_NOEXCEPT {
|
||||
return node->is_array;
|
||||
}
|
||||
|
||||
@@ -1588,7 +1588,7 @@ public:
|
||||
* @brief Indicates whether a given meta type refers to an enum or not.
|
||||
* @return True if the underlying type is an enum, false otherwise.
|
||||
*/
|
||||
inline bool is_enum() const ENTT_NOEXCEPT {
|
||||
bool is_enum() const ENTT_NOEXCEPT {
|
||||
return node->is_enum;
|
||||
}
|
||||
|
||||
@@ -1596,7 +1596,7 @@ public:
|
||||
* @brief Indicates whether a given meta type refers to an union or not.
|
||||
* @return True if the underlying type is an union, false otherwise.
|
||||
*/
|
||||
inline bool is_union() const ENTT_NOEXCEPT {
|
||||
bool is_union() const ENTT_NOEXCEPT {
|
||||
return node->is_union;
|
||||
}
|
||||
|
||||
@@ -1604,7 +1604,7 @@ public:
|
||||
* @brief Indicates whether a given meta type refers to a class or not.
|
||||
* @return True if the underlying type is a class, false otherwise.
|
||||
*/
|
||||
inline bool is_class() const ENTT_NOEXCEPT {
|
||||
bool is_class() const ENTT_NOEXCEPT {
|
||||
return node->is_class;
|
||||
}
|
||||
|
||||
@@ -1612,7 +1612,7 @@ public:
|
||||
* @brief Indicates whether a given meta type refers to a pointer or not.
|
||||
* @return True if the underlying type is a pointer, false otherwise.
|
||||
*/
|
||||
inline bool is_pointer() const ENTT_NOEXCEPT {
|
||||
bool is_pointer() const ENTT_NOEXCEPT {
|
||||
return node->is_pointer;
|
||||
}
|
||||
|
||||
@@ -1621,7 +1621,7 @@ public:
|
||||
* not.
|
||||
* @return True if the underlying type is a function, false otherwise.
|
||||
*/
|
||||
inline bool is_function() const ENTT_NOEXCEPT {
|
||||
bool is_function() const ENTT_NOEXCEPT {
|
||||
return node->is_function;
|
||||
}
|
||||
|
||||
@@ -1631,7 +1631,7 @@ public:
|
||||
* @return True if the underlying type is a pointer to data member, false
|
||||
* otherwise.
|
||||
*/
|
||||
inline bool is_member_object_pointer() const ENTT_NOEXCEPT {
|
||||
bool is_member_object_pointer() const ENTT_NOEXCEPT {
|
||||
return node->is_member_object_pointer;
|
||||
}
|
||||
|
||||
@@ -1641,7 +1641,7 @@ public:
|
||||
* @return True if the underlying type is a pointer to member function,
|
||||
* false otherwise.
|
||||
*/
|
||||
inline bool is_member_function_pointer() const ENTT_NOEXCEPT {
|
||||
bool is_member_function_pointer() const ENTT_NOEXCEPT {
|
||||
return node->is_member_function_pointer;
|
||||
}
|
||||
|
||||
@@ -1651,7 +1651,7 @@ public:
|
||||
* @return The number of elements of the array if the underlying type is an
|
||||
* array type, 0 otherwise.
|
||||
*/
|
||||
inline size_type extent() const ENTT_NOEXCEPT {
|
||||
size_type extent() const ENTT_NOEXCEPT {
|
||||
return node->extent;
|
||||
}
|
||||
|
||||
@@ -1660,7 +1660,7 @@ public:
|
||||
* @return The meta type for which the pointer is defined or this meta type
|
||||
* if it doesn't refer to a pointer type.
|
||||
*/
|
||||
inline meta_type remove_pointer() const ENTT_NOEXCEPT {
|
||||
meta_type remove_pointer() const ENTT_NOEXCEPT {
|
||||
return node->remove_pointer();
|
||||
}
|
||||
|
||||
@@ -1673,7 +1673,7 @@ public:
|
||||
* @param op A valid function object.
|
||||
*/
|
||||
template<typename Op>
|
||||
inline void base(Op op) const ENTT_NOEXCEPT {
|
||||
void base(Op op) const ENTT_NOEXCEPT {
|
||||
internal::iterate<&internal::meta_type_node::base>([op = std::move(op)](auto *curr) {
|
||||
op(curr->meta());
|
||||
}, node);
|
||||
@@ -1687,7 +1687,7 @@ public:
|
||||
* @param str The name to use to search for a meta base.
|
||||
* @return The meta base associated with the given name, if any.
|
||||
*/
|
||||
inline meta_base base(const char *str) const ENTT_NOEXCEPT {
|
||||
meta_base base(const char *str) const ENTT_NOEXCEPT {
|
||||
const auto *curr = internal::find_if<&internal::meta_type_node::base>([name = hashed_string{str}](auto *candidate) {
|
||||
return candidate->type()->name == name;
|
||||
}, node);
|
||||
@@ -1705,7 +1705,7 @@ public:
|
||||
* @param op A valid function object.
|
||||
*/
|
||||
template<typename Op>
|
||||
inline void conv(Op op) const ENTT_NOEXCEPT {
|
||||
void conv(Op op) const ENTT_NOEXCEPT {
|
||||
internal::iterate<&internal::meta_type_node::conv>([op = std::move(op)](auto *curr) {
|
||||
op(curr->meta());
|
||||
}, node);
|
||||
@@ -1722,7 +1722,7 @@ public:
|
||||
* any.
|
||||
*/
|
||||
template<typename Type>
|
||||
inline meta_conv conv() const ENTT_NOEXCEPT {
|
||||
meta_conv conv() const ENTT_NOEXCEPT {
|
||||
const auto *curr = internal::find_if<&internal::meta_type_node::conv>([type = internal::meta_info<Type>::resolve()](auto *candidate) {
|
||||
return candidate->type() == type;
|
||||
}, node);
|
||||
@@ -1736,7 +1736,7 @@ public:
|
||||
* @param op A valid function object.
|
||||
*/
|
||||
template<typename Op>
|
||||
inline void ctor(Op op) const ENTT_NOEXCEPT {
|
||||
void ctor(Op op) const ENTT_NOEXCEPT {
|
||||
internal::iterate([op = std::move(op)](auto *curr) {
|
||||
op(curr->meta());
|
||||
}, node->ctor);
|
||||
@@ -1748,7 +1748,7 @@ public:
|
||||
* @return The requested meta constructor, if any.
|
||||
*/
|
||||
template<typename... Args>
|
||||
inline meta_ctor ctor() const ENTT_NOEXCEPT {
|
||||
meta_ctor ctor() const ENTT_NOEXCEPT {
|
||||
const auto *curr = internal::ctor<Args...>(std::make_index_sequence<sizeof...(Args)>{}, node);
|
||||
return curr ? curr->meta() : meta_ctor{};
|
||||
}
|
||||
@@ -1757,7 +1757,7 @@ public:
|
||||
* @brief Returns the meta destructor associated with a given type.
|
||||
* @return The meta destructor associated with the given type, if any.
|
||||
*/
|
||||
inline meta_dtor dtor() const ENTT_NOEXCEPT {
|
||||
meta_dtor dtor() const ENTT_NOEXCEPT {
|
||||
return node->dtor ? node->dtor->meta() : meta_dtor{};
|
||||
}
|
||||
|
||||
@@ -1771,7 +1771,7 @@ public:
|
||||
* @param op A valid function object.
|
||||
*/
|
||||
template<typename Op>
|
||||
inline void data(Op op) const ENTT_NOEXCEPT {
|
||||
void data(Op op) const ENTT_NOEXCEPT {
|
||||
internal::iterate<&internal::meta_type_node::data>([op = std::move(op)](auto *curr) {
|
||||
op(curr->meta());
|
||||
}, node);
|
||||
@@ -1787,7 +1787,7 @@ public:
|
||||
* @param str The name to use to search for a meta data.
|
||||
* @return The meta data associated with the given name, if any.
|
||||
*/
|
||||
inline meta_data data(const char *str) const ENTT_NOEXCEPT {
|
||||
meta_data data(const char *str) const ENTT_NOEXCEPT {
|
||||
const auto *curr = internal::find_if<&internal::meta_type_node::data>([name = hashed_string{str}](auto *candidate) {
|
||||
return candidate->name == name;
|
||||
}, node);
|
||||
@@ -1806,7 +1806,7 @@ public:
|
||||
* @param op A valid function object.
|
||||
*/
|
||||
template<typename Op>
|
||||
inline void func(Op op) const ENTT_NOEXCEPT {
|
||||
void func(Op op) const ENTT_NOEXCEPT {
|
||||
internal::iterate<&internal::meta_type_node::func>([op = std::move(op)](auto *curr) {
|
||||
op(curr->meta());
|
||||
}, node);
|
||||
@@ -1822,7 +1822,7 @@ public:
|
||||
* @param str The name to use to search for a meta function.
|
||||
* @return The meta function associated with the given name, if any.
|
||||
*/
|
||||
inline meta_func func(const char *str) const ENTT_NOEXCEPT {
|
||||
meta_func func(const char *str) const ENTT_NOEXCEPT {
|
||||
const auto *curr = internal::find_if<&internal::meta_type_node::func>([name = hashed_string{str}](auto *candidate) {
|
||||
return candidate->name == name;
|
||||
}, node);
|
||||
@@ -1863,7 +1863,7 @@ public:
|
||||
* @param handle An opaque pointer to an instance of the underlying type.
|
||||
* @return True in case of success, false otherwise.
|
||||
*/
|
||||
inline bool destroy(meta_handle handle) const {
|
||||
bool destroy(meta_handle handle) const {
|
||||
return node->dtor ? node->dtor->invoke(handle) : node->destroy(handle);
|
||||
}
|
||||
|
||||
@@ -1877,7 +1877,7 @@ public:
|
||||
* @param op A valid function object.
|
||||
*/
|
||||
template<typename Op>
|
||||
inline std::enable_if_t<std::is_invocable_v<Op, meta_prop>, void>
|
||||
std::enable_if_t<std::is_invocable_v<Op, meta_prop>, void>
|
||||
prop(Op op) const ENTT_NOEXCEPT {
|
||||
internal::iterate<&internal::meta_type_node::prop>([op = std::move(op)](auto *curr) {
|
||||
op(curr->meta());
|
||||
@@ -1896,7 +1896,7 @@ public:
|
||||
* @return The property associated with the given key, if any.
|
||||
*/
|
||||
template<typename Key>
|
||||
inline std::enable_if_t<!std::is_invocable_v<Key, meta_prop>, meta_prop>
|
||||
std::enable_if_t<!std::is_invocable_v<Key, meta_prop>, meta_prop>
|
||||
prop(Key &&key) const ENTT_NOEXCEPT {
|
||||
const auto *curr = internal::find_if<&internal::meta_type_node::prop>([key = meta_any{std::forward<Key>(key)}](auto *candidate) {
|
||||
return candidate->key() == key;
|
||||
@@ -1909,7 +1909,7 @@ public:
|
||||
* @brief Returns true if a meta object is valid, false otherwise.
|
||||
* @return True if the meta object is valid, false otherwise.
|
||||
*/
|
||||
inline explicit operator bool() const ENTT_NOEXCEPT {
|
||||
explicit operator bool() const ENTT_NOEXCEPT {
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1919,7 +1919,7 @@ public:
|
||||
* @return True if the two meta objects refer to the same node, false
|
||||
* otherwise.
|
||||
*/
|
||||
inline bool operator==(const meta_type &other) const ENTT_NOEXCEPT {
|
||||
bool operator==(const meta_type &other) const ENTT_NOEXCEPT {
|
||||
return node == other.node;
|
||||
}
|
||||
|
||||
@@ -2032,7 +2032,7 @@ struct meta_function_helper<Ret(Args...)> {
|
||||
|
||||
static constexpr auto size = sizeof...(Args);
|
||||
|
||||
inline static auto arg(typename internal::meta_func_node::size_type index) {
|
||||
static auto arg(typename internal::meta_func_node::size_type index) {
|
||||
return std::array<meta_type_node *, sizeof...(Args)>{{meta_info<Args>::resolve()...}}[index];
|
||||
}
|
||||
};
|
||||
@@ -2066,7 +2066,7 @@ struct meta_function_helper<std::integral_constant<decltype(Func), Func>>: declt
|
||||
|
||||
|
||||
template<typename Type>
|
||||
inline bool destroy([[maybe_unused]] meta_handle handle) {
|
||||
bool destroy([[maybe_unused]] meta_handle handle) {
|
||||
bool accepted = false;
|
||||
|
||||
if constexpr(std::is_object_v<Type> && !std::is_array_v<Type>) {
|
||||
@@ -2082,7 +2082,7 @@ inline bool destroy([[maybe_unused]] meta_handle handle) {
|
||||
|
||||
|
||||
template<typename Type, typename... Args, std::size_t... Indexes>
|
||||
inline meta_any construct(meta_any * const args, std::index_sequence<Indexes...>) {
|
||||
meta_any construct(meta_any * const args, std::index_sequence<Indexes...>) {
|
||||
[[maybe_unused]] std::array<bool, sizeof...(Args)> can_cast{{(args+Indexes)->can_cast<std::remove_cv_t<std::remove_reference_t<Args>>>()...}};
|
||||
[[maybe_unused]] std::array<bool, sizeof...(Args)> can_convert{{(std::get<Indexes>(can_cast) ? false : (args+Indexes)->can_convert<std::remove_cv_t<std::remove_reference_t<Args>>>())...}};
|
||||
meta_any any{};
|
||||
@@ -2156,7 +2156,7 @@ bool setter([[maybe_unused]] meta_handle handle, [[maybe_unused]] meta_any index
|
||||
|
||||
|
||||
template<typename Type, auto Data>
|
||||
inline meta_any getter([[maybe_unused]] meta_handle handle, [[maybe_unused]] meta_any index) {
|
||||
meta_any getter([[maybe_unused]] meta_handle handle, [[maybe_unused]] meta_any index) {
|
||||
if constexpr(std::is_function_v<std::remove_pointer_t<decltype(Data)>> || std::is_member_function_pointer_v<decltype(Data)>) {
|
||||
static_assert(std::is_invocable_v<decltype(Data), Type *>);
|
||||
auto *clazz = handle.try_cast<Type>();
|
||||
@@ -2226,7 +2226,7 @@ invoke(meta_handle &handle, meta_any *args, std::index_sequence<Indexes...>) {
|
||||
|
||||
|
||||
template<typename Type>
|
||||
meta_type_node * meta_node<Type>::resolve() ENTT_NOEXCEPT {
|
||||
inline meta_type_node * meta_node<Type>::resolve() ENTT_NOEXCEPT {
|
||||
if(!type) {
|
||||
static meta_type_node node{
|
||||
{},
|
||||
|
||||
@@ -57,16 +57,16 @@ public:
|
||||
}
|
||||
|
||||
/*! @copydoc get */
|
||||
inline operator const Resource & () const ENTT_NOEXCEPT { return get(); }
|
||||
operator const Resource & () const ENTT_NOEXCEPT { return get(); }
|
||||
|
||||
/*! @copydoc get */
|
||||
inline operator Resource & () ENTT_NOEXCEPT { return get(); }
|
||||
operator Resource & () ENTT_NOEXCEPT { return get(); }
|
||||
|
||||
/*! @copydoc get */
|
||||
inline const Resource & operator *() const ENTT_NOEXCEPT { return get(); }
|
||||
const Resource & operator *() const ENTT_NOEXCEPT { return get(); }
|
||||
|
||||
/*! @copydoc get */
|
||||
inline Resource & operator *() ENTT_NOEXCEPT { return get(); }
|
||||
Resource & operator *() ENTT_NOEXCEPT { return get(); }
|
||||
|
||||
/**
|
||||
* @brief Gets a pointer to the managed resource.
|
||||
@@ -79,13 +79,13 @@ public:
|
||||
* @return A pointer to the managed resource or `nullptr` if the handle
|
||||
* contains no resource at all.
|
||||
*/
|
||||
inline const Resource * operator->() const ENTT_NOEXCEPT {
|
||||
const Resource * operator->() const ENTT_NOEXCEPT {
|
||||
ENTT_ASSERT(static_cast<bool>(resource));
|
||||
return resource.get();
|
||||
}
|
||||
|
||||
/*! @copydoc operator-> */
|
||||
inline Resource * operator->() ENTT_NOEXCEPT {
|
||||
Resource * operator->() ENTT_NOEXCEPT {
|
||||
return const_cast<Resource *>(std::as_const(*this).operator->());
|
||||
}
|
||||
|
||||
|
||||
@@ -53,17 +53,17 @@ class dispatcher {
|
||||
current %= std::extent<decltype(events)>::value;
|
||||
}
|
||||
|
||||
inline sink_type sink() ENTT_NOEXCEPT {
|
||||
sink_type sink() ENTT_NOEXCEPT {
|
||||
return signal.sink();
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
inline void trigger(Args &&... args) {
|
||||
void trigger(Args &&... args) {
|
||||
signal.publish({ std::forward<Args>(args)... });
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
inline void enqueue(Args &&... args) {
|
||||
void enqueue(Args &&... args) {
|
||||
events[current].emplace_back(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
* @return A temporary sink object.
|
||||
*/
|
||||
template<typename Event>
|
||||
inline sink_type<Event> sink() ENTT_NOEXCEPT {
|
||||
sink_type<Event> sink() ENTT_NOEXCEPT {
|
||||
return assure<Event>().sink();
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
* @param args Arguments to use to construct the event.
|
||||
*/
|
||||
template<typename Event, typename... Args>
|
||||
inline void trigger(Args &&... args) {
|
||||
void trigger(Args &&... args) {
|
||||
assure<Event>().trigger(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
* @param event An instance of the given type of event.
|
||||
*/
|
||||
template<typename Event>
|
||||
inline void trigger(Event &&event) {
|
||||
void trigger(Event &&event) {
|
||||
assure<std::decay_t<Event>>().trigger(std::forward<Event>(event));
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
* @param args Arguments to use to construct the event.
|
||||
*/
|
||||
template<typename Event, typename... Args>
|
||||
inline void enqueue(Args &&... args) {
|
||||
void enqueue(Args &&... args) {
|
||||
assure<Event>().enqueue(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public:
|
||||
* @param event An instance of the given type of event.
|
||||
*/
|
||||
template<typename Event>
|
||||
inline void enqueue(Event &&event) {
|
||||
void enqueue(Event &&event) {
|
||||
assure<std::decay_t<Event>>().enqueue(std::forward<Event>(event));
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ public:
|
||||
* @tparam Event Type of events to send.
|
||||
*/
|
||||
template<typename Event>
|
||||
inline void update() {
|
||||
void update() {
|
||||
assure<Event>().publish();
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ public:
|
||||
* delivered to the registered listeners. It's responsibility of the users
|
||||
* to reduce at a minimum the time spent in the bodies of the listeners.
|
||||
*/
|
||||
inline void update() const {
|
||||
void update() const {
|
||||
for(auto pos = wrappers.size(); pos; --pos) {
|
||||
auto &wdata = wrappers[pos-1];
|
||||
|
||||
|
||||
@@ -73,11 +73,11 @@ class emitter {
|
||||
}
|
||||
}
|
||||
|
||||
inline connection_type once(listener_type listener) {
|
||||
connection_type once(listener_type listener) {
|
||||
return once_list.emplace(once_list.cend(), false, std::move(listener));
|
||||
}
|
||||
|
||||
inline connection_type on(listener_type listener) {
|
||||
connection_type on(listener_type listener) {
|
||||
return on_list.emplace(on_list.cend(), false, std::move(listener));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user