EnTT: entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > > Class Template Reference

EnTT 3.16.0

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > > Class Template Reference

Default constructor. More...

`#include <storage.hpp>`

Inheritance diagram for entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >:
[legend]
Collaboration diagram for entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >:
[legend]

## Public Types
using | allocator_type = Allocator
| Allocator type.
using | base_type = basic_sparse_set<Entity, typename alloc_traits::template rebind_alloc<Entity>>
| Base type.
using | element_type = Type
| Element type.
using | value_type = void
| Type of the objects assigned to entities.
using | entity_type = Entity
| Underlying entity identifier.
using | size_type = std::size_t
| Unsigned integer type.
using | difference_type = std::ptrdiff_t
| Signed integer type.
using | iterable = iterable_adaptor<internal::extended_storage_iterator<typename base_type::iterator>>
| Extended iterable storage proxy.
using | const_iterable = iterable_adaptor<internal::extended_storage_iterator<typename base_type::const_iterator>>
| Constant extended iterable storage proxy.
using | reverse_iterable = iterable_adaptor<internal::extended_storage_iterator<typename base_type::reverse_iterator>>
| Extended reverse iterable storage proxy.
using | const_reverse_iterable = iterable_adaptor<internal::extended_storage_iterator<typename base_type::const_reverse_iterator>>
| Constant extended reverse iterable storage proxy.
using | pointer
| Pointer type to contained elements.
using | const_pointer
| Constant pointer type to contained elements.
using | iterator
| Random access iterator type.
using | const_iterator
| Constant random access iterator type.
using | reverse_iterator
| Reverse iterator type.
using | const_reverse_iterator
| Constant reverse iterator type.
Public Types inherited from entt::basic_sparse_set< Entity, std::allocator_traits< Allocator >::template rebind_alloc< Entity > >
using | allocator_type
| Allocator type.
using | entity_type
| Underlying entity identifier.
using | version_type
| Underlying version type.
using | size_type
| Unsigned integer type.
using | difference_type
| Signed integer type.
using | pointer
| Pointer type to contained entities.
using | iterator
| Random access iterator type.
using | const_iterator
| Constant random access iterator type.
using | reverse_iterator
| Reverse iterator type.
using | const_reverse_iterator
| Constant reverse iterator type.

