OpenLexocad
27.0
|
Utility class to restore a snapshot as a whole. More...
#include <entt.hpp>
Public Member Functions | |
basic_snapshot_loader (basic_snapshot_loader &&)=default | |
Default move constructor. More... | |
basic_snapshot_loader & | operator= (basic_snapshot_loader &&)=default |
Default move assignment operator. More... | |
template<typename Archive > | |
const basic_snapshot_loader & | entities (Archive &archive) const |
Restores entities that were in use during serialization. More... | |
template<typename Archive > | |
const basic_snapshot_loader & | destroyed (Archive &archive) const |
Restores entities that were destroyed during serialization. More... | |
template<typename... Component, typename Archive > | |
const basic_snapshot_loader & | component (Archive &archive) const |
Restores components and assigns them to the right entities. More... | |
const basic_snapshot_loader & | orphans () const |
Destroys those entities that have no components. More... | |
Friends | |
class | basic_registry< Entity > |
A registry is allowed to create snapshot loaders. More... | |
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.
Entity | A valid entity type (see entt_traits for more details). |
|
default |
Default move constructor.
|
inline |
Restores components and assigns them to the right entities.
The template parameter list must be exactly the same used during serialization. In the event that the entity to which the component is assigned doesn't exist yet, the loader will take care to create it with the version it originally had.
Component | Types of components to restore. |
Archive | Type of input archive. |
archive | A valid reference to an input archive. |
|
inline |
Restores entities that were destroyed during serialization.
This function restores the entities that were destroyed during serialization and gives them the versions they originally had.
Archive | Type of input archive. |
archive | A valid reference to an input archive. |
|
inline |
Restores entities that were in use during serialization.
This function restores the entities that were in use during serialization and gives them the versions they originally had.
Archive | Type of input archive. |
archive | A valid reference to an input archive. |
|
default |
Default move assignment operator.
|
inline |
Destroys those entities that have no components.
In case all the entities were serialized but only part of the components was saved, it could happen that some of the entities have no components once restored.
This functions helps to identify and destroy those entities.
|
friend |
A registry is allowed to create snapshot loaders.