EnTT  3.8.1
List of all members
entt::basic_storage< Entity, Type, Allocator > Struct Template Reference

Storage implementation dispatcher. More...

#include <storage.hpp>

Inheritance diagram for entt::basic_storage< Entity, Type, Allocator >:
Inheritance graph
[legend]
Collaboration diagram for entt::basic_storage< Entity, Type, Allocator >:
Collaboration graph
[legend]

Additional Inherited Members

- Public Types inherited from entt::basic_storage_impl< Entity, Type, Allocator, typename >
using allocator_type = typename alloc_traits::allocator_type
 Allocator type.
 
using value_type = Type
 Type of the objects assigned to entities.
 
using entity_type = Entity
 Underlying entity identifier.
 
using size_type = std::size_t
 Unsigned integer type.
 
using pointer = bucket_alloc_pointer
 Pointer type to contained elements.
 
using const_pointer = bucket_alloc_const_pointer
 Constant pointer type to contained elements.
 
using iterator = storage_iterator< value_type >
 Random access iterator type.
 
using const_iterator = storage_iterator< const value_type >
 Constant random access iterator type.
 
using reverse_iterator = std::reverse_iterator< iterator >
 Reverse iterator type.
 
using const_reverse_iterator = std::reverse_iterator< const_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 = typename alloc_traits::allocator_type
 Allocator type.
 
using entity_type = Entity
 Underlying entity identifier.
 
using size_type = std::size_t
 Unsigned integer type.
 
using pointer = alloc_const_pointer
 Pointer type to contained entities.
 
using iterator = sparse_set_iterator
 Random access iterator type.
 
using reverse_iterator = std::reverse_iterator< iterator >
 Reverse iterator type.
 
- Public Member Functions inherited from entt::basic_storage_impl< Entity, Type, Allocator, typename >
 basic_storage_impl (const allocator_type &alloc={})
 Default constructor. More...
 
 basic_storage_impl (basic_storage_impl &&other)
 Move constructor. More...
 
 ~basic_storage_impl () override
 Default destructor.
 
basic_storage_impl & operator= (basic_storage_impl &&other)
 Move assignment operator. More...
 
void reserve (const size_type cap)
 Increases the capacity of a storage. More...
 
size_type capacity () const
 Returns the number of elements that a storage has currently allocated space for. More...
 
void shrink_to_fit ()
 Requests the removal of unused capacity.
 
const_pointer raw () const
 Direct access to the array of objects. More...
 
pointer raw ()
 Direct access to the array of objects. More...
 
const_iterator cbegin () const
 Returns an iterator to the beginning. More...
 
const_iterator begin () const
 Returns an iterator to the beginning. More...
 
iterator begin ()
 Returns an iterator to the beginning. More...
 
const_iterator cend () const
 Returns an iterator to the end. More...
 
const_iterator end () const
 Returns an iterator to the end. More...
 
iterator end ()
 Returns an iterator to the end. More...
 
const_reverse_iterator crbegin () const
 Returns a reverse iterator to the beginning. More...
 
const_reverse_iterator rbegin () const
 Returns a reverse iterator to the beginning. More...
 
reverse_iterator rbegin ()
 Returns a reverse iterator to the beginning. More...
 
const_reverse_iterator crend () const
 Returns a reverse iterator to the end. More...
 
const_reverse_iterator rend () const
 Returns a reverse iterator to the end. More...
 
reverse_iterator rend ()
 Returns a reverse iterator to the end. More...
 
const value_type & get (const entity_type entt) const
 Returns the object assigned to an entity. More...
 
value_type & get (const entity_type entt)
 Returns the object assigned to an entity. More...
 
template<typename... Args>
value_type & emplace (const entity_type entt, Args &&... args)
 Assigns an entity to a storage and constructs its object. More...
 
template<typename... Func>
decltype(auto) patch (const entity_type entt, Func &&... func)
 Updates the instance assigned to a given entity in-place. More...
 
template<typename It >
void insert (It first, It last, const value_type &value={})
 Assigns one or more entities to a storage and constructs their objects from a given instance. More...
 
template<typename EIt , typename CIt , typename = std::enable_if_t<std::is_same_v<std::decay_t<typename std::iterator_traits<CIt>::value_type>, value_type>>>
void insert (EIt first, EIt last, CIt from)
 Assigns one or more entities to a storage and constructs their objects from a given range. More...
 
template<typename Compare , typename Sort = std_sort, typename... Args>
void sort_n (const size_type length, Compare compare, Sort algo=Sort{}, Args &&... args)
 Sort elements according to the given comparison function. More...
 
template<typename Compare , typename Sort = std_sort, typename... Args>
void sort (Compare compare, Sort algo=Sort{}, Args &&... args)
 Sort all elements according to the given comparison function. More...
 