## Public Member Functions
| basic_storage ()
| Default constructor.
| basic_storage (const allocator_type &allocator)
| Constructs an empty container with a given allocator.
| basic_storage (const basic_storage &)=delete
| Default copy constructor, deleted on purpose.
| basic_storage (basic_storage &&other) noexcept=default
| Move constructor.
| basic_storage (basic_storage &&other, const allocator_type &allocator)
| Allocator-extended move constructor.
| ~basic_storage () override=default
| Default destructor.
basic_storage & | operator= (const basic_storage &)=delete
| Default copy assignment operator, deleted on purpose.
basic_storage & | operator= (basic_storage &&other) noexcept=default
| Move assignment operator.
constexpr allocator_type | get_allocator () const noexcept
| Returns the associated allocator.
void | get (const entity_type entt) const noexcept
| Returns the object assigned to an entity, that is void.
std::tuple | get_as_tuple (const entity_type entt) const noexcept
| Returns an empty tuple.
void | emplace (const entity_type entt)
| Assigns an entity to a storage and constructs its object.
template<typename... Func>
void | patch (const entity_type entt, Func &&...func)
| Updates the instance assigned to a given entity in-place.
template<typename It>
void | insert (It first, It last)
| Assigns entities to a storage.
iterable | each () noexcept
| Returns an iterable object to use to visit a storage.
const_iterable | each () const noexcept
| Returns an iterable object to use to visit a storage.
reverse_iterable | reach () noexcept
| Returns a reverse iterable object to use to visit a storage.
const_reverse_iterable | reach () const noexcept
| Returns a reverse iterable object to use to visit a storage.
void | swap (basic_storage &other) noexcept
| Exchanges the contents with those of a given storage.
void | reserve (const size_type cap) override
| Increases the capacity of a storage.
size_type | capacity () const noexcept override
| Returns the number of elements that a storage has currently allocated space for.
void | shrink_to_fit () override
| Requests the removal of unused capacity.
const_pointer | raw () const noexcept
| Direct access to the array of objects.
const_iterator | cbegin () const noexcept
| Returns an iterator to the beginning.
const_iterator | begin () const noexcept
| Returns an iterator to the beginning.
const_iterator | cend () const noexcept
| Returns an iterator to the end.
const_iterator | end () const noexcept
| Returns an iterator to the end.
const_reverse_iterator | crbegin () const noexcept
| Returns a reverse iterator to the beginning.
const_reverse_iterator | rbegin () const noexcept
| Returns a reverse iterator to the beginning.
const_reverse_iterator | crend () const noexcept
| Returns a reverse iterator to the end.
const_reverse_iterator | rend () const noexcept
| Returns a reverse iterator to the end.
Public Member Functions inherited from entt::basic_sparse_set< Entity, std::allocator_traits< Allocator >::template rebind_alloc< Entity > >
| basic_sparse_set ()
| Default constructor.
virtual | ~basic_sparse_set ()
| Default destructor.
basic_sparse_set & | operator= (const basic_sparse_set &)=delete
| Default copy assignment operator, deleted on purpose.
void | swap (basic_sparse_set &other) noexcept
| Exchanges the contents with those of a given sparse set.
constexpr allocator_type | get_allocator () const noexcept
| Returns the associated allocator.
deletion_policy | policy () const noexcept
| Returns the deletion policy of a sparse set.
size_type | free_list () const noexcept
| Returns data on the free list whose meaning depends on the mode.
size_type | extent () const noexcept
| Returns the extent of a sparse set.
size_type | size () const noexcept
| Returns the number of elements in a sparse set.
bool | empty () const noexcept
| Checks whether a sparse set is empty.
bool | contiguous () const noexcept
| Checks whether a sparse set is fully packed.
pointer | data () const noexcept
| Direct access to the internal packed array.
iterator | begin () const noexcept
| Returns an iterator to the beginning.
const_iterator | cbegin () const noexcept
iterator | end () const noexcept
| Returns an iterator to the end.
const_iterator | cend () const noexcept
reverse_iterator | rbegin () const noexcept
| Returns a reverse iterator to the beginning.
const_reverse_iterator | crbegin () const noexcept
reverse_iterator | rend () const noexcept
| Returns a reverse iterator to the end.
const_reverse_iterator | crend () const noexcept
const_iterator | find (const entity_type entt) const noexcept
| Finds an entity.
bool | contains (const entity_type entt) const noexcept
| Checks if a sparse set contains an entity.
version_type | current (const entity_type entt) const noexcept
| Returns the contained version for an identifier.
size_type | index (const entity_type entt) const noexcept
| Returns the position of an entity in a sparse set.
entity_type | operator[] (const size_type pos) const noexcept
| Returns the entity at specified location.
const void * | value (const entity_type entt) const noexcept
| Returns the element assigned to an entity, if any.
iterator | push (const entity_type entt, const void *elem=nullptr)
| Assigns an entity to a sparse set.
version_type | bump (const entity_type entt)
| Bump the version number of an entity.
void | erase (const entity_type entt)
| Erases an entity from a sparse set.
bool | remove (const entity_type entt)
| Removes an entity from a sparse set if it exists.
void | compact ()
| Removes all tombstones from a sparse set.
void | swap_elements (const entity_type lhs, const entity_type rhs)
| Swaps two entities in a sparse set.
void | sort_n (const size_type length, Compare compare, Sort algo=Sort{}, Args &&...args)
| Sort the first count elements according to the given comparison function.
void | sort (Compare compare, Sort algo=Sort{}, Args &&...args)
| Sort all elements according to the given comparison function.
iterator | sort_as (It first, It last)
| Sort entities according to their order in a range.
void | clear ()
| Clears a sparse set.
const type_info & | info () const noexcept
| Returns a type info object for the value type, if any.
const type_info & | type () const noexcept
void | bind (Type &&value) noexcept
| Forwards variables to derived classes, if any.

## Static Public Attributes
static constexpr deletion_policy | storage_policy {traits_type::in_place_delete}
| Storage deletion policy.

