OpenLexocad  27.1
entt.hpp File Reference
#include <utility>
#include <iterator>
#include <algorithm>
#include <functional>
#include <atomic>
#include <type_traits>
#include <cstdint>
#include <cassert>
#include <cstddef>
#include <tuple>
#include <vector>
#include <memory>
#include <cstring>
#include <numeric>
#include <array>
#include <unordered_map>
#include <limits>
#include <list>

Go to the source code of this file.

Classes

struct  entt::identity
 Identity function object (waiting for C++20). More...
 
struct  entt::overloaded< Func >
 Helper type for visitors. More...
 
struct  entt::y_combinator< Func >
 Basic implementation of a y-combinator. More...
 
struct  entt::std_sort
 Function object to wrap std::sort in a class type. More...
 
struct  entt::insertion_sort
 Function object for performing insertion sort. More...
 
struct  entt::radix_sort< Bit, N >
 Function object for performing LSD radix sort. More...
 
class  entt::family<... >
 Dynamic identifier generator. More...
 
class  entt::basic_hashed_string< Char >
 Zero overhead unique identifier. More...
 
class  entt::identifier< Types >
 Types identifiers. More...
 
struct  entt::monostate< ENTT_ID_TYPE >
 Minimal implementation of the monostate pattern. More...
 
struct  entt::choice_t< N >
 Utility class to disambiguate overloaded functions. More...
 
struct  entt::choice_t< 0 >
 Utility class to disambiguate overloaded functions. More...
 
struct  entt::type_list<... >
 A class to use to push around lists of types, nothing more. More...
 
struct  entt::type_list_size< typename >
 Primary template isn't defined on purpose. More...
 
struct  entt::type_list_size< type_list< Type... > >
 Compile-time number of elements in a type list. More...
 
struct  entt::type_list_cat<... >
 Primary template isn't defined on purpose. More...
 
struct  entt::type_list_cat<>
 Concatenates multiple type lists. More...
 
struct  entt::type_list_cat< type_list< Type... >, type_list< Other... >, List... >
 Concatenates multiple type lists. More...
 
struct  entt::type_list_cat< type_list< Type... > >
 Concatenates multiple type lists. More...
 
struct  entt::type_list_unique< typename >
 Primary template isn't defined on purpose. More...
 
struct  entt::type_list_unique< type_list< Type, Other... > >
 Removes duplicates types from a type list. More...
 
struct  entt::type_list_unique< type_list<> >
 Removes duplicates types from a type list. More...
 
struct  entt::is_equality_comparable< Type, typename >
 Provides the member constant value to true if a given type is equality comparable, false otherwise. More...
 
struct  entt::is_equality_comparable< Type, std::void_t< decltype(std::declval< Type >()==std::declval< Type >())> >
 Provides the member constant value to true if a given type is equality comparable, false otherwise. More...
 
struct  entt::named_type_traits< typename >
 Traits class used mainly to push things across boundaries. More...
 
struct  entt::named_type_traits< const Type >
 Specialization used to get rid of constness. More...
 
struct  entt::is_named_type< Type, typename >
 Provides the member constant value to true if a given type has a name. In all other cases, value is false. More...
 
struct  entt::is_named_type< Type, std::void_t< named_type_traits_t< std::decay_t< Type > > > >
 Provides the member constant value to true if a given type has a name. In all other cases, value is false. More...
 
struct  entt::connect_arg_t< auto >
 Used to wrap a function or a member of a specified type. More...
 
class  entt::delegate< typename >
 Basic delegate implementation. More...
 
class  entt::delegate< Ret(Args...)>
 Utility class to use to send around functions and members. More...
 
class  entt::delegate< typename >
 Basic delegate implementation. More...
 
class  entt::sink< typename >
 Sink class. More...
 
class  entt::sigh< typename >
 Unmanaged signal handler. More...
 
class  entt::sink< typename >
 Sink class. More...
 
class  entt::sigh< typename >
 Unmanaged signal handler. More...
 
class  entt::sigh< Ret(Args...)>
 Unmanaged signal handler. More...
 
class  entt::connection
 Connection class. More...
 
struct  entt::scoped_connection
 Scoped connection class. More...
 
class  entt::sink< Ret(Args...)>
 Sink class. More...
 
struct  entt::entt_traits< typename >
 Entity traits. More...
 
