EnTT 3.14.0
|
Utility class to restore a snapshot as a whole. More...
#include <snapshot.hpp>
Public Types | |
using | registry_type = Registry |
using | entity_type = typename registry_type::entity_type |
Underlying entity identifier. | |
Public Member Functions | |
basic_snapshot_loader (registry_type &source) noexcept | |
Constructs an instance that is bound to a given registry. | |
basic_snapshot_loader (const basic_snapshot_loader &)=delete | |
Default copy constructor, deleted on purpose. | |
basic_snapshot_loader (basic_snapshot_loader &&) noexcept=default | |
Default move constructor. | |
~basic_snapshot_loader ()=default | |
Default destructor. | |
basic_snapshot_loader & | operator= (const basic_snapshot_loader &)=delete |
Default copy assignment operator, deleted on purpose. | |
basic_snapshot_loader & | operator= (basic_snapshot_loader &&) noexcept=default |
Default move assignment operator. | |
template<typename Type , typename Archive > | |
basic_snapshot_loader & | get (Archive &archive, const id_type id=type_hash< Type >::value()) |
Restores all elements of a type with associated identifiers. | |
basic_snapshot_loader & | orphans () |
Destroys those entities that have no elements. | |
Utility class to restore a snapshot as a whole.
A snapshot loader requires that the destination registry be empty and loads all the data at once while keeping intact the identifiers that the entities originally had.
An example of use is the implementation of a save/restore utility.
Registry | Basic registry type. |
Definition at line 176 of file snapshot.hpp.
using entt::basic_snapshot_loader< Registry >::entity_type = typename registry_type::entity_type |
Underlying entity identifier.
Definition at line 184 of file snapshot.hpp.
using entt::basic_snapshot_loader< Registry >::registry_type = Registry |
Basic registry type.
Definition at line 182 of file snapshot.hpp.
|
inlinenoexcept |
Constructs an instance that is bound to a given registry.
source | A valid reference to a registry. |
Definition at line 190 of file snapshot.hpp.
|
inline |
Restores all elements of a type with associated identifiers.
Type | Type of elements to restore. |
Archive | Type of input archive. |
archive | A valid reference to an input archive. |
id | Optional name used to map the storage within the registry. |
Definition at line 226 of file snapshot.hpp.
|
defaultnoexcept |
Default move assignment operator.
|
delete |
Default copy assignment operator, deleted on purpose.
|
inline |
Destroys those entities that have no elements.
In case all the entities were serialized but only part of the elements was saved, it could happen that some of the entities have no elements once restored.
This function helps to identify and destroy those entities.
Definition at line 277 of file snapshot.hpp.