|
void | reserve (const size_type cap) |
| Increases the capacity of a storage. More...
|
|
void | shrink_to_fit () |
| Requests the removal of unused capacity.
|
|
const value_type * | raw () const ENTT_NOEXCEPT |
| Direct access to the array of objects. More...
|
|
value_type * | raw () ENTT_NOEXCEPT |
| Direct access to the array of objects. More...
|
|
const_iterator | cbegin () const ENTT_NOEXCEPT |
| Returns an iterator to the beginning. More...
|
|
const_iterator | begin () const ENTT_NOEXCEPT |
| Returns an iterator to the beginning. More...
|
|
iterator | begin () ENTT_NOEXCEPT |
| Returns an iterator to the beginning. More...
|
|
const_iterator | cend () const ENTT_NOEXCEPT |
| Returns an iterator to the end. More...
|
|
const_iterator | end () const ENTT_NOEXCEPT |
| Returns an iterator to the end. More...
|
|
iterator | end () ENTT_NOEXCEPT |
| Returns an iterator to the end. More...
|
|
const_reverse_iterator | crbegin () const ENTT_NOEXCEPT |
| Returns a reverse iterator to the beginning. More...
|
|
const_reverse_iterator | rbegin () const ENTT_NOEXCEPT |
| Returns a reverse iterator to the beginning. More...
|
|
reverse_iterator | rbegin () ENTT_NOEXCEPT |
| Returns a reverse iterator to the beginning. More...
|
|
const_reverse_iterator | crend () const ENTT_NOEXCEPT |
| Returns a reverse iterator to the end. More...
|
|
const_reverse_iterator | rend () const ENTT_NOEXCEPT |
| Returns a reverse iterator to the end. More...
|
|
reverse_iterator | rend () ENTT_NOEXCEPT |
| Returns a reverse iterator to the end. More...
|
|
const value_type & | get (const entity_type entt) const |
| Returns the object associated with an entity. More...
|
|
value_type & | get (const entity_type entt) |
| Returns the object associated with 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 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 > |
void | insert (EIt first, EIt last, CIt from, CIt to) |
| 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 count, 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...
|
|
| basic_sparse_set ()=default |
| Default constructor.
|
|
| basic_sparse_set (basic_sparse_set &&)=default |
| Default move constructor.
|
|
virtual | ~basic_sparse_set ()=default |
| Default destructor.
|
|
basic_sparse_set & | operator= (basic_sparse_set &&)=default |
| Default move assignment operator. More...
|
|
void | reserve (const size_type cap) |
| Increases the capacity of a sparse set. More...
|
|
size_type | capacity () const ENTT_NOEXCEPT |
| 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 ENTT_NOEXCEPT |
| Returns the extent of a sparse set. More...
|
|
size_type | size () const ENTT_NOEXCEPT |
| Returns the number of elements in a sparse set. More...
|
|
bool | empty () const ENTT_NOEXCEPT |
| Checks whether a sparse set is empty. More...
|
|
const entity_type * | data () const ENTT_NOEXCEPT |
| Direct access to the internal packed array. More...
|
|
iterator | begin () const ENTT_NOEXCEPT |
| Returns an iterator to the beginning. More...
|
|
iterator | end () const ENTT_NOEXCEPT |
| Returns an iterator to the end. More...
|
|
reverse_iterator | rbegin () const ENTT_NOEXCEPT |
| Returns a reverse iterator to the beginning. More...
|
|
reverse_iterator | rend () const ENTT_NOEXCEPT |
| 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...
|
|
void | emplace (const entity_type entt) |
| Assigns an entity to a sparse set. More...
|
|
template<typename It > |
void | insert (It first, It last) |
| Assigns one or more entities to a sparse set. More...
|
|
void | remove (const entity_type entt) |
| Removes an entity from a sparse set. More...
|
|
template<typename It > |
void | remove (It first, It last) |
| Removes multiple entities from a pool. More...
|
|
void | swap (const entity_type lhs, const entity_type rhs) |
| Swaps two entities in the internal packed array. More...
|
|
template<typename Compare , typename Sort = std_sort, typename... Args> |
void | sort_n (const size_type count, Compare compare, Sort algo=Sort{}, Args &&... args) |
| Sort the first count 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...
|
|
void | respect (const basic_sparse_set &other) |
| Sort entities according to their order in another sparse set. More...
|
|
void | clear () ENTT_NOEXCEPT |
| Clears a sparse set.
|
|
template<typename Entity, typename Type, typename = void>
class entt::basic_storage< Entity, Type, typename >
Basic storage implementation.
This class is a refinement of a sparse set that associates an object to an entity. The main purpose of this class is to extend sparse sets to store components in a registry. It guarantees fast access both to the elements and to the entities.
- Note
- Entities and objects have the same order. It's guaranteed both in case of raw access (either to entities or objects) and when using random or input access iterators.
-
Internal data structures arrange elements to maximize performance. There are no guarantees that objects are returned in the insertion order when iterate a storage. Do not make assumption on the order in any case.
- Warning
- Empty types aren't explicitly instantiated. Therefore, many of the functions normally available for non-empty types will not be available for empty ones.
- See also
- sparse_set<Entity>
- Template Parameters
-
Entity | A valid entity type (see entt_traits for more details). |
Type | Type of objects assigned to the entities. |