struct  entt::entt_traits< std::uint16_t >
 Entity traits for a 16 bits entity identifier. More...
 
struct  entt::entt_traits< std::uint32_t >
 Entity traits for a 32 bits entity identifier. More...
 
struct  entt::entt_traits< std::uint64_t >
 Entity traits for a 64 bits entity identifier. More...
 
class  entt::basic_registry< Entity >
 Fast and reliable entity-component system. More...
 
class  entt::basic_view<... >
 View. More...
 
class  entt::basic_runtime_view< Entity >
 Runtime view. More...
 
class  entt::basic_group<... >
 Group. More...
 
class  entt::basic_observer< Entity >
 Observer. More...
 
struct  entt::basic_actor< Entity >
 Dedicated to those who aren't confident with the entity-component-system architecture. More...
 
class  entt::basic_snapshot< Entity >
 Utility class to create snapshots from a registry. More...
 
class  entt::basic_snapshot_loader< Entity >
 Utility class to restore a snapshot as a whole. More...
 
class  entt::basic_continuous_loader< Entity >
 Utility class for continuous loading. More...
 
class  entt::sparse_set< Entity >
 Basic sparse set implementation. More...
 
class  entt::basic_runtime_view< Entity >
 Runtime view. More...
 
class  entt::basic_snapshot< Entity >
 Utility class to create snapshots from a registry. More...
 
class  entt::basic_snapshot_loader< Entity >
 Utility class to restore a snapshot as a whole. More...
 
class  entt::basic_continuous_loader< Entity >
 Utility class for continuous loading. More...
 
class  entt::basic_storage< Entity, Type, typename >
 Basic storage implementation. More...
 
class  entt::basic_storage< Entity, Type, std::enable_if_t< ENTT_ENABLE_ETO(Type)> >
 Basic storage implementation. More...
 
struct  entt::storage< Entity, Type >
 Basic storage implementation. More...
 
struct  entt::exclude_t< Type >
 Alias for exclusion lists. More...
 
struct  entt::get_t< Type >
 Alias for lists of observed components. More...
 
class  entt::basic_group<... >
 Group. More...
 
class  entt::basic_group< Entity, exclude_t< Exclude... >, get_t< Get... > >
 Non-owning group. More...
 
class  entt::basic_group< Entity, exclude_t< Exclude... >, get_t< Get... >, Owned... >
 Owning group. More...
 
class  entt::basic_view<... >
 View. More...
 
class  entt::basic_view< Entity, exclude_t< Exclude... >, Component... >
 Multi component view. More...
 
class  entt::basic_view< Entity, exclude_t<>, Component >
 Single component view specialization. More...
 
class  entt::basic_registry< Entity >
 Fast and reliable entity-component system. More...
 
struct  entt::basic_actor< Entity >
 Dedicated to those who aren't confident with the entity-component-system architecture. More...
 
struct  entt::as_view< Const, Entity >
 Converts a registry to a view. More...
 
struct  entt::as_group< Const, Entity >
 Converts a registry to a group. More...
 
struct  entt::matcher<... >
 Grouping matcher. More...
 
struct  entt::basic_collector<... >
 Collector. More...
 
struct  entt::basic_collector<>
 Collector. More...
 
struct  entt::basic_collector< matcher< type_list< Reject... >, type_list< Require... >, Rule... >, Other... >
 Collector. More...
 
class  entt::basic_observer< Entity >
 Observer. More...
 
struct  entt::service_locator< Service >
 Service locator, nothing more. More...
 
struct  entt::as_alias_t
 Empty class type used to request the as alias policy. More...
 
struct  entt::as_is_t
 Empty class type used to request the as-is policy. More...
 
struct  entt::as_void_t
 Empty class type used to request the as void policy. More...
 
class  entt::meta_any
 Opaque container for values of any type. More...
 
class  entt::meta_handle
 Opaque pointers to instances of any type. More...
 
struct  entt::meta_prop
 Opaque container for meta properties of any type. More...
 
struct  entt::meta_base
 Opaque container for meta base classes. More...
 
struct  entt::meta_conv
 Opaque container for meta conversion functions. More...
 
struct  entt::meta_ctor
 Opaque container for meta constructors. More...
 
struct  entt::meta_dtor
 Opaque container for meta destructors. More...
 
