OpenLexocad  27.1
entt::basic_snapshot< Entity > Class Template Reference

Utility class to create snapshots from a registry. More...

#include <entt.hpp>

Public Member Functions

 basic_snapshot (basic_snapshot &&)=default
 Default move constructor. More...
 
basic_snapshotoperator= (basic_snapshot &&)=default
 Default move assignment operator. More...
 
template<typename Archive >
const basic_snapshotentities (Archive &archive) const
 Puts aside all the entities that are still in use. More...
 
template<typename Archive >
const basic_snapshotdestroyed (Archive &archive) const
 Puts aside destroyed entities. More...
 
template<typename... Component, typename Archive >
const basic_snapshotcomponent (Archive &archive) const
 Puts aside the given components. More...
 
template<typename... Component, typename Archive , typename It >
const basic_snapshotcomponent (Archive &archive, It first, It last) const
 Puts aside the given components for the entities in a range. More...
 

Friends

class basic_registry< Entity >
 A registry is allowed to create snapshots. More...
 

Detailed Description

template<typename Entity>
class entt::basic_snapshot< Entity >

Utility class to create snapshots from a registry.

A snapshot can be either a dump of the entire registry or a narrower selection of components of interest.
This type can be used in both cases if provided with a correctly configured output archive.

Template Parameters
EntityA valid entity type (see entt_traits for more details).

Constructor & Destructor Documentation

◆ basic_snapshot()

template<typename Entity >
entt::basic_snapshot< Entity >::basic_snapshot ( basic_snapshot< Entity > &&  )
default

Default move constructor.

Member Function Documentation

◆ component() [1/2]

template<typename Entity >
template<typename... Component, typename Archive >
const basic_snapshot& entt::basic_snapshot< Entity >::component ( Archive &  archive) const
inline

Puts aside the given components.

Each instance is serialized together with the entity to which it belongs. Entities are serialized along with their versions.

Template Parameters
ComponentTypes of components to serialize.
ArchiveType of output archive.
Parameters
archiveA valid reference to an output archive.
Returns
An object of this type to continue creating the snapshot.

◆ component() [2/2]

template<typename Entity >
template<typename... Component, typename Archive , typename It >
const basic_snapshot& entt::basic_snapshot< Entity >::component ( Archive &  archive,
It  first,
It  last 
) const
inline

Puts aside the given components for the entities in a range.

Each instance is serialized together with the entity to which it belongs. Entities are serialized along with their versions.

Template Parameters
ComponentTypes of components to serialize.
ArchiveType of output archive.
ItType of input iterator.
Parameters
archiveA valid reference to an output archive.
firstAn iterator to the first element of the range to serialize.
lastAn iterator past the last element of the range to serialize.
Returns
An object of this type to continue creating the snapshot.

◆ destroyed()

template<typename Entity >
template<typename Archive >
const basic_snapshot& entt::basic_snapshot< Entity >::destroyed ( Archive &  archive) const
inline

Puts aside destroyed entities.

Entities are serialized along with their versions. Entities that are still in use are not taken in consideration by this function.

Template Parameters
ArchiveType of output archive.
Parameters
archiveA valid reference to an output archive.
Returns
An object of this type to continue creating the snapshot.

◆ entities()

template<typename Entity >
template<typename Archive >
const basic_snapshot& entt::basic_snapshot< Entity >::entities ( Archive &  archive) const
inline

Puts aside all the entities that are still in use.

Entities are serialized along with their versions. Destroyed entities are not taken in consideration by this function.

Template Parameters
ArchiveType of output archive.
Parameters
archiveA valid reference to an output archive.
Returns
An object of this type to continue creating the snapshot.

◆ operator=()

template<typename Entity >
basic_snapshot& entt::basic_snapshot< Entity >::operator= ( basic_snapshot< Entity > &&  )
default

Default move assignment operator.

Returns
This snapshot.

Friends And Related Function Documentation

◆ basic_registry< Entity >

template<typename Entity >
friend class basic_registry< Entity >
friend

A registry is allowed to create snapshots.


The documentation for this class was generated from the following file: