Skip to content

Releases: skypjack/entt

EnTT v3.5.1

04 Sep 08:40
Compare
Choose a tag to compare

Changelog:

  • entity:

    • Fixed an issue in the observer class with exclusion lists.
    • Updated difference_type for 32b identifiers.
    • Removed support for 16b identifiers.
  • test:

    • Make all tests work despite the aggressive comdat folding on Windows in release mode.

The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.

EnTT v3.5.0

31 Aug 20:50
Compare
Choose a tag to compare

Changelog

  • core:

    • Added type_info::name member function.
    • Added unpack_as_t and unpack_as_v utilities as type traits.
    • Added is_eto_eligible[_v] utility for internal purposes.
  • entity:

    • entt_traits: updated types for difference_type.
    • registry::remove_if_exists returns the number of elements actually removed.
    • Added an overload of registry::sortable for groups.
    • Relaxed requirements on types from at least copyable to at least movable for the snapshot class.
    • entt_traits as sfinae-friendly class template to allow user defined custom identifiers other than enum classes.
    • to_integral no longer depends on identifiers, it works instead for all types for which a specialization of entt_traits exists.
    • Added the non-owning entt::handle class to wrap a couple entity/registry and pass it as argument to functions.
    • Made entt::null_t publicly available.
    • Added view::proxy member function that returns an iterable object to visit entities and components at once.
    • Added group::proxy member function that returns an iterable object to visit entities and components at once.
    • entt::to_entity function that returns the entity associated with a given component.
    • Runtime views also support excluded components.
    • Added a sfinae-friendly utility for component-to-pool conversions.
    • Chunked iteration for multi-component views.
    • Added reverse iterators, rbegin and rend to sparse_sets.
    • Added reverse iterators, rbegin and rend to storages.
    • Added reverse iterators, rbegin and rend to groups.
    • Added reverse iterators, rbegin and rend to views.
    • views use only stable candidates and refresh them less frequently.
  • meta

    • Allowed null setters on meta data members (explicit read-only mode).
    • .data<&clazz::member> is now an alias of .data<&clazz::member, &clazz::member> and therefore supports non-const to const conversion for data members (literally .data<nullptr, &clazz::member>).
    • Defined a meta_range<T> iterable type to visit all meta objects of a given type.
    • Added an overload of meta_ctor::prop that returns an iterable object to visit all properties.
    • Added an overload of meta_data::prop that returns an iterable object to visit all properties.
    • Added an overload of meta_func::prop that returns an iterable object to visit all properties.
    • Added an overload of meta_type::base that returns an iterable object to visit all bases.
    • Added an overload of meta_type::conv that returns an iterable object to visit all conversion functions.
    • Added an overload of meta_type::ctor that returns an iterable object to visit all constructors.
    • Added an overload of meta_type::data that returns an iterable object to visit all data members.
    • Added an overload of meta_type::func that returns an iterable object to visit all member functions.
    • Added an overload of meta_type::prop that returns an iterable object to visit all properties.
    • resolve offers an overload that returns an iterable object to visit all meta types.
    • meta_type::rank returns the rank of an array when the meta type wraps a C-style array, 0 otherwise.
    • meta_type::extent accepts also the dimension (default to 0).
    • meta_handle is now copyable.
    • Built-in support for containers.
    • Built-in support for pointer-like types.
    • meta_any::operator* dereferences the wrapped element in case of pointer-like types and returns a wrapper for the pointed object.
    • Meta constructors and meta functions also accept a meta_any * + size pair.
    • Added meta_type::reset member function to reset meta types and remove them from the list of searchable types.
  • platform:

    • Added a support file to use EnTT on Android with the NDK r17.
  • signal:

    • delegate supports runtime parameters with optional payload.
    • delegate accepts non-capturing lambda functions as runtime parameters.
    • dispatcher::enqueue supports also aggregates.
    • Added opaque disconnect function to dispatcher.
    • The event passed to the listeners of a dispatcher isn't const by default anymore.
    • The event passed to the listeners of an emitter isn't const by default anymore.
  • type_index based lookup is now an opt-in alternative for standalone applications and no longer the default.

  • Added a new section in the wiki about the available definitions to be used to tune the library.

  • Added meaningful messages to static asserts.

  • [[nodiscard]] everywhere.

  • Performance improvements here and there (sparse set expansion, ...).

