EnTT: entt::basic_snapshot< Registry > Class Template Reference

EnTT 3.15.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 (const basic_snapshot &)=delete
| Default copy constructor, deleted on purpose.
| basic_snapshot (basic_snapshot &&) noexcept=default
| Default move constructor.
| ~basic_snapshot ()=default
| Default destructor.
basic_snapshot & | operator= (const basic_snapshot &)=delete
| Default copy assignment operator, deleted on purpose.
basic_snapshot & | operator= (basic_snapshot &&) noexcept=default
| Default move assignment operator.
template<typename Type, typename Archive>
const basic_snapshot & | get (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_snapshot & | get (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 elements of interest.
This type can be used in both cases if provided with a correctly configured output archive.

Template Parameters

  Registry | Basic 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

  source | A 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

  Type | Type of elements to serialize.
  Archive | Type of output archive.

Parameters

  archive | A valid reference to an output archive.
  id | Optional name used to map the storage within the registry.

Returns
  An object of this type to continue creating the snapshot.

Definition at line 94 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

  Type | Type of elements to serialize.
  Archive | Type of output archive.
  It | Type of input iterator.

Parameters

  archive | A valid reference to an output archive.
  first | An iterator to the first element of the range to serialize.
  last | An iterator past the last element of the range to serialize.
  id | Optional name used to map the storage within the registry.

Returns
  An object of this type to continue creating the snapshot.

Definition at line 140 of file snapshot.hpp.

## ◆ operator=() [1/2]

template<typename Registry>

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

Default move assignment operator.

Returns
  This snapshot.

## ◆ operator=() [2/2]

template<typename Registry>

basic_snapshot & entt::basic_snapshot< Registry >::operator= | ( | const basic_snapshot< Registry > & |  | ) |
| delete

Default copy assignment operator, deleted on purpose.

Returns
  This snapshot.

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

- src/entt/entity/fwd.hpp
- src/entt/entity/snapshot.hpp