struct  entt::meta_data
 Opaque container for meta data. More...
 
struct  entt::meta_func
 Opaque container for meta functions. More...
 
class  entt::meta_type
 Opaque container for meta types. More...
 
struct  entt::meta_ctx
 Opaque container for a meta context. More...
 
class  entt::extended_meta_factory< Type, Spec >
 Extended meta factory to be used for reflection purposes. More...
 
class  entt::meta_factory< Type >
 A meta factory to be used for reflection purposes. More...
 
class  entt::extended_meta_factory< Type, Spec >
 Extended meta factory to be used for reflection purposes. More...
 
class  entt::process< Derived, Delta >
 Base class for processes. More...
 
struct  entt::process_adaptor< Func, Delta >
 Adaptor for lambdas and functors to turn them into processes. More...
 
class  entt::scheduler< Delta >
 Cooperative scheduler for processes. More...
 
struct  entt::cache< Resource >
 Simple cache for resources of a given type. More...
 
class  entt::handle< Resource >
 Shared resource handle. More...
 
class  entt::loader< Loader, Resource >
 Base class for resource loaders. More...
 
class  entt::handle< Resource >
 Shared resource handle. More...
 
class  entt::loader< Loader, Resource >
 Base class for resource loaders. More...
 
struct  entt::cache< Resource >
 Simple cache for resources of a given type. More...
 
class  entt::dispatcher
 Basic dispatcher implementation. More...
 
class  entt::emitter< Derived >
 General purpose event emitter. More...
 
struct  entt::emitter< Derived >::connection< Event >
 Generic connection type for events. More...
 

Namespaces

 entt
 

Macros

#define ENTT_CORE_ALGORITHM_HPP
 
#define ENTT_CORE_UTILITY_HPP
 
#define ENTT_CONFIG_CONFIG_H
 
#define ENTT_NOEXCEPT   noexcept
 
#define ENTT_HS_SUFFIX   _hs
 
#define ENTT_HWS_SUFFIX   _hws
 
#define ENTT_MAYBE_ATOMIC(Type)   std::atomic<Type>
 
#define ENTT_ENABLE_ETO(Type)   std::is_empty_v<Type>
 
#define ENTT_ID_TYPE   std::uint32_t
 
#define ENTT_PAGE_SIZE   32768
 
#define ENTT_ASSERT(condition)   assert(condition)
 
#define ENTT_CORE_FAMILY_HPP
 
#define ENTT_CORE_HASHED_STRING_HPP
 
#define ENTT_CORE_IDENT_HPP
 
#define ENTT_CORE_MONOSTATE_HPP
 
#define ENTT_CORE_TYPE_TRAITS_HPP
 
#define ENTT_OPAQUE_TYPE(clazz, type)
 Defines an enum class to use for opaque identifiers and a dedicate to_integer function to convert the identifiers to their underlying type. More...
 
#define ENTT_EXPAND(args)   args
 Utility macro to deal with an issue of MSVC. More...
 
#define ENTT_NAMED_TYPE(type)
 Makes an already existing type a named type. More...
 
#define ENTT_NAMED_STRUCT_ONLY(clazz, body)
 Defines a named type (to use for structs). More...
 
#define ENTT_NAMED_STRUCT_WITH_NAMESPACE(ns, clazz, body)
 Defines a named type (to use for structs). More...
 
#define ENTT_NAMED_STRUCT_OVERLOAD(_1, _2, _3, FUNC, ...)   FUNC
 Utility function to simulate macro overloading. More...
 
#define ENTT_NAMED_STRUCT(...)   ENTT_EXPAND(ENTT_NAMED_STRUCT_OVERLOAD(__VA_ARGS__, ENTT_NAMED_STRUCT_WITH_NAMESPACE, ENTT_NAMED_STRUCT_ONLY,)(__VA_ARGS__))
 Defines a named type (to use for structs). More...
 
#define ENTT_NAMED_CLASS_ONLY(clazz, body)
 Defines a named type (to use for classes). More...
 
#define ENTT_NAMED_CLASS_WITH_NAMESPACE(ns, clazz, body)
 Defines a named type (to use for classes). More...
 
#define ENTT_NAMED_CLASS_MACRO(_1, _2, _3, FUNC, ...)   FUNC
 Utility function to simulate macro overloading. More...
 