Breaking changes

  • core:

    • ENTT_OPAQUE_TYPE is no longer available, define your own enum class or custom type instead.
  • entity:

    • group::sortable is no longer available, use registry::sortable.
  • meta:

    • meta_type::set and meta_type::get overloads to work with the i-th element of a C-style array are no longer available.
    • meta_any::operator* is not longer an alias for ref and dereferences pointer-like elements instead.
    • meta_ctor::prop with callback is no longer available, use the overload of meta_ctor::prop that returns an iterable object.
    • meta_data::prop with callback is no longer available, use the overload of meta_data::prop that returns an iterable object.
    • meta_func::prop with callback is no longer available, use the overload of meta_func::prop that returns an iterable object.
    • meta_type::base with callback is no longer available, use the overload of meta_type::base that returns an iterable object.
    • meta_type::conv with callback is no longer available, use the overload of meta_type::conv that returns an iterable object.
    • meta_type::ctor with callback is no longer available, use the overload of meta_type::ctor that returns an iterable object.
    • meta_type::data with callback is no longer available, use the overload of meta_type::data that returns an iterable object.
    • meta_type::func with callback is no longer available, use the overload of meta_type::func that returns an iterable object.
    • meta_type::prop with callback is no longer available, use the overload of meta_type::prop that returns an iterable object.
    • resolve with callback is no longer available, use the overload of resolve that returns an iterable object.
    • resolve_if is no longer available, use the overload of resolve that returns an iterable object.
    • meta_factory<...>::reset has been replaced by meta_type::reset.
  • resource:

    • cache has been renamed to resource_cache.
    • handle has been renamed to resource_handle.
    • loader has been renamed to resource_loader.
  • signal:

    • Renaming of exported functions: delegate::function_type becomes delegate::type.

Deprecated features

All previously deprecated functions and classes have been removed.
This is the list of features deprecated with this release:

  • entity:
    • The actor class will be removed in a future release.

Examples

  • Added an example of custom identifier that isn't an enum class and is initialized with entt::null by default.

Any other business

The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
I've also updated the FAQs and the section EnTT in Action with more and more examples.

I started a long term process to reduce the number of instantiations and therefore speed up the compilation.
This release contains some more changes in this regard. Still a work in progress though.

EnTT v3.4.0

09 May 21:50
Compare
Choose a tag to compare

Changelog

  • config:

    • Added ENTT_IS_EMPTY as an opaque way to recognize empty types (ENTT_DISABLE_ETO affects also this variable).
  • core:

    • Added entt::id_type as an user-friendly alternative for ENTT_ID_TYPE.
    • Added the entt::type_index class sfinae-friendly template to assign library wide sequential identifiers to types.
    • Added entt::has_type_index[_v] to know if a given type T has assigned a library wide sequential identifier.
    • Added entt::integral_constant as a shortcut for its standard counterpart.
  • entity:

    • Added registry::remove_all to orphan entities.
    • Added registry::patch<T> to replace an object in-place.
    • Added registry::on_update<T> to attach listeners to observe changes.
    • Added registry::emplace<T> to assign components to multiple entities at once.
    • Added registry::insert<T> to assign components to entities.
    • Added registry::get_or_emplace<T> get a component and construct it if it doesn't exist yet.
    • registry::replace from arguments is no longer deprecated and still available.
    • Added storage<T>::emplace to assign objects to entities.
    • Added storage<T>::insert to assign objects to multiple entities at once.
    • Added sparse_set::emplace to assign objects to entities.
    • Added sparse_set::insert to assign objects to multiple entities at once.
    • Added entt::invoke, a shortcut to invoke members on components from callbacks.
    • Added registry::destroy with suggested version.
  • meta:

    • Added meta_type::detach to make it possible to detach meta type from contexts (for example, during a visit).
    • Added a reviewed version of meta_factory::type that uses type_info<T>::id() as a default initializer.
    • Added meta_type::type_id to get the type id of the underlying (erased) type.
    • Added entt::resolve_if to lookup meta types using custom predicates.
    • Added entt::resolve_id to lookup meta types by identifier.
    • Added entt::resolve_type to lookup meta types by type id.
    • Added meta_any::ref to invoke aliasing constructor and get references to unmanaged objects.
  • Performance improvements here and there (more devirtualization, less branches, ...).

Build system

  • homebrew-entt is automatically updated on tags.
  • Updated installation process.

EnTT across boundaries