## Protected Member Functions
void | pop (underlying_iterator first, underlying_iterator last) override
| Erases entities from a storage.
void | pop_all () override
| Erases all entities of a storage.
underlying_iterator | try_emplace (const Entity entt, const bool force_back, const void *value) override
| Assigns an entity to a storage.
Protected Member Functions inherited from entt::basic_sparse_set< Entity, std::allocator_traits< Allocator >::template rebind_alloc< Entity > >
void | swap_only (const basic_iterator it)
| Erases an entity from a sparse set.
void | swap_and_pop (const basic_iterator it)
| Erases an entity from a sparse set.
void | in_place_pop (const basic_iterator it)
| Erases an entity from a sparse set.
virtual void | bind_any (any) noexcept
| Forwards variables to derived classes, if any.

## Additional Inherited Members
Protected Types inherited from entt::basic_sparse_set< Entity, std::allocator_traits< Allocator >::template rebind_alloc< Entity > >
using | basic_iterator
| Random access iterator type.

## Detailed Description

template<typename Type, typename Entity, typename Allocator>
class entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >

Default constructor.

Definition at line 789 of file storage.hpp.

## Member Typedef Documentation

## ◆ allocator_type

template<typename Type, typename Entity, typename Allocator>

using entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::allocator_type = Allocator

Allocator type.

Definition at line 797 of file storage.hpp.

## ◆ base_type

template<typename Type, typename Entity, typename Allocator>

using entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::base_type = basic_sparse_set<Entity, typename alloc_traits::template rebind_alloc<Entity>>

Base type.

Definition at line 799 of file storage.hpp.

## ◆ const_iterable

template<typename Type, typename Entity, typename Allocator>

using entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::const_iterable = iterable_adaptor<internal::extended_storage_iterator<typename base_type::const_iterator>>

Constant extended iterable storage proxy.

Definition at line 813 of file storage.hpp.

## ◆ const_iterator

using entt::basic_storage< Type, Entity, Allocator, typename >::const_iterator

Constant random access iterator type.

Definition at line 418 of file storage.hpp.

## ◆ const_pointer

using entt::basic_storage< Type, Entity, Allocator, typename >::const_pointer

Constant pointer type to contained elements.

Definition at line 414 of file storage.hpp.

## ◆ const_reverse_iterable

template<typename Type, typename Entity, typename Allocator>

using entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::const_reverse_iterable = iterable_adaptor<internal::extended_storage_iterator<typename base_type::const_reverse_iterator>>

Constant extended reverse iterable storage proxy.

Definition at line 817 of file storage.hpp.

## ◆ const_reverse_iterator

using entt::basic_storage< Type, Entity, Allocator, typename >::const_reverse_iterator

Constant reverse iterator type.

Definition at line 422 of file storage.hpp.

## ◆ difference_type

template<typename Type, typename Entity, typename Allocator>

using entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::difference_type = std::ptrdiff_t

Signed integer type.

Definition at line 809 of file storage.hpp.

## ◆ element_type

template<typename Type, typename Entity, typename Allocator>

using entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::element_type = Type

Element type.

Definition at line 801 of file storage.hpp.

## ◆ entity_type

template<typename Type, typename Entity, typename Allocator>

using entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::entity_type = Entity

Underlying entity identifier.

Definition at line 805 of file storage.hpp.

## ◆ iterable

template<typename Type, typename Entity, typename Allocator>

using entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::iterable = iterable_adaptor<internal::extended_storage_iterator<typename base_type::iterator>>

Extended iterable storage proxy.

Definition at line 811 of file storage.hpp.

## ◆ iterator

using entt::basic_storage< Type, Entity, Allocator, typename >::iterator

Random access iterator type.

Definition at line 416 of file storage.hpp.

## ◆ pointer

using entt::basic_storage< Type, Entity, Allocator, typename >::pointer

Pointer type to contained elements.

Definition at line 412 of file storage.hpp.

## ◆ reverse_iterable

template<typename Type, typename Entity, typename Allocator>

using entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::reverse_iterable = iterable_adaptor<internal::extended_storage_iterator<typename base_type::reverse_iterator>>

Extended reverse iterable storage proxy.

Definition at line 815 of file storage.hpp.

## ◆ reverse_iterator

