1#ifndef ENTT_ENTITY_HELPER_HPP
2#define ENTT_ENTITY_HELPER_HPP
7#include "../core/fwd.hpp"
8#include "../core/type_traits.hpp"
9#include "../signal/delegate.hpp"
21template<
typename Registry>
47 template<
typename Get,
typename Exclude>
60template<
typename Registry>
64 if constexpr(std::is_const_v<registry_type>) {
65 return reg.template group_if_exists<
typename Owned::value_type...>(
get_t<
typename Get::value_type...>{},
exclude_t<
typename Exclude::value_type...>{});
91 template<
typename Owned,
typename Get,
typename Exclude>
107template<auto Member,
typename Registry = std::decay_t<nth_argument_t<0u, decltype(Member)>>>
109 static_assert(std::is_member_function_pointer_v<
decltype(
Member)>,
"Invalid pointer to non-static member function");
127template<
typename...
Args>
131 const auto *
addr = std::addressof(instance);
133 for(
auto it = base.rbegin(), last = base.rend();
it < last;
it += page_size) {
167template<
typename Registry>
185 template<
typename Type>
199 registry_type *bucket;
207template<
typename Registry,
typename Type>
268template<
typename Registry>
Converts a registry to a group.
typename registry_type::entity_type entity_type
Underlying entity identifier.
Registry registry_type
Type of registry to convert.
as_group(registry_type &source) noexcept
Constructs a converter for a given registry.
Converts a registry to a view.
as_view(registry_type &source) noexcept
Constructs a converter for a given registry.
typename registry_type::entity_type entity_type
Underlying entity identifier.
Registry registry_type
Type of registry to convert.
Fast and reliable entity-component system.
Basic storage implementation.
const value_type & get(const entity_type entt) const noexcept
Returns the object assigned to an entity.
Type value_type
Type of the objects assigned to entities.
Basic delegate implementation.
typename member_class< Member >::type member_class_t
Helper type.
constexpr entt_traits< Entity >::entity_type to_entity(const Entity value) noexcept
Returns the entity part once converted to the underlying type.
constexpr Type make_obj_using_allocator(const Allocator &allocator, Args &&...args)
Uses-allocator construction utility (waiting for C++20).
constexpr null_t null
Compile-time constant for null entities.
std::uint32_t id_type
Alias declaration for type identifiers.
constexpr get_t< Type... > get
Variable template for lists of observed components.
basic_registry<> registry
Alias declaration for the most common use case.
void invoke(Registry ®, const typename Registry::entity_type entt)
Helper to create a listener that directly invokes a member function.
sigh_helper(Registry &) -> sigh_helper< Registry >
Deduction guide.
@ ref
Aliasing mode, the object points to a non-const element.
basic_storage< Type > storage
Alias declaration for the most common use case.
Alias for exclusion lists.
Alias for lists of observed components.
Alias for lists of owned components.
auto on_destroy(Args &&...args)
Forwards the call to on_destroy on the underlying storage.
auto on_construct(Args &&...args)
Forwards the call to on_construct on the underlying storage.
Registry registry_type
Registry type.
auto on_update(Args &&...args)
Forwards the call to on_update on the underlying storage.
sigh_helper(registry_type &ref, const id_type id=type_hash< Type >::value())
Constructs a helper for a given registry.
sigh_helper(registry_type &ref)
Constructs a helper for a given registry.
Registry registry_type
Registry type.
registry_type & registry() noexcept
Returns a reference to the underlying registry.
auto with(const id_type id=type_hash< Type >::value()) noexcept
Binds a properly initialized helper to a given signal type.
Primary template isn't defined on purpose.