- Public Member Functions inherited from entt::basic_sparse_set< Entity, std::allocator_traits< Allocator >::template rebind_alloc< Entity > >
 basic_sparse_set (deletion_policy pol, const allocator_type &alloc={})
 Constructs an empty container with the given policy and allocator. More...
 
 basic_sparse_set (const allocator_type &alloc={})
 Constructs an empty container with the given allocator. More...
 
 basic_sparse_set (basic_sparse_set &&other)
 Move constructor. More...
 
virtual ~basic_sparse_set ()
 Default destructor.
 
basic_sparse_set & operator= (basic_sparse_set &&other)
 Move assignment operator. More...
 
deletion_policy policy () const
 Returns the deletion policy of a sparse set. More...
 
size_type slot () const
 Returns the next slot available for insertion. More...
 
void reserve (const size_type cap)
 Increases the capacity of a sparse set. More...
 
size_type capacity () const
 Returns the number of elements that a sparse set has currently allocated space for. More...
 
void shrink_to_fit ()
 Requests the removal of unused capacity.
 
size_type extent () const
 Returns the extent of a sparse set. More...
 
size_type size () const
 Returns the number of elements in a sparse set. More...
 
bool empty () const
 Checks whether a sparse set is empty. More...
 
pointer data () const
 Direct access to the internal packed array. More...
 
iterator begin () const
 Returns an iterator to the beginning. More...
 
iterator end () const
 Returns an iterator to the end. More...
 
reverse_iterator rbegin () const
 Returns a reverse iterator to the beginning. More...
 
reverse_iterator rend () const
 Returns a reverse iterator to the end. More...
 
iterator find (const entity_type entt) const
 Finds an entity. More...
 
bool contains (const entity_type entt) const
 Checks if a sparse set contains an entity. More...
 
size_type index (const entity_type entt) const
 Returns the position of an entity in a sparse set. More...
 
entity_type at (const size_type pos) const
 Returns the entity at specified location, with bounds checking. More...
 
entity_type operator[] (const size_type pos) const
 Returns the entity at specified location, without bounds checking. More...
 
size_type emplace_back (const entity_type entt)
 Appends an entity to a sparse set. More...
 
size_type emplace (const entity_type entt)
 Assigns an entity to a sparse set. More...
 
void insert (It first, It last)
 Assigns one or more entities to a sparse set. More...
 
void erase (const entity_type entt, void *ud=nullptr)
 Erases an entity from a sparse set. More...
 
void erase (It first, It last, void *ud=nullptr)
 Erases entities from a set. More...
 
bool remove (const entity_type entt, void *ud=nullptr)
 Removes an entity from a sparse set if it exists. More...
 
size_type remove (It first, It last, void *ud=nullptr)
 Removes entities from a sparse set if they exist. More...
 
void compact ()
 Removes all tombstones from the packed array of a sparse set.
 
void swap (const entity_type lhs, const entity_type rhs)
 Swaps two entities in the internal packed array. More...
 
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. More...
 
void sort (Compare compare, Sort algo=Sort{}, Args &&... args)
 Sort all elements according to the given comparison function. More...
 
void respect (const basic_sparse_set &other)
 Sort entities according to their order in another sparse set. More...
 
void clear (void *ud=nullptr)
 Clears a sparse set. More...
 
- Protected Member Functions inherited from entt::basic_storage_impl< Entity, Type, Allocator, typename >
void swap_at (const std::size_t lhs, const std::size_t rhs) final
 Swaps two entities in the internal packed array. More...
 
void move_and_pop (const std::size_t from, const std::size_t to) final
 Moves an entity in the internal packed array. More...
 
void swap_and_pop (const Entity entt, void *ud) override
 Attempts to erase an entity from the internal packed array. More...
 
void in_place_pop (const Entity entt, void *ud) override
 Attempts to erase an entity from the internal packed array. More...
 
- Protected Member Functions inherited from entt::basic_sparse_set< Entity, std::allocator_traits< Allocator >::template rebind_alloc< Entity > >
virtual void swap_at ([[maybe_unused]] const std::size_t lhs,[[maybe_unused]] const std::size_t rhs)
 Swaps two entities in the internal packed array. More...
 
virtual void move_and_pop ([[maybe_unused]] const std::size_t from,[[maybe_unused]] const std::size_t to)
 Moves an entity in the internal packed array. More...
 
virtual void swap_and_pop (const Entity entt,[[maybe_unused]] void *ud)
 Attempts to erase an entity from the internal packed array. More...
 
virtual void in_place_pop (const Entity entt,[[maybe_unused]] void *ud)
 Attempts to erase an entity from the internal packed array. More...
 

Detailed Description

template<typename Entity, typename Type, typename Allocator>
struct entt::basic_storage< Entity, Type, Allocator >

Storage implementation dispatcher.

Template Parameters
EntityA valid entity type (see entt_traits for more details).
TypeType of objects assigned to the entities.
AllocatorType of allocator used to manage memory and elements.

Definition at line 1006 of file storage.hpp.


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