It turned out that the latest version had a problem when multiple registries containing different component types were used concurrently from different threads (see #449 for further details).
Because of this, the way used to make EnTT work across boundaries has changed and has been further refined. There exist now two paths within some of the data structure available in EnTT: the default one (also known as indexed access) based on the type_index class and its fallback based on the type_info class.

In particular:

  • When EnTT is used standalone and its main classes (such as the registry) are not pushed across boundaries, there is nothing to worry about.

  • In case of linked libraries and when exporting the necessary symbols isn't a problem, use the ENTT_API_IMPORT and ENTT_API_EXPORT definitions as appropriate. This will make EnTT use the indexed access even across boundaries.

  • In all other cases, suppress the index generation to force EnTT to use a fallback:

    template<typename Type>
    struct entt::type_index<Type> {};
    

    It's recommended to use range operations as much as possible in this case.

The lib directory contains many examples for who's interested in the topic.
The meta system has not undergone any changes since its previous version.

Breaking changes

  • Empty types are no longer returned nor are they available in any case.
    • The storage class for empty types doesn't offer anymore get, try_get and so on.
    • Views and groups no longer return empty types during a call to each and don't allow anymore to get an empty type for an entity.
    • ENTT_DISABLE_ETO is no longer considered, use ENTT_NO_ETO instead.
    • ENTT_ENABLE_ETO is no longer exported, use ENTT_IS_EMPTY instead.
  • iterator_type aliases have been renamed to iterator for better integration.
  • meta_type::id returns the type identifier rather than the type id.
  • basic_snapshot<T>::entities stores aside also destroyed entities, not only the ones still alive.
  • basic_snapshot_loader<T>::entities expects also destroyed entities, not only the ones still alive.
  • basic_continuous_loader<T>::entities expects also destroyed entities, not only the ones still alive.

Deprecated functions

All previously deprecated functions and classes have been removed.
This is the list of features deprecated with this release:

  • registry::replace with callbacks, use registry::patch instead.
  • registry::on_replace, use registry::on_update instead.
  • registry::assign<T> for a single entity, use registry::emplace<T> instead.
  • registry::assign<T> for multiple entities, use registry::insert<T> instead.
  • registry::get_or_assign<T>, use registry::get_or_emplace<T> instead.
  • registry::snapshot, basic_snapshot<T> has now a constructor that accepts a reference to a registry.
  • registry::loader, basic_snapshot_loader<T> has now a constructor that accepts a reference to a registry.
  • storage<T>::construct for a single entity, use storage<T>::emplace instead.
  • storage<T>::construct for multiple entities, use storage<T>::insert instead.
  • storage<T>::destroy, use storage<T>::erase instead.
  • sparse_set::construct for a single entity, use sparse_set::emplace instead.
  • sparse_set::construct for multiple entities, use sparse_set::insert instead.
  • sparse_set::destroy, use sparse_set::erase instead.
  • sparse_set::has, use sparse_set::contains instead.
  • group::less, use group::each instead.
  • view::less, use view::each instead.
  • meta_factory::alias, use meta_factory::type instead.
  • meta_type::alias, use meta_type::id instead.
  • meta_data::alias, use meta_data::id instead.
  • meta_func::alias, use meta_func::id instead.
  • entt::as_alias_t and entt::as_alias, use entt::as_ref_t and entt::as_ref instead.
  • entt::resolve by identifier, use entt::resolve_id instead.
  • observer::replace, use observer::update instead.
  • basic_snapshot<T>::destroyed, use basic_snapshot<T>::entities instead.
  • basic_snapshot_loader<T>::destroyed, use basic_snapshot_loader<T>::entities instead.
  • basic_continuous_loader<T>::destroyed, use basic_continuous_loader<T>::entities instead.
  • basic_continuous_loader::has, use basic_continuous_loader::contains instead.

Any other business

The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
I've also updated the FAQs and the section EnTT in Action with more and more examples.

I started a long term process to reduce the number of instantiations and therefore speed up the compilation.
This release contains some more changes in this regard. Still a work in progress though.

EnTT v3.3.2

07 Mar 17:46
Compare
Choose a tag to compare

Changelog:

  • sparse_set:
    • Removed copy ctor/assignment operator.
  • registry:
    • Fixed a bug that involved late group initialization.
  • Added an experimental workflow to automate the update of homebrew-entt (deploy.yml, --dry-run mode).
  • Updated build system (install process).

The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
I've also updated the section EnTT in Action with more and more examples and links.

The long term process to reduce the number of instantiations and therefore speed up the compilation continues.
This release contains some changes in this regard. Still a work in progress though.

EnTT v3.3.1

28 Feb 22:56
Compare
Choose a tag to compare

Changelog:

  • config
    • Updated requirements for ETO, types must also be default constructible.
  • registry
    • Suppressed some warnings with MSVC.
    • assign_or_replace works also with aggregates now.
  • Re-added bazel support (thanks to @zaucy for that).

The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.

EnTT v3.3.0

22 Feb 14:49
Compare
Choose a tag to compare

Changelog:

  • config
    • Using atomics is no longer the default (ENTT_NO_ATOMIC became ENTT_USE_ATOMIC).
    • ENTT_DISABLE_ASSERT no longer exists, ENTT_ASSERT can be redefined now.
  • hashed_string
    • Static to_value renamed to value.
    • The helper function is no longer recursive (long names are now accepted).
  • delegate:
    • Support for unbound members (data and functions).
  • sigh/sink:
    • Support for unbound members (data and functions).
  • sparse_set:
    • Renamed reset to clear.
  • storage:
    • Renamed reset to clear.
    • Added range-construct.
  • registry
    • registry::create doesn't accept anymore a list of default constructible types to assign.
    • Added any to know if an entity has any component from a set.
    • Added range-assign by copy and range-assign from ranges.
    • Added create with hint.
    • Added range-remove
    • Added multi-component remove.
    • Added clear as a replacement for reset<T>() and reset().
    • Added remove_if_exists as a replacement for reset<T>(entity).
    • Added data to get the internal representation of entities (serialization purposes).
    • Added an overload to assign to assign entities to an empty registry (serialization purposes).
    • Added a visit overload to return the runtime identifiers for the components managed by a registry.
    • Added a visit overload to return the runtime identifiers for the components owned by an entity.
    • Added a ctx overload to return the runtime identifiers for the context variables stored in a registry.
    • Added in-place replace member function, deprecated old replace-with-arguments.
    • Added single component prepare functionality (suitable for custom pools).
    • Removed misplaced assert from clone and stomp functionalities.
    • Removed reset member functions (use remove and clear instead).
    • Removed range-stomp.
    • Renamed stomp to stamp.
    • Removed spawning create.
    • Pool access is no always O(1) after the warm-up (it was O(N) before in case of named types).
    • Updated assign to make it stable in case listeners mess with components.
    • Callbacks no longer receive components, use the registry and the entity to get them.
    • Callbacks receive the registry as the first parameter, then the entity.
    • Deprecated stamp and clone (see updated doc for more details).
  • view
    • All iterators are at least bidirectional.
    • Much faster contains.
    • Added front and back to get the first and the last entities.
  • group
    • All iterators are at least bidirectional.
    • Much faster contains.
    • Added front and back to get the first and the last entities.
  • meta
    • Added support for properties to opaque meta types.
    • Added support for non-copyable types to meta_any.
    • Added alias member function to factory and deprecated type.
    • Added alias member function to all meta objects and deprecated identifier.
    • Added meta_type::id to get the underlying type id (see type_info<T>::id for more details).
  • dispatcher
    • Renamed discard in clear for consistency.
  • type_traits
    • Added member_class and member_class_t to get the class from a pointer-to-member type.
  • attribute (new)
    • ENTT_EXPORT, ENTT_IMPORT, ENTT_API, ...
  • type_info (new)
    • Full featured, SFINAE-friendly type_info class template used to provide consistent identifiers and allow custom generators (id static member function).
    • Non-standard compile-time solution and standard runtime fallback that work in 99% of cases.
  • EnTT across boundaries
    • Named types are no longer available nor required.
    • EnTT works across boundaries transparently in many cases now and supports per-type and per-feature generators if required.
  • Renamed to_integer in to_integral (see ENTT_OPAQUE_TYPE for custom identifiers).
  • entt::component doesn't exist anymore (use entt::type_info<T>::id() instead).
  • Full noexcept-ness review.
  • Updated forward-.hpp files.
  • Removed support for Bazel (no longer maintained by community).
  • Removed mod example (there are now better ways to write a plugin system).
  • Performance improvements here and there (eg sparse_set and meta).
  • Reduced compilation time (work in progress).
  • Updated build system (more modern cmake, less warnings with very strict checks).

Be aware that this release contains some non-backward compatible changes.
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
I've also updated the FAQs and the section EnTT in Action with more and more examples.

I started a long term process to reduce the number of instantiations and therefore speed up the compilation.
This release already contains some changes in this regard. Still a work in progress though.

EnTT v3.2.2

19 Dec 14:17
Compare
Choose a tag to compare

Changelog:

  • Workaround for a bug of MSVC (since version 19.24.28314.0).
  • Minor changes to the codebase for maintainability purposes.

The documentation is up-to-date.

EnTT v3.2.1

26 Nov 14:18
Compare
Choose a tag to compare

Changelog:

  • The family class no longer decays types implicitly.
  • It's now possible to attach the same meta properties to a meta type after a reset.
  • It's now possible to sort empty types by means of their entities.
  • Suppressed all shadow warnings.
  • Updated test suite.

The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.

EnTT v3.2.0

29 Oct 21:10
Compare
Choose a tag to compare

Changelog:

  • Added EnTT to the GitHub Sponsors program (link in the README file).
  • Added the try online badge to the README file.
  • Moved CI to GH Actions.
  • Use codecov instead of coveralls.
  • Relaxed constraints on the order of types in the group definition.
  • The runtime reflection system finally works across boundaries.
  • In-depth review of the runtime reflection system, backward compatibility not guaranteed.
  • Key/Value pairs, key-only properties, tuples and annotations (invocable) are allowed as meta properties.
  • meta_any uses std::reference_wrapper instead of as_alias_t for aliasing.
  • Added meta_type::compare, meta_any no longer has to store aside comparison functions.
  • New meta_any constructor for unmanaged objects taken from a meta_handle.
  • meta_handle no longer exposes data/try_cast.
  • All meta functions take their arguments by alias and can edit objects in the outer context.
  • Introduced meta_type::remove_extent to get the meta type of the elements of an array.
  • A static assertion forbids using non-copyable types with meta_any.
  • Added dispatcher::discard to clear pools of events.
  • Invocation order guaranteed for signals (sigh, registry, dispatcher, ...).
  • Overloaded sink::before function to insert listeners at specific locations in the signal.
  • sink::disconnect and sink::before support also pointers as instances or payload.
  • delegate supports also pointers as instances or payload.
  • sparse_set::swap and storage::swap accept entities, no longer positions.
  • Sorting pools doesn't require to allocate anymore and is much faster.
  • stomp & spawn work also with const source registries now.
  • Make empty components eat arguments on construction.
  • Multi-component version of registry::reserve, registry::shrink_to_fit, registry::empty.
  • Added registry::prepare to force-create component pools within the registry.
  • Views support exclusion lists (eg registry.view<T>(exclude<U>)).
  • view::get for single component views accepts an optional template parameter for consistency.
  • Multi-component version of view::empty.
  • Multi-component version of group:empty.
  • Sorting groups doesn't require to allocate anymore and is much faster.
  • Nested groups: perfect SoA to the rescue.
  • Allow process to work with delta types other than fundamental ones.
  • Utilities: overloaded and y_combinator.
  • Added is_equality_comparable[_v] trait.
  • Added what is needed for the choice trick, see choice_t/choice from type_traits.hpp.
  • named_type_traits_v<Type> utility/shortcut for named_type_traits<Type>::value.
  • ENTT_DISABLE_ETO macro to disable empty type optimization for components.
  • Macros (for example ENTT_NAMED_TYPE) always require a trailing semicolon.
  • resource_handle, resource_loader and resource_cache are now handle, loader and cache.
  • cache exports both resource_type and id_type.
  • basic_continuous_loader support for map-like containers.
  • Fixed a bug on groups when dependencies between components were set.
  • Fixed a bug of collector::where when multiple rules were declared at once.
  • Marked cmake project explicitly as C++, language C is required only if BUILD_MOD is set to ON.
  • Added cmake support for clang users on Windows.
  • Added namespace qualifier in CMake.
  • Performance improvements here and there (eg groups lookup, stomp & spawn utilities).

Be aware that this release contains some non-backward compatible changes.
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
I've also updated the FAQs and the section EnTT in Action with more and more examples.

EnTT v3.1.1

05 Sep 13:51
Compare
Choose a tag to compare

Changelog:

  • Small perf improvements here and there.
  • Fixed a major bug on the batch creation of entities.
  • Added a few more tests for the batch creation of entities.
  • The runtime reflection system compiles fine with VS2019 when C++20 is in use (latest).

This release is mainly due to the resolution of the bug on the batch creation of entities.
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.