![]() |
Gaia-ECS v1.0.0
A simple and powerful entity component system
|
Heap-allocated paged storage for elements of type T. More...
#include <paged_storage.h>
Public Types | |
| using | value_type = T |
| Element type. | |
| using | reference = T & |
| Reference to an element. | |
| using | const_reference = const T & |
| Reference to a read-only element. | |
| using | pointer = T * |
| Pointer to an element. | |
| using | const_pointer = const T * |
| Pointer to a read-only element. | |
| using | view_policy = mem::auto_view_policy< T > |
| Data-layout access policy for the element type. | |
| using | difference_type = detail::difference_type |
| Type used for iterator distances. | |
| using | size_type = detail::size_type |
| Type used for sizes and indices. | |
| using | Allocator = mem::PagedAllocator< T, AllocatorBlockSize > |
| Allocator used for page data. | |
| using | page_data_type = detail::mem_page_data< T > |
| Raw page-data type. | |
| using | page_type = detail::mem_page< T, Allocator > |
| Page type used by the storage. | |
| using | iterator = page_iterator< T, Allocator, true > |
| Forward mutable iterator. | |
| using | iterator_reverse = page_iterator< T, Allocator, false > |
| Reverse mutable iterator. | |
| using | iterator_soa = page_iterator_soa< T, Allocator, true > |
| Forward mutable iterator for structure-of-arrays elements. | |
| using | iterator_soa_reverse = page_iterator_soa< T, Allocator, false > |
| Reverse mutable iterator for structure-of-arrays elements. | |
| using | const_iterator = const_page_iterator< T, Allocator, true > |
| Forward read-only iterator. | |
| using | const_iterator_reverse = const_page_iterator< T, Allocator, false > |
| Reverse read-only iterator. | |
| using | const_iterator_soa = const_page_iterator_soa< T, Allocator, true > |
| Forward read-only iterator for structure-of-arrays elements. | |
| using | const_iterator_soa_reverse = const_page_iterator_soa< T, Allocator, false > |
| Reverse read-only iterator for structure-of-arrays elements. | |
| using | iterator_category = core::bidirectional_iterator_tag |
| Iterator category tag. | |
Public Member Functions | |
| page_storage (const page_storage &other) | |
| Copy-constructs a storage. | |
| page_storage & | operator= (const page_storage &other) |
| Copy-assigns a storage. | |
| page_storage (page_storage &&other) noexcept | |
| Move-constructs a storage. | |
| page_storage & | operator= (page_storage &&other) noexcept |
| Move-assigns a storage. | |
| GAIA_NODISCARD decltype(auto) | operator[] (page_storage_id id) noexcept |
| Accesses an element by identifier. | |
| GAIA_NODISCARD decltype(auto) | operator[] (page_storage_id id) const noexcept |
| Accesses an element by identifier. | |
| GAIA_NODISCARD bool | has (page_storage_id id) const noexcept |
| Checks if an item with a given page id exists. | |
| GAIA_NODISCARD bool | has (const T &arg) const noexcept |
| Checks if an item arg exists within the storage. | |
| template<typename TType > | |
| decltype(auto) | add (TType &&arg) |
| Inserts the item arg into the storage. | |
| decltype(auto) | set (page_storage_id id) |
| Accesses the record at the index id for update. | |
| void | del (page_storage_id id) noexcept |
| Removes the item at the index id from the storage. | |
| void | del (const T &arg) noexcept |
| Removes the item arg from the storage. | |
| void | clear () |
| Clears the storage. | |
| GAIA_NODISCARD size_type | size () const noexcept |
| Returns the number of items inserted into the storage. | |
| GAIA_NODISCARD bool | empty () const noexcept |
| Checks if the storage is empty (no items inserted). | |
| GAIA_NODISCARD decltype(auto) | front () noexcept |
| Accesses the first stored element. | |
| GAIA_NODISCARD decltype(auto) | front () const noexcept |
| Accesses the first stored element. | |
| GAIA_NODISCARD decltype(auto) | back () noexcept |
| Accesses the last stored element. | |
| GAIA_NODISCARD decltype(auto) | back () const noexcept |
| Accesses the last stored element. | |
| GAIA_NODISCARD auto | begin () noexcept |
| Returns an iterator to the first stored element. | |
| GAIA_NODISCARD auto | begin () const noexcept |
| Returns an iterator to the first stored element. | |
| GAIA_NODISCARD auto | cbegin () const noexcept |
| Returns a read-only iterator to the first stored element. | |
| GAIA_NODISCARD auto | end () noexcept |
| Returns an iterator past the last stored element. | |
| GAIA_NODISCARD auto | end () const noexcept |
| Returns an iterator past the last stored element. | |
| GAIA_NODISCARD auto | cend () const noexcept |
| Returns a read-only iterator past the last stored element. | |
| GAIA_NODISCARD auto | rbegin () noexcept |
| Returns a reverse iterator to the last stored element. | |
| GAIA_NODISCARD auto | rbegin () const noexcept |
| Returns a reverse iterator to the last stored element. | |
| GAIA_NODISCARD auto | crbegin () const noexcept |
| Returns a read-only reverse iterator to the last stored element. | |
| GAIA_NODISCARD auto | rend () noexcept |
| Returns a reverse iterator before the first stored element. | |
| GAIA_NODISCARD auto | rend () const noexcept |
| Returns a reverse iterator before the first stored element. | |
| GAIA_NODISCARD auto | crend () const noexcept |
| Returns a read-only reverse iterator before the first stored element. | |
| GAIA_NODISCARD bool | operator== (const page_storage &other) const noexcept |
| Checks whether two storages contain equal elements. | |
| GAIA_NODISCARD bool | operator!= (const page_storage &other) const noexcept |
| Checks whether two storages differ. | |
Static Public Attributes | |
| static constexpr uint32_t | AllocatorBlockSize = (uint32_t)sizeof(detail::mem_page_data<T>) |
| Size in bytes of one allocator block. | |
| static constexpr uint32_t | PageCapacity = page_type::PageCapacity |
| Maximum number of elements addressable in one page. | |
Heap-allocated paged storage for elements of type T.
| T | Element type. |
|
inline |
Copy-constructs a storage.
| other | Storage to copy. |
|
inlinenoexcept |
Move-constructs a storage.
| other | Storage to move from. |
|
inline |
Inserts the item arg into the storage.
| TType | Type of the forwarded item. |
| arg | Data |
|
inlinenoexcept |
Accesses the last stored element.
|
inlinenoexcept |
Accesses the last stored element.
|
inlinenoexcept |
Returns an iterator to the first stored element.
|
inlinenoexcept |
Returns an iterator to the first stored element.
|
inlinenoexcept |
Returns a read-only iterator to the first stored element.
|
inlinenoexcept |
Returns a read-only iterator past the last stored element.
|
inlinenoexcept |
Returns a read-only reverse iterator to the last stored element.
|
inlinenoexcept |
Returns a read-only reverse iterator before the first stored element.
Removes the item arg from the storage.
| arg | Data |
|
inlinenoexcept |
Removes the item at the index id from the storage.
| id | Page id |
|
inlinenoexcept |
Checks if the storage is empty (no items inserted).
|
inlinenoexcept |
Returns an iterator past the last stored element.
|
inlinenoexcept |
Returns an iterator past the last stored element.
|
inlinenoexcept |
Accesses the first stored element.
|
inlinenoexcept |
Accesses the first stored element.
|
inlinenoexcept |
Checks if an item arg exists within the storage.
| arg | Data |
arg exists in the storage.
|
inlinenoexcept |
Checks if an item with a given page id exists.
| id | Page id |
id exists.
|
inlinenoexcept |
Checks whether two storages differ.
| other | Storage to compare with. |
|
inline |
Copy-assigns a storage.
| other | Storage to copy. |
|
inlinenoexcept |
Move-assigns a storage.
| other | Storage to move from. |
|
inlinenoexcept |
Checks whether two storages contain equal elements.
| other | Storage to compare with. |
|
inlinenoexcept |
Accesses an element by identifier.
| id | Identifier of an existing element. |
|
inlinenoexcept |
Accesses an element by identifier.
| id | Identifier of an existing element. |
|
inlinenoexcept |
Returns a reverse iterator to the last stored element.
|
inlinenoexcept |
Returns a reverse iterator to the last stored element.
|
inlinenoexcept |
Returns a reverse iterator before the first stored element.
|
inlinenoexcept |
Returns a reverse iterator before the first stored element.
|
inline |
Accesses the record at the index id for update.
| id | Page id |
|
inlinenoexcept |
Returns the number of items inserted into the storage.