using entt::basic_storage< Type, Entity, Allocator, typename >::reverse_iterator

Reverse iterator type.

Definition at line 420 of file storage.hpp.

## ◆ size_type

template<typename Type, typename Entity, typename Allocator>

using entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::size_type = std::size_t

Unsigned integer type.

Definition at line 807 of file storage.hpp.

## ◆ value_type

template<typename Type, typename Entity, typename Allocator>

using entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::value_type = void

Type of the objects assigned to entities.

Definition at line 803 of file storage.hpp.

## Constructor & Destructor Documentation

## ◆ basic_storage() [1/4]

template<typename Type, typename Entity, typename Allocator>

entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::basic_storage | ( |  | ) |
| inline

Default constructor.

Definition at line 822 of file storage.hpp.

## ◆ basic_storage() [2/4]

template<typename Type, typename Entity, typename Allocator>

entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::basic_storage | ( | const allocator_type & | allocator | ) |
| inlineexplicit

Constructs an empty container with a given allocator.

Parameters

  allocator | The allocator to use.

Definition at line 829 of file storage.hpp.

## ◆ basic_storage() [3/4]

template<typename Type, typename Entity, typename Allocator>

entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::basic_storage | ( | basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > > && | other | ) |
| defaultnoexcept

Move constructor.

Parameters

  other | The instance to move from.

## ◆ basic_storage() [4/4]

template<typename Type, typename Entity, typename Allocator>

entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::basic_storage | ( | basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > > && | other,
|  | const allocator_type & | allocator )
| inline

Allocator-extended move constructor.

Parameters

  other | The instance to move from.
  allocator | The allocator to use.

Definition at line 846 of file storage.hpp.

## Member Function Documentation

## ◆ begin()

const_iterator entt::basic_storage< Type, Entity, Allocator, typename >::begin | ( |  | ) | const
| inlinenodiscardnoexcept

Returns an iterator to the beginning.

If the storage is empty, the returned iterator will be equal to end().

Returns
  An iterator to the first instance of the internal array.

Definition at line 565 of file storage.hpp.

## ◆ capacity()

size_type entt::basic_storage< Type, Entity, Allocator, typename >::capacity | ( |  | ) | const
| inlinenodiscardoverridevirtualnoexcept

Returns the number of elements that a storage has currently allocated space for.

Returns
  Capacity of the storage.

Reimplemented from entt::basic_sparse_set< Entity, std::allocator_traits< Allocator >::template rebind_alloc< Entity > >.

Definition at line 529 of file storage.hpp.

## ◆ cbegin()

const_iterator entt::basic_storage< Type, Entity, Allocator, typename >::cbegin | ( |  | ) | const
| inlinenodiscardnoexcept

Returns an iterator to the beginning.

If the storage is empty, the returned iterator will be equal to end().

Returns
  An iterator to the first instance of the internal array.

Definition at line 559 of file storage.hpp.

## ◆ cend()

const_iterator entt::basic_storage< Type, Entity, Allocator, typename >::cend | ( |  | ) | const
| inlinenodiscardnoexcept

Returns an iterator to the end.

Returns
  An iterator to the element following the last instance of the internal array.

Definition at line 580 of file storage.hpp.

## ◆ crbegin()

const_reverse_iterator entt::basic_storage< Type, Entity, Allocator, typename >::crbegin | ( |  | ) | const
| inlinenodiscardnoexcept

Returns a reverse iterator to the beginning.

If the storage is empty, the returned iterator will be equal to rend().

Returns
  An iterator to the first instance of the reversed internal array.

Definition at line 601 of file storage.hpp.

## ◆ crend()

const_reverse_iterator entt::basic_storage< Type, Entity, Allocator, typename >::crend | ( |  | ) | const
| inlinenodiscardnoexcept

Returns a reverse iterator to the end.

Returns
  An iterator to the element following the last instance of the reversed internal array.

Definition at line 620 of file storage.hpp.

## ◆ each() [1/2]

template<typename Type, typename Entity, typename Allocator>

const_iterable entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::each | ( |  | ) | const
| inlinenodiscardnoexcept

Returns an iterable object to use to visit a storage.

The iterable object returns a tuple that contains the current entity.