#define ENTT_NAMED_CLASS(...)   ENTT_EXPAND(ENTT_NAMED_CLASS_MACRO(__VA_ARGS__, ENTT_NAMED_CLASS_WITH_NAMESPACE, ENTT_NAMED_CLASS_ONLY,)(__VA_ARGS__))
 Defines a named type (to use for classes). More...
 
#define ENTT_ENTITY_ACTOR_HPP
 
#define ENTT_ENTITY_REGISTRY_HPP
 
#define ENTT_SIGNAL_DELEGATE_HPP
 
#define ENTT_SIGNAL_SIGH_HPP
 
#define ENTT_SIGNAL_FWD_HPP
 
#define ENTT_ENTITY_RUNTIME_VIEW_HPP
 
#define ENTT_ENTITY_SPARSE_SET_HPP
 
#define ENTT_ENTITY_ENTITY_HPP
 
#define ENTT_ENTITY_FWD_HPP
 
#define ENTT_ENTITY_SNAPSHOT_HPP
 
#define ENTT_ENTITY_STORAGE_HPP
 
#define ENTT_ENTITY_UTILITY_HPP
 
#define ENTT_ENTITY_GROUP_HPP
 
#define ENTT_ENTITY_VIEW_HPP
 
#define ENTT_ENTITY_HELPER_HPP
 
#define ENTT_ENTITY_OBSERVER_HPP
 
#define ENTT_LOCATOR_LOCATOR_HPP
 
#define ENTT_META_FACTORY_HPP
 
#define ENTT_META_POLICY_HPP
 
#define ENTT_META_META_HPP
 
#define ENTT_PROCESS_PROCESS_HPP
 
#define ENTT_PROCESS_SCHEDULER_HPP
 
#define ENTT_RESOURCE_CACHE_HPP
 
#define ENTT_RESOURCE_HANDLE_HPP
 
#define ENTT_RESOURCE_FWD_HPP
 
#define ENTT_RESOURCE_LOADER_HPP
 
#define ENTT_SIGNAL_DISPATCHER_HPP
 
#define ENTT_SIGNAL_EMITTER_HPP
 

Typedefs

using entt::hashed_string = basic_hashed_string< char >
 Aliases for common character types. More...
 
using entt::hashed_wstring = basic_hashed_string< wchar_t >
 Aliases for common character types. More...
 
template<typename... List>
using entt::type_list_cat_t = typename type_list_cat< List... >::type
 Helper type. More...
 
template<typename Type >
using entt::type_list_unique_t = typename type_list_unique< Type >::type
 Helper type. More...
 
template<typename Type >
using entt::named_type_traits_t = typename named_type_traits< Type >::type
 Helper type. More...
 
using entt::registry = basic_registry< entity >
 Alias declaration for the most common use case. More...
 
using entt::observer = basic_observer< entity >
 Alias declaration for the most common use case. More...
 
using entt::actor = basic_actor< entity >
 Alias declaration for the most common use case. More...
 
using entt::snapshot = basic_snapshot< entity >
 Alias declaration for the most common use case. More...
 
using entt::snapshot_loader = basic_snapshot_loader< entity >
 Alias declaration for the most common use case. More...
 
using entt::continuous_loader = basic_continuous_loader< entity >
 Alias declaration for the most common use case. More...
 
template<typename... Types>
using entt::view = basic_view< entity, Types... >
 Alias declaration for the most common use case. More...
 
using entt::runtime_view = basic_runtime_view< entity >
 Alias declaration for the most common use case. More...
 
template<typename... Types>
using entt::group = basic_group< entity, Types... >
 Alias declaration for the most common use case. More...
 
template<ENTT_ID_TYPE Value>
using entt::tag = std::integral_constant< ENTT_ID_TYPE, Value >
 Alias template to ease the assignment of tags to entities. More...
 

Functions

template<typename Type , typename Class >
constexpr auto entt::overload (Type Class::*member) ENTT_NOEXCEPT
 Constant utility to disambiguate overloaded member functions. More...
 
template<typename Type >
constexpr auto entt::overload (Type *func) ENTT_NOEXCEPT
 Constant utility to disambiguate overloaded functions. More...
 
template<class... Type>
 entt::overloaded (Type...) -> overloaded< Type... >
 Deduction guide. More...
 
