Releases: skypjack/entt
EnTT v3.5.1
Changelog:
-
entity
:- Fixed an issue in the
observer
class with exclusion lists. - Updated
difference_type
for 32b identifiers. - Removed support for 16b identifiers.
- Fixed an issue in the
-
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
Changelog
-
core
:- Added
type_info::name
member function. - Added
unpack_as_t
andunpack_as_v
utilities as type traits. - Added
is_eto_eligible[_v]
utility for internal purposes.
- Added
-
entity
:entt_traits
: updated types fordifference_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 ofentt_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
andrend
tosparse_set
s. - Added reverse iterators,
rbegin
andrend
tostorage
s. - Added reverse iterators,
rbegin
andrend
togroup
s. - Added reverse iterators,
rbegin
andrend
toview
s. view
s 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.
- Added a support file to use
-
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 todispatcher
. - 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, useregistry::sortable
.
-
meta
:meta_type::set
andmeta_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 forref
and dereferences pointer-like elements instead.meta_ctor::prop
with callback is no longer available, use the overload ofmeta_ctor::prop
that returns an iterable object.meta_data::prop
with callback is no longer available, use the overload ofmeta_data::prop
that returns an iterable object.meta_func::prop
with callback is no longer available, use the overload ofmeta_func::prop
that returns an iterable object.meta_type::base
with callback is no longer available, use the overload ofmeta_type::base
that returns an iterable object.meta_type::conv
with callback is no longer available, use the overload ofmeta_type::conv
that returns an iterable object.meta_type::ctor
with callback is no longer available, use the overload ofmeta_type::ctor
that returns an iterable object.meta_type::data
with callback is no longer available, use the overload ofmeta_type::data
that returns an iterable object.meta_type::func
with callback is no longer available, use the overload ofmeta_type::func
that returns an iterable object.meta_type::prop
with callback is no longer available, use the overload ofmeta_type::prop
that returns an iterable object.resolve
with callback is no longer available, use the overload ofresolve
that returns an iterable object.resolve_if
is no longer available, use the overload ofresolve
that returns an iterable object.meta_factory<...>::reset
has been replaced bymeta_type::reset
.
-
resource
:cache
has been renamed toresource_cache
.handle
has been renamed toresource_handle
.loader
has been renamed toresource_loader
.
-
signal
:- Renaming of exported functions:
delegate::function_type
becomesdelegate::type
.
- Renaming of exported functions:
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.
- The
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
Changelog
-
config
:- Added
ENTT_IS_EMPTY
as an opaque way to recognize empty types (ENTT_DISABLE_ETO
affects also this variable).
- Added
-
core
:- Added
entt::id_type
as an user-friendly alternative forENTT_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 typeT
has assigned a library wide sequential identifier. - Added
entt::integral_constant
as a shortcut for its standard counterpart.
- Added
-
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.
- Added
-
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 usestype_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.
- Added
-
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 theregistry
) 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
andENTT_API_EXPORT
definitions as appropriate. This will makeEnTT
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 anymoreget
,try_get
and so on. - Views and groups no longer return empty types during a call to
each
and don't allow anymore toget
an empty type for an entity. ENTT_DISABLE_ETO
is no longer considered, useENTT_NO_ETO
instead.ENTT_ENABLE_ETO
is no longer exported, useENTT_IS_EMPTY
instead.
- The
iterator_type
aliases have been renamed toiterator
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, useregistry::patch
instead.registry::on_replace
, useregistry::on_update
instead.registry::assign<T>
for a single entity, useregistry::emplace<T>
instead.registry::assign<T>
for multiple entities, useregistry::insert<T>
instead.registry::get_or_assign<T>
, useregistry::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, usestorage<T>::emplace
instead.storage<T>::construct
for multiple entities, usestorage<T>::insert
instead.storage<T>::destroy
, usestorage<T>::erase
instead.sparse_set::construct
for a single entity, usesparse_set::emplace
instead.sparse_set::construct
for multiple entities, usesparse_set::insert
instead.sparse_set::destroy
, usesparse_set::erase
instead.sparse_set::has
, usesparse_set::contains
instead.group::less
, usegroup::each
instead.view::less
, useview::each
instead.meta_factory::alias
, usemeta_factory::type
instead.meta_type::alias
, usemeta_type::id
instead.meta_data::alias
, usemeta_data::id
instead.meta_func::alias
, usemeta_func::id
instead.entt::as_alias_t
andentt::as_alias
, useentt::as_ref_t
andentt::as_ref
instead.entt::resolve
by identifier, useentt::resolve_id
instead.observer::replace
, useobserver::update
instead.basic_snapshot<T>::destroyed
, usebasic_snapshot<T>::entities
instead.basic_snapshot_loader<T>::destroyed
, usebasic_snapshot_loader<T>::entities
instead.basic_continuous_loader<T>::destroyed
, usebasic_continuous_loader<T>::entities
instead.basic_continuous_loader::has
, usebasic_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
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
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
Changelog:
config
- Using atomics is no longer the default (
ENTT_NO_ATOMIC
becameENTT_USE_ATOMIC
). ENTT_DISABLE_ASSERT
no longer exists,ENTT_ASSERT
can be redefined now.
- Using atomics is no longer the default (
hashed_string
- Static
to_value
renamed tovalue
. - The helper function is no longer recursive (long names are now accepted).
- Static
delegate
:- Support for unbound members (data and functions).
sigh
/sink
:- Support for unbound members (data and functions).
sparse_set
:- Renamed
reset
toclear
.
- Renamed
storage
:- Renamed
reset
toclear
. - Added range-
construct
.
- Renamed
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 forreset<T>()
andreset()
. - Added
remove_if_exists
as a replacement forreset<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 oldreplace
-with-arguments. - Added single component
prepare
functionality (suitable for custom pools). - Removed misplaced assert from
clone
andstomp
functionalities. - Removed
reset
member functions (useremove
andclear
instead). - Removed range-
stomp
. - Renamed
stomp
tostamp
. - 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
andclone
(see updated doc for more details).
view
- All iterators are at least bidirectional.
- Much faster
contains
. - Added
front
andback
to get the first and the last entities.
group
- All iterators are at least bidirectional.
- Much faster
contains
. - Added
front
andback
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 tofactory
and deprecatedtype
. - Added
alias
member function to all meta objects and deprecatedidentifier
. - Added
meta_type::id
to get the underlying type id (seetype_info<T>::id
for more details).
dispatcher
- Renamed
discard
inclear
for consistency.
- Renamed
type_traits
- Added
member_class
andmember_class_t
to get the class from a pointer-to-member type.
- Added
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.
- Full featured, SFINAE-friendly
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
into_integral
(seeENTT_OPAQUE_TYPE
for custom identifiers). entt::component
doesn't exist anymore (useentt::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
andmeta
). - 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
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
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
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 ofcoveralls
. - 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
usesstd::reference_wrapper
instead ofas_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 ameta_handle
. meta_handle
no longer exposesdata
/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
andsink::before
support also pointers as instances or payload.delegate
supports also pointers as instances or payload.sparse_set::swap
andstorage::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
andy_combinator
. - Added
is_equality_comparable[_v]
trait. - Added what is needed for the choice trick, see
choice_t
/choice
fromtype_traits.hpp
. named_type_traits_v<Type>
utility/shortcut fornamed_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
andresource_cache
are nowhandle
,loader
andcache
.cache
exports bothresource_type
andid_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 toON
. - 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
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.