![]() |
Gaia-ECS v0.9.3
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 |
| using | reference = T & |
| using | const_reference = const T & |
| using | pointer = T * |
| using | const_pointer = const T * |
| using | view_policy = mem::auto_view_policy< T > |
| using | difference_type = detail::difference_type |
| using | size_type = detail::size_type |
| using | Allocator = mem::PagedAllocator< T, AllocatorBlockSize > |
| using | page_data_type = detail::mem_page_data< T > |
| using | page_type = detail::mem_page< T, Allocator > |
| using | iterator = page_iterator< T, Allocator, true > |
| using | iterator_reverse = page_iterator< T, Allocator, false > |
| using | iterator_soa = page_iterator_soa< T, Allocator, true > |
| using | iterator_soa_reverse = page_iterator_soa< T, Allocator, false > |
| using | const_iterator = const_page_iterator< T, Allocator, true > |
| using | const_iterator_reverse = const_page_iterator< T, Allocator, false > |
| using | const_iterator_soa = const_page_iterator_soa< T, Allocator, true > |
| using | const_iterator_soa_reverse = const_page_iterator_soa< T, Allocator, false > |
| using | iterator_category = core::bidirectional_iterator_tag |
Public Member Functions | |
| page_storage (const page_storage &other) | |
| page_storage & | operator= (const page_storage &other) |
| page_storage (page_storage &&other) noexcept | |
| page_storage & | operator= (page_storage &&other) noexcept |
| GAIA_NODISCARD decltype(auto) | operator[] (page_storage_id id) noexcept |
| GAIA_NODISCARD decltype(auto) | operator[] (page_storage_id id) const noexcept |
| 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) |
| Update the record at the index id. | |
| 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 |
| GAIA_NODISCARD decltype(auto) | front () const noexcept |
| GAIA_NODISCARD decltype(auto) | back () noexcept |
| GAIA_NODISCARD decltype(auto) | back () const noexcept |
| GAIA_NODISCARD auto | begin () noexcept |
| GAIA_NODISCARD auto | begin () const noexcept |
| GAIA_NODISCARD auto | cbegin () const noexcept |
| GAIA_NODISCARD auto | end () noexcept |
| GAIA_NODISCARD auto | end () const noexcept |
| GAIA_NODISCARD auto | cend () const noexcept |
| GAIA_NODISCARD auto | rbegin () noexcept |
| GAIA_NODISCARD auto | rbegin () const noexcept |
| GAIA_NODISCARD auto | crbegin () const noexcept |
| GAIA_NODISCARD auto | rend () noexcept |
| GAIA_NODISCARD auto | rend () const noexcept |
| GAIA_NODISCARD auto | crend () const noexcept |
| GAIA_NODISCARD bool | operator== (const page_storage &other) const noexcept |
| GAIA_NODISCARD bool | operator!= (const page_storage &other) const noexcept |
Static Public Attributes | |
| static constexpr uint32_t | AllocatorBlockSize = (uint32_t)sizeof(detail::mem_page_data<T>) |
| static constexpr uint32_t | PageCapacity = page_type::PageCapacity |
Heap-allocated paged storage for elements of type T.
|
inline |
Inserts the item arg into the storage.
| arg | Data |
|
inlinenoexcept |
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 an item arg exists within the storage.
| arg | Data |
|
inlinenoexcept |
Checks if an item with a given page id exists.
| id | Page id |
|
inline |
Update the record at the index id.
| id | Page id |