template<typename Char , std::size_t N>
 entt::basic_hashed_string (const Char(&str)[N]) ENTT_NOEXCEPT -> basic_hashed_string< Char >
 Deduction guide. More...
 
template<typename Char >
constexpr bool entt::operator!= (const basic_hashed_string< Char > &lhs, const basic_hashed_string< Char > &rhs) ENTT_NOEXCEPT
 Compares two hashed strings. More...
 
constexpr entt::hashed_string operator""ENTT_HS_SUFFIX (const char *str, std::size_t) ENTT_NOEXCEPT
 User defined literal for hashed strings. More...
 
constexpr entt::hashed_wstring operator""ENTT_HWS_SUFFIX (const wchar_t *str, std::size_t) ENTT_NOEXCEPT
 User defined literal for hashed wstrings. More...
 
template<typename Ret , typename... Args>
bool entt::operator!= (const delegate< Ret(Args...)> &lhs, const delegate< Ret(Args...)> &rhs) ENTT_NOEXCEPT
 Compares the contents of two delegates. More...
 
template<auto Function>
 entt::delegate (connect_arg_t< Function >) ENTT_NOEXCEPT -> delegate< std::remove_pointer_t< internal::to_function_pointer_t< decltype(Function)>>>
 Deduction guide. More...
 
template<auto Candidate, typename Type >
 entt::delegate (connect_arg_t< Candidate >, Type &) ENTT_NOEXCEPT -> delegate< std::remove_pointer_t< internal::to_function_pointer_t< decltype(Candidate), Type * >>>
 Deduction guide. More...
 
template<auto Candidate, typename Type >
 entt::delegate (connect_arg_t< Candidate >, Type *) ENTT_NOEXCEPT -> delegate< std::remove_pointer_t< internal::to_function_pointer_t< decltype(Candidate), Type * >>>
 Deduction guide. More...
 
template<typename Ret , typename... Args>
 entt::sink (sigh< Ret(Args...)> &) ENTT_NOEXCEPT -> sink< Ret(Args...)>
 Deduction guide. More...
 
 entt::ENTT_OPAQUE_TYPE (entity, ENTT_ID_TYPE)
 Alias declaration for the most common use case. More...
 
 entt::ENTT_OPAQUE_TYPE (component, ENTT_ID_TYPE)
 Alias declaration for the most common use case. More...
 
template<typename Entity >
 entt::as_view (basic_registry< Entity > &) ENTT_NOEXCEPT -> as_view< false, Entity >
 Deduction guide. More...
 
template<typename Entity >
 entt::as_view (const basic_registry< Entity > &) ENTT_NOEXCEPT -> as_view< true, Entity >
 Deduction guide. More...
 
template<typename Entity >
 entt::as_group (basic_registry< Entity > &) ENTT_NOEXCEPT -> as_group< false, Entity >
 Deduction guide. More...
 
template<typename Entity >
 entt::as_group (const basic_registry< Entity > &) ENTT_NOEXCEPT -> as_group< true, Entity >
 Deduction guide. More...
 
bool entt::operator!= (const meta_any &lhs, const meta_any &rhs) ENTT_NOEXCEPT
 Checks if two containers differ in their content. More...
 
bool entt::operator!= (const meta_prop &lhs, const meta_prop &rhs) ENTT_NOEXCEPT
 Checks if two meta objects refer to the same node. More...
 
bool entt::operator!= (const meta_base &lhs, const meta_base &rhs) ENTT_NOEXCEPT
 Checks if two meta objects refer to the same node. More...
 
bool entt::operator!= (const meta_conv &lhs, const meta_conv &rhs) ENTT_NOEXCEPT
 Checks if two meta objects refer to the same node. More...
 
bool entt::operator!= (const meta_ctor &lhs, const meta_ctor &rhs) ENTT_NOEXCEPT
 Checks if two meta objects refer to the same node. More...
 
bool entt::operator!= (const meta_dtor &lhs, const meta_dtor &rhs) ENTT_NOEXCEPT
 Checks if two meta objects refer to the same node. More...
 
bool entt::operator!= (const meta_data &lhs, const meta_data &rhs) ENTT_NOEXCEPT
 Checks if two meta objects refer to the same node. More...
 