Returns
  An iterable object to use to visit the storage.

Definition at line 951 of file storage.hpp.

## ◆ each() [2/2]

template<typename Type, typename Entity, typename Allocator>

iterable entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::each | ( |  | ) |
| inlinenodiscardnoexcept

Returns an iterable object to use to visit a storage.

The iterable object returns a tuple that contains the current entity.

Returns
  An iterable object to use to visit the storage.

Definition at line 946 of file storage.hpp.

## ◆ emplace()

template<typename Type, typename Entity, typename Allocator>

void entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::emplace | ( | const entity_type | entt | ) |
| inline

Assigns an entity to a storage and constructs its object.

Warning
  Attempting to use an entity that already belongs to the storage results in undefined behavior.

Parameters

  entt | A valid identifier.

Definition at line 910 of file storage.hpp.

## ◆ end()

const_iterator entt::basic_storage< Type, Entity, Allocator, typename >::end | ( |  | ) | const
| inlinenodiscardnoexcept

Returns an iterator to the end.

Returns
  An iterator to the element following the last instance of the internal array.

Definition at line 585 of file storage.hpp.

## ◆ get()

template<typename Type, typename Entity, typename Allocator>

void entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::get | ( | const entity_type | entt | ) | const
| inlinenoexcept

Returns the object assigned to an entity, that is void.

Warning
  Attempting to use an entity that doesn't belong to the storage results in undefined behavior.

Parameters

  entt | A valid identifier.

Definition at line 887 of file storage.hpp.

## ◆ get_allocator()

template<typename Type, typename Entity, typename Allocator>

allocator_type entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::get_allocator | ( |  | ) | const
| inlinenodiscardconstexprnoexcept

Returns the associated allocator.

Returns
  The associated allocator.

Definition at line 869 of file storage.hpp.

## ◆ get_as_tuple()

template<typename Type, typename Entity, typename Allocator>

std::tuple entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::get_as_tuple | ( | const entity_type | entt | ) | const
| inlinenodiscardnoexcept

Returns an empty tuple.

Parameters

  entt | A valid identifier.

Returns
  Returns an empty tuple.

Definition at line 896 of file storage.hpp.

## ◆ insert()

template<typename Type, typename Entity, typename Allocator>
template<typename It>

void entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::insert | ( | It | first,
|  | It | last )
| inline

Assigns entities to a storage.

Template Parameters

  It | Type of input iterator.

Parameters

  first | An iterator to the first element of the range of entities.
  last | An iterator past the last element of the range of entities.

Definition at line 933 of file storage.hpp.

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

template<typename Type, typename Entity, typename Allocator>

basic_storage & entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::operator= | ( | basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > > && | other | ) |
| defaultnoexcept

Move assignment operator.

Parameters

  other | The instance to move from.

Returns
  This storage.

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

template<typename Type, typename Entity, typename Allocator>

basic_storage & entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::operator= | ( | const basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > > & |  | ) |
| delete

Default copy assignment operator, deleted on purpose.

Returns
  This storage.

## ◆ patch()

template<typename Type, typename Entity, typename Allocator>
template<typename... Func>

void entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::patch | ( | const entity_type | entt,
|  | Func &&... | func )
| inline

Updates the instance assigned to a given entity in-place.

Template Parameters

  Func | Types of the function objects to invoke.

Parameters

  entt | A valid identifier.
  func | Valid function objects.

Definition at line 921 of file storage.hpp.

## ◆ pop()

void entt::basic_storage< Type, Entity, Allocator, typename >::pop | ( | underlying_iterator | first,
|  | underlying_iterator | last )
| inlineoverrideprotectedvirtual

Erases entities from a storage.

Parameters

  first | An iterator to the first element of the range of entities.
  last | An iterator past the last element of the range of entities.

Reimplemented from entt::basic_sparse_set< Entity, std::allocator_traits< Allocator >::template rebind_alloc< Entity > >.

Definition at line 338 of file storage.hpp.

## ◆ pop_all()

void entt::basic_storage< Type, Entity, Allocator, typename >::pop_all | ( |  | ) |
| inlineoverrideprotectedvirtual

Erases all entities of a storage.

