![]() |
Gaia-ECS v0.9.3
A simple and powerful entity component system
|
Implicit list. Rather than with pointers, items. More...
#include <ilist.h>
Public Types | |
| using | internal_storage = TInternalStorage |
| using | value_type = TListItem |
| using | reference = TListItem & |
| using | const_reference = const TListItem & |
| using | pointer = TListItem * |
| using | const_pointer = const TListItem * |
| using | difference_type = typename internal_storage::difference_type |
| using | size_type = typename internal_storage::size_type |
| using | iterator = typename internal_storage::iterator |
| using | const_iterator = typename internal_storage::const_iterator |
| using | iterator_category = typename internal_storage::iterator_category |
Public Member Functions | |
| GAIA_NODISCARD pointer | data () noexcept |
| GAIA_NODISCARD const_pointer | data () const noexcept |
| GAIA_NODISCARD reference | operator[] (size_type index) |
| GAIA_NODISCARD const_reference | operator[] (size_type index) const |
| void | clear () |
| GAIA_NODISCARD size_type | get_next_free_item () const noexcept |
| GAIA_NODISCARD size_type | get_free_items () const noexcept |
| GAIA_NODISCARD size_type | item_count () const noexcept |
| GAIA_NODISCARD size_type | size () const noexcept |
| GAIA_NODISCARD bool | empty () const noexcept |
| GAIA_NODISCARD size_type | capacity () const noexcept |
| GAIA_NODISCARD iterator | begin () noexcept |
| GAIA_NODISCARD const_iterator | begin () const noexcept |
| GAIA_NODISCARD const_iterator | cbegin () const noexcept |
| GAIA_NODISCARD iterator | end () noexcept |
| GAIA_NODISCARD const_iterator | end () const noexcept |
| GAIA_NODISCARD const_iterator | cend () const noexcept |
| void | reserve (size_type cap) |
| GAIA_NODISCARD TItemHandle | alloc (void *ctx) |
| Allocates a new item in the list. | |
| GAIA_NODISCARD TItemHandle | alloc () |
| Allocates a new item in the list. | |
| TListItem & | free (TItemHandle handle) |
| Invalidates handle. Every time an item is deallocated its generation is increased by one. | |
| void | validate () const |
| Verifies that the implicit linked list is valid. | |
Public Attributes | |
| internal_storage | m_items |
| Implicit list items. | |
| size_type | m_nextFreeIdx = (size_type)-1 |
| Index of the next item to recycle. | |
| size_type | m_freeItems = 0 |
| Number of items to recycle. | |
Implicit list. Rather than with pointers, items.
| TListItem | are linked together through an internal indexing mechanism. To the outside world they are presented as |
| TItemHandle. | All items are stored in a container instance of the type |
| TInternalStorage. | |
| TListItem | needs to expose slot metadata through ilist_item_traits<TListItem> and expose a constructor that initializes the slot index and generation. |
|
inline |
Allocates a new item in the list.
|
inline |
Allocates a new item in the list.
|
inline |
Invalidates handle. Every time an item is deallocated its generation is increased by one.
| handle | Handle |