bool entt::operator!= (const meta_func &lhs, const meta_func &rhs) ENTT_NOEXCEPT
 Checks if two meta objects refer to the same node. More...
 
bool entt::operator!= (const meta_type &lhs, const meta_type &rhs) ENTT_NOEXCEPT
 Checks if two meta objects refer to the same node. More...
 
template<typename Type >
meta_factory< Type > entt::meta () ENTT_NOEXCEPT
 Utility function to use for reflection. More...
 
template<typename Type >
meta_type entt::resolve () ENTT_NOEXCEPT
 Returns the meta type associated with a given type. More...
 
meta_type entt::resolve (const ENTT_ID_TYPE identifier) ENTT_NOEXCEPT
 Returns the meta type associated with a given identifier. More...
 
template<typename Op >
std::enable_if_t< std::is_invocable_v< Op, meta_type >, void > entt::resolve (Op op) ENTT_NOEXCEPT
 Iterates all the reflected types. More...
 

Variables

template<ENTT_ID_TYPE Value>
monostate< Value > entt::monostate_v = {}
 Helper variable template. More...
 
template<std::size_t N>
constexpr choice_t< N > entt::choice {}
 Variable template for the choice trick. More...
 
template<class List >
constexpr auto entt::type_list_size_v = type_list_size<List>::value
 Helper variable template. More...
 
template<class Type >
constexpr auto entt::is_equality_comparable_v = is_equality_comparable<Type>::value
 Helper variable template. More...
 
template<class Type >
constexpr auto entt::named_type_traits_v = named_type_traits<Type>::value
 Helper variable template. More...
 
template<class Type >
constexpr auto entt::is_named_type_v = is_named_type<Type>::value
 Helper variable template. More...
 
template<auto Func>
constexpr connect_arg_t< Func > entt::connect_arg {}
 Constant of type connect_arg_t used to disambiguate calls. More...
 
constexpr auto entt::null = internal::null{}
 Compile-time constant for null entities. More...
 
template<typename... Type>
constexpr exclude_t< Type... > entt::exclude {}
 Variable template for exclusion lists. More...
 
template<typename... Type>
constexpr get_t< Type... > entt::get {}
 Variable template for lists of observed components. More...
 
constexpr basic_collector entt::collector {}
 Variable template used to ease the definition of collectors. More...
 
constexpr as_alias_t entt::as_alias
 Disambiguation tag. More...
 

Macro Definition Documentation

◆ ENTT_ASSERT

#define ENTT_ASSERT (   condition)    assert(condition)

◆ ENTT_CONFIG_CONFIG_H

#define ENTT_CONFIG_CONFIG_H

◆ ENTT_CORE_ALGORITHM_HPP

#define ENTT_CORE_ALGORITHM_HPP

◆ ENTT_CORE_FAMILY_HPP

#define ENTT_CORE_FAMILY_HPP

◆ ENTT_CORE_HASHED_STRING_HPP

#define ENTT_CORE_HASHED_STRING_HPP

◆ ENTT_CORE_IDENT_HPP

#define ENTT_CORE_IDENT_HPP

◆ ENTT_CORE_MONOSTATE_HPP

#define ENTT_CORE_MONOSTATE_HPP

◆ ENTT_CORE_TYPE_TRAITS_HPP

#define ENTT_CORE_TYPE_TRAITS_HPP

◆ ENTT_CORE_UTILITY_HPP

#define ENTT_CORE_UTILITY_HPP

◆ ENTT_ENABLE_ETO

#define ENTT_ENABLE_ETO (   Type)    std::is_empty_v<Type>

◆ ENTT_ENTITY_ACTOR_HPP

#define ENTT_ENTITY_ACTOR_HPP

◆ ENTT_ENTITY_ENTITY_HPP

#define ENTT_ENTITY_ENTITY_HPP

◆ ENTT_ENTITY_FWD_HPP

#define ENTT_ENTITY_FWD_HPP

◆ ENTT_ENTITY_GROUP_HPP

#define ENTT_ENTITY_GROUP_HPP

◆ ENTT_ENTITY_HELPER_HPP

#define ENTT_ENTITY_HELPER_HPP

◆ ENTT_ENTITY_OBSERVER_HPP

#define ENTT_ENTITY_OBSERVER_HPP

◆ ENTT_ENTITY_REGISTRY_HPP