Reimplemented from entt::basic_sparse_set< Entity, std::allocator_traits< Allocator >::template rebind_alloc< Entity > >.

Definition at line 357 of file storage.hpp.

## ◆ raw()

const_pointer entt::basic_storage< Type, Entity, Allocator, typename >::raw | ( |  | ) | const
| inlinenodiscardnoexcept

Direct access to the array of objects.

Returns
  A pointer to the array of objects.

Definition at line 543 of file storage.hpp.

## ◆ rbegin()

const_reverse_iterator entt::basic_storage< Type, Entity, Allocator, typename >::rbegin | ( |  | ) | const
| inlinenodiscardnoexcept

Returns a reverse iterator to the beginning.

If the storage is empty, the returned iterator will be equal to rend().

Returns
  An iterator to the first instance of the reversed internal array.

Definition at line 606 of file storage.hpp.

## ◆ reach() [1/2]

template<typename Type, typename Entity, typename Allocator>

const_reverse_iterable entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::reach | ( |  | ) | const
| inlinenodiscardnoexcept

Returns a reverse iterable object to use to visit a storage.

See also
  each

Returns
  A reverse iterable object to use to visit the storage.

Definition at line 967 of file storage.hpp.

## ◆ reach() [2/2]

template<typename Type, typename Entity, typename Allocator>

reverse_iterable entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::reach | ( |  | ) |
| inlinenodiscardnoexcept

Returns a reverse iterable object to use to visit a storage.

See also
  each

Returns
  A reverse iterable object to use to visit the storage.

Definition at line 962 of file storage.hpp.

## ◆ rend()

const_reverse_iterator entt::basic_storage< Type, Entity, Allocator, typename >::rend | ( |  | ) | const
| inlinenodiscardnoexcept

Returns a reverse iterator to the end.

Returns
  An iterator to the element following the last instance of the reversed internal array.

Definition at line 625 of file storage.hpp.

## ◆ reserve()

void entt::basic_storage< Type, Entity, Allocator, typename >::reserve | ( | const size_type | cap | ) |
| inlineoverridevirtual

Increases the capacity of a storage.

If the new capacity is greater than the current capacity, new storage is allocated, otherwise the method does nothing.

Parameters

  cap | Desired capacity.

Reimplemented from entt::basic_sparse_set< Entity, std::allocator_traits< Allocator >::template rebind_alloc< Entity > >.

Definition at line 517 of file storage.hpp.

## ◆ shrink_to_fit()

void entt::basic_storage< Type, Entity, Allocator, typename >::shrink_to_fit | ( |  | ) |
| inlineoverridevirtual

Requests the removal of unused capacity.

Reimplemented from entt::basic_sparse_set< Entity, std::allocator_traits< Allocator >::template rebind_alloc< Entity > >.

Definition at line 534 of file storage.hpp.

## ◆ swap()

void entt::basic_storage< Type, Entity, Allocator, typename >::swap | ( | basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > > & | other | ) |
| inlinenoexcept

Exchanges the contents with those of a given storage.

Parameters

  other | Storage to exchange the content with.

Definition at line 495 of file storage.hpp.

## ◆ try_emplace()

underlying_iterator entt::basic_storage< Type, Entity, Allocator, typename >::try_emplace | ( | const Entity | entt,
|  | const bool | force_back,
|  | const void * | value )
| inlineoverrideprotectedvirtual

Assigns an entity to a storage.

Parameters

  entt | A valid identifier.
  value | Optional opaque value.
  force_back | Force back insertion.

Returns
  Iterator pointing to the emplaced element.

Reimplemented from entt::basic_sparse_set< Entity, std::allocator_traits< Allocator >::template rebind_alloc< Entity > >.

Definition at line 380 of file storage.hpp.

## Member Data Documentation

## ◆ storage_policy

template<typename Type, typename Entity, typename Allocator>

deletion_policy entt::basic_storage< Type, Entity, Allocator, std::enable_if_t< component_traits< Type, Entity >::page_size==0u > >::storage_policy {traits_type::in_place_delete}
| staticconstexpr

Storage deletion policy.

Definition at line 819 of file storage.hpp.

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

- src/entt/entity/storage.hpp