EnTT 3.13.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
entt::basic_snapshot< Registry > Class Template Reference

Utility class to create snapshots from a registry. 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 (const registry_type &source) noexcept
 Constructs an instance that is bound to a given registry.
 
 basic_snapshot (basic_snapshot &&) noexcept=default
 Default move constructor.
 
basic_snapshotoperator= (basic_snapshot &&) noexcept=default
 Default move assignment operator.
 
template<typename Type , typename Archive >
const basic_snapshotget (Archive &archive, const id_type id=type_hash< Type >::value()) const
 Serializes all elements of a type with associated identifiers.
 
template<typename Type , typename Archive , typename It >
const basic_snapshotget (Archive &archive, It first, It last, const id_type id=type_hash< Type >::value()) const
 Serializes all elements of a type with associated identifiers for the entities in a range.
 

Detailed Description

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

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
RegistryBasic registry type.

Definition at line 47 of file snapshot.hpp.

Member Typedef Documentation

◆ entity_type

template<typename Registry >
using entt::basic_snapshot< Registry >::entity_type = typename registry_type::entity_type

Underlying entity identifier.

Definition at line 55 of file snapshot.hpp.

◆ registry_type

template<typename Registry >
using entt::basic_snapshot< Registry >::registry_type = Registry

Basic registry type.

Definition at line 53 of file snapshot.hpp.

Constructor & Destructor Documentation

◆ basic_snapshot()

template<typename Registry >
entt::basic_snapshot< Registry >::basic_snapshot ( const registry_type source)
inlinenoexcept

Constructs an instance that is bound to a given registry.

Parameters
sourceA valid reference to a registry.

Definition at line 61 of file snapshot.hpp.

Member Function Documentation

◆ get() [1/2]

template<typename Registry >
template<typename Type , typename Archive >
const basic_snapshot & entt::basic_snapshot< Registry >::get ( Archive &  archive,
const id_type  id = type_hash<Type>::value() 
) const
inline

Serializes all elements of a type with associated identifiers.

Template Parameters
TypeType of elements to serialize.
ArchiveType of output archive.
Parameters
archiveA valid reference to an output archive.
idOptional name used to map the storage within the registry.
Returns
An object of this type to continue creating the snapshot.

Definition at line 79 of file snapshot.hpp.

◆ get() [2/2]

template<typename Registry >
template<typename Type , typename Archive , typename It >
const basic_snapshot & entt::basic_snapshot< Registry >::get ( Archive &  archive,
It  first,
It  last,
const id_type  id = type_hash<Type>::value() 
) const
inline

Serializes all elements of a type with associated identifiers for the entities in a range.

Template Parameters
TypeType of elements 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.
idOptional name used to map the storage within the registry.
Returns
An object of this type to continue creating the snapshot.

Definition at line 114 of file snapshot.hpp.

◆ operator=()

template<typename Registry >
basic_snapshot & entt::basic_snapshot< Registry >::operator= ( basic_snapshot< Registry > &&  )
defaultnoexcept

Default move assignment operator.

Returns
This snapshot.

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