#define ENTT_ENTITY_REGISTRY_HPP

◆ ENTT_ENTITY_RUNTIME_VIEW_HPP

#define ENTT_ENTITY_RUNTIME_VIEW_HPP

◆ ENTT_ENTITY_SNAPSHOT_HPP

#define ENTT_ENTITY_SNAPSHOT_HPP

◆ ENTT_ENTITY_SPARSE_SET_HPP

#define ENTT_ENTITY_SPARSE_SET_HPP

◆ ENTT_ENTITY_STORAGE_HPP

#define ENTT_ENTITY_STORAGE_HPP

◆ ENTT_ENTITY_UTILITY_HPP

#define ENTT_ENTITY_UTILITY_HPP

◆ ENTT_ENTITY_VIEW_HPP

#define ENTT_ENTITY_VIEW_HPP

◆ ENTT_EXPAND

#define ENTT_EXPAND (   args)    args

Utility macro to deal with an issue of MSVC.

See msvc-doesnt-expand-va-args-correctly on SO for all the details.

Parameters
argsArgument to expand.

◆ ENTT_HS_SUFFIX

#define ENTT_HS_SUFFIX   _hs

◆ ENTT_HWS_SUFFIX

#define ENTT_HWS_SUFFIX   _hws

◆ ENTT_ID_TYPE

#define ENTT_ID_TYPE   std::uint32_t

◆ ENTT_LOCATOR_LOCATOR_HPP

#define ENTT_LOCATOR_LOCATOR_HPP

◆ ENTT_MAYBE_ATOMIC

#define ENTT_MAYBE_ATOMIC (   Type)    std::atomic<Type>

◆ ENTT_META_FACTORY_HPP

#define ENTT_META_FACTORY_HPP

◆ ENTT_META_META_HPP

#define ENTT_META_META_HPP

◆ ENTT_META_POLICY_HPP

#define ENTT_META_POLICY_HPP

◆ ENTT_NAMED_CLASS

#define ENTT_NAMED_CLASS (   ...)    ENTT_EXPAND(ENTT_NAMED_CLASS_MACRO(__VA_ARGS__, ENTT_NAMED_CLASS_WITH_NAMESPACE, ENTT_NAMED_CLASS_ONLY,)(__VA_ARGS__))

Defines a named type (to use for classes).

◆ ENTT_NAMED_CLASS_MACRO

#define ENTT_NAMED_CLASS_MACRO (   _1,
  _2,
  _3,
  FUNC,
  ... 
)    FUNC

Utility function to simulate macro overloading.

◆ ENTT_NAMED_CLASS_ONLY

#define ENTT_NAMED_CLASS_ONLY (   clazz,
  body 
)
Value:
class clazz body;\
ENTT_NAMED_TYPE(clazz)

Defines a named type (to use for classes).

Parameters
clazzName of the type to define.
bodyBody of the type to define.

◆ ENTT_NAMED_CLASS_WITH_NAMESPACE

#define ENTT_NAMED_CLASS_WITH_NAMESPACE (   ns,
  clazz,
  body 
)
Value:
namespace ns { class clazz body; }\
ENTT_NAMED_TYPE(ns::clazz)

Defines a named type (to use for classes).

Parameters
nsNamespace where to define the named type.
clazzName of the type to define.
bodyBody of the type to define.

◆ ENTT_NAMED_STRUCT

#define ENTT_NAMED_STRUCT (   ...)    ENTT_EXPAND(ENTT_NAMED_STRUCT_OVERLOAD(__VA_ARGS__, ENTT_NAMED_STRUCT_WITH_NAMESPACE, ENTT_NAMED_STRUCT_ONLY,)(__VA_ARGS__))

Defines a named type (to use for structs).

◆ ENTT_NAMED_STRUCT_ONLY

#define ENTT_NAMED_STRUCT_ONLY (   clazz,
  body 
)
Value:
struct clazz body;\
ENTT_NAMED_TYPE(clazz)

Defines a named type (to use for structs).

Parameters
clazzName of the type to define.
bodyBody of the type to define.

◆ ENTT_NAMED_STRUCT_OVERLOAD

#define ENTT_NAMED_STRUCT_OVERLOAD (   _1,
  _2,
  _3,
  FUNC,
  ... 
)    FUNC

Utility function to simulate macro overloading.

