|
ecs
|
SparseArray class. More...
#include <SparseArray.hpp>
Public Types | |
| using | value_type = std::optional< Component > |
| using | reference_type = value_type & |
| using | const_reference_type = value_type const & |
| using | container_t = std::vector< value_type > |
| using | size_type = typename container_t::size_type |
| using | iterator = typename container_t::iterator |
| using | const_iterator = typename container_t::const_iterator |
Public Member Functions | |
| SparseArray ()=default | |
| construct a new SparseArray object | |
| SparseArray (SparseArray const &)=default | |
| copy constructor | |
| SparseArray (SparseArray &&) noexcept=default | |
| move constructor | |
| ~SparseArray ()=default | |
| Destroy the Sparse Array object. | |
| SparseArray & | operator= (SparseArray const &)=default |
| copy operator= | |
| SparseArray & | operator= (SparseArray &&) noexcept=default |
| move operator= | |
| reference_type | operator[] (size_t idx) |
| give the value at the index idx of the SparseArray | |
| const_reference_type | operator[] (size_t idx) const |
| give the value at the index idx of the SparseArray (const) | |
| iterator | begin () |
| give a iterator at the begining of the SparseArray | |
| const_iterator | begin () const |
| give a const_iterator at the begining of the SparseArray | |
| const_iterator | cbegin () const |
| give a const_iterator at the begining of the SparseArray | |
| iterator | end () |
| give a iterator at the end of the SparseArray | |
| const_iterator | end () const |
| give a const_iterator at the end of the SparseArray | |
| const_iterator | cend () const |
| give a const_iterator at the end of the SparseArray | |
| size_type | size () const |
| give the size of the SparseArray | |
| reference_type | insertAt (size_type pos, Component const &c) |
| insert a component at the given position & return a reference to it | |
| reference_type | insertAt (size_type pos, Component &&c) |
| insert a component at the given position & return a reference to it | |
| template<class ... Params> | |
| reference_type | emplaceAt (size_type pos, Params &&...args) |
| emplace a component at the given position & return a reference to it | |
| void | erase (size_type pos) |
| erase the component at the given position | |
| size_type | getIndex (const value_type &v) const |
| get the index of the given value | |
| void | print () const |
| print the SparseArray | |
SparseArray class.
| Component |
| using ecs::SparseArray< Component >::const_iterator = typename container_t::const_iterator |
| using ecs::SparseArray< Component >::const_reference_type = value_type const & |
| using ecs::SparseArray< Component >::container_t = std::vector<value_type> |
| using ecs::SparseArray< Component >::iterator = typename container_t::iterator |
| using ecs::SparseArray< Component >::reference_type = value_type & |
| using ecs::SparseArray< Component >::size_type = typename container_t::size_type |
| using ecs::SparseArray< Component >::value_type = std::optional<Component> |
|
default |
construct a new SparseArray object
|
default |
copy constructor
| size |
|
defaultnoexcept |
move constructor
| size |
|
default |
Destroy the Sparse Array object.
|
inline |
give a iterator at the begining of the SparseArray
|
inline |
give a const_iterator at the begining of the SparseArray
|
inline |
give a const_iterator at the begining of the SparseArray
|
inline |
give a const_iterator at the end of the SparseArray
|
inline |
emplace a component at the given position & return a reference to it
| Params |
| pos | |
| args |
|
inline |
give a iterator at the end of the SparseArray
|
inline |
give a const_iterator at the end of the SparseArray
|
inline |
erase the component at the given position
| pos |
|
inline |
get the index of the given value
| v |
|
inline |
insert a component at the given position & return a reference to it
| pos | |
| c |
|
inline |
insert a component at the given position & return a reference to it
| pos | |
| c |
|
defaultnoexcept |
|
default |
|
inline |
|
inline |
give the value at the index idx of the SparseArray (const)
| idx |
|
inline |
print the SparseArray
|
inline |
give the size of the SparseArray