◆ ENTT_NAMED_STRUCT_WITH_NAMESPACE

#define ENTT_NAMED_STRUCT_WITH_NAMESPACE (   ns,
  clazz,
  body 
)
Value:
namespace ns { struct clazz body; }\
ENTT_NAMED_TYPE(ns::clazz)

Defines a named type (to use for structs).

Parameters
nsNamespace where to define the named type.
clazzName of the type to define.
bodyBody of the type to define.

◆ ENTT_NAMED_TYPE

#define ENTT_NAMED_TYPE (   type)
Value:
template<>\
: std::integral_constant<ENTT_ID_TYPE, entt::basic_hashed_string<std::remove_cv_t<std::remove_pointer_t<std::decay_t<decltype(#type)>>>>{#type}>\
{\
static_assert(std::is_same_v<std::remove_cv_t<type>, type>);\
static_assert(std::is_object_v<type>);\
}
#define ENTT_ID_TYPE
Definition: entt.hpp:58
Zero overhead unique identifier.
Definition: entt.hpp:413
Traits class used mainly to push things across boundaries.
Definition: entt.hpp:1226

Makes an already existing type a named type.

The current definition contains a workaround for Clang 6 because it fails to deduce correctly the type to use to specialize the class template.
With a compiler that fully supports C++17 and works fine with deduction guides, the following should be fine instead:

std::integral_constant<ENTT_ID_TYPE, entt::basic_hashed_string{#type}>

In order to support even sligthly older compilers, I prefer to stick to the implementation below.

Parameters
typeType to assign a name to.

◆ ENTT_NOEXCEPT

#define ENTT_NOEXCEPT   noexcept

◆ ENTT_OPAQUE_TYPE

#define ENTT_OPAQUE_TYPE (   clazz,
  type 
)
Value:
enum class clazz: type {};\
constexpr auto to_integer(const clazz id) ENTT_NOEXCEPT {\
return std::underlying_type_t<clazz>(id);\
}\
static_assert(true)
#define ENTT_NOEXCEPT
Definition: entt.hpp:25

Defines an enum class to use for opaque identifiers and a dedicate to_integer function to convert the identifiers to their underlying type.

Parameters
clazzThe name to use for the enum class.
typeThe underlying type for the enum class.

◆ ENTT_PAGE_SIZE

#define ENTT_PAGE_SIZE   32768

◆ ENTT_PROCESS_PROCESS_HPP

#define ENTT_PROCESS_PROCESS_HPP

◆ ENTT_PROCESS_SCHEDULER_HPP

#define ENTT_PROCESS_SCHEDULER_HPP

◆ ENTT_RESOURCE_CACHE_HPP

#define ENTT_RESOURCE_CACHE_HPP

◆ ENTT_RESOURCE_FWD_HPP

#define ENTT_RESOURCE_FWD_HPP

◆ ENTT_RESOURCE_HANDLE_HPP

#define ENTT_RESOURCE_HANDLE_HPP

◆ ENTT_RESOURCE_LOADER_HPP

#define ENTT_RESOURCE_LOADER_HPP

◆ ENTT_SIGNAL_DELEGATE_HPP

#define ENTT_SIGNAL_DELEGATE_HPP

◆ ENTT_SIGNAL_DISPATCHER_HPP

#define ENTT_SIGNAL_DISPATCHER_HPP

◆ ENTT_SIGNAL_EMITTER_HPP

#define ENTT_SIGNAL_EMITTER_HPP

◆ ENTT_SIGNAL_FWD_HPP

#define ENTT_SIGNAL_FWD_HPP

◆ ENTT_SIGNAL_SIGH_HPP

#define ENTT_SIGNAL_SIGH_HPP

Function Documentation

◆ operator""ENTT_HS_SUFFIX()

constexpr entt::hashed_string operator""ENTT_HS_SUFFIX ( const char *  str,
std::size_t   
)

User defined literal for hashed strings.

Parameters
strThe literal without its suffix.
Returns
A properly initialized hashed string.

◆ operator""ENTT_HWS_SUFFIX()

constexpr entt::hashed_wstring operator""ENTT_HWS_SUFFIX ( const wchar_t *  str,
std::size_t   
)

User defined literal for hashed wstrings.

Parameters
strThe literal without its suffix.
Returns
A properly initialized hashed wstring.