Class that handle Element of type Component like a vector which can be holed.
More...
#include <SparseArray.hpp>
|
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 | iterator = typename container_t::iterator |
|
using | const_iterator = typename container_t::const_iterator |
|
using | size_type = typename container_t::size_type |
|
template<typename Component>
class Sparse_array< Component >
Class that handle Element of type Component like a vector which can be holed.
- Template Parameters
-
Component | Type of element that contain the Sparse Array |
◆ Sparse_array() [1/3]
template<typename Component >
Construct a new Sparse_array object.
- Parameters
-
sp_arr | Sparse Array to copy |
◆ Sparse_array() [2/3]
template<typename Component >
Construct a new Sparse_array object.
- Parameters
-
sp_arr | Sparse Array to copy |
◆ Sparse_array() [3/3]
template<typename Component >
Construct a new Sparse_array object.
- Parameters
-
size | Size of the sparse array |
◆ begin() [1/2]
template<typename Component >
Overloads the operator begin()
- Returns
- iterator The first element iterator
◆ begin() [2/2]
template<typename Component >
Overloads the operator begin() const.
- Returns
- const_iterator The first element iterator
◆ cbegin()
template<typename Component >
Overloads the operator cbegin() const.
- Returns
- const_iterator The first element iterator
◆ cend()
template<typename Component >
Overloads the operator cend() const.
- Returns
- const_iterator The last element iterator
◆ emplace_at()
template<typename Component >
template<class... Params>
reference_type Sparse_array< Component >::emplace_at |
( |
size_type |
pos, |
|
|
Params &&... |
params |
|
) |
| |
|
inline |
Overloads the operator emplace_at()
- Template Parameters
-
Params | Type of param to emplace |
- Parameters
-
pos | Index where add the component |
params | Params to add |
- Returns
- reference_type Element added at index
◆ end() [1/2]
template<typename Component >
Overloads the operator ebd()
- Returns
- iterator The last element iterator
◆ end() [2/2]
template<typename Component >
Overloads the operator end() const.
- Returns
- const_iterator The last element iterator
◆ erase()
template<typename Component >
Overloads the operator erase()
- Parameters
-
pos | Index where erase elem |
◆ extend()
template<typename Component >
void Sparse_array< Component >::extend |
( |
size_t |
sizeToExtend | ) |
|
|
inline |
Overload the operator extend()
- Parameters
-
sizeToExtend | Size to extend |
◆ get_index()
template<typename Component >
size_type Sparse_array< Component >::get_index |
( |
value_type const & |
val_type | ) |
const |
|
inline |
Get the index object.
- Parameters
-
- Returns
- size_type
◆ insert_at() [1/2]
template<typename Component >
reference_type Sparse_array< Component >::insert_at |
( |
size_type |
pos, |
|
|
Component && |
component |
|
) |
| |
|
inline |
Overloads the operator insert_at()
- Parameters
-
pos | Index where add the component |
component | component to add |
- Returns
- reference_type Element added at index
◆ insert_at() [2/2]
template<typename Component >
reference_type Sparse_array< Component >::insert_at |
( |
size_type |
pos, |
|
|
Component const & |
component |
|
) |
| |
|
inline |
Overloads the operator insert_at()
- Parameters
-
pos | Index where add the component |
component | component to add |
- Returns
- reference_type Element added at index
◆ operator=() [1/2]
template<typename Component >
Overload the operator =.
- Parameters
-
sp_arr | Sparse Array to add |
- Returns
- Sparse_array& himself
◆ operator=() [2/2]
template<typename Component >
Overload the operator =.
- Parameters
-
sp_arr | Sparse Array to add |
- Returns
- Sparse_array& himself
◆ operator[]() [1/2]
template<typename Component >
reference_type Sparse_array< Component >::operator[] |
( |
size_t |
idx | ) |
|
|
inline |
Overloads the operator [].
- Parameters
-
idx | Index to get in the Sparse Array |
- Returns
- reference_type Element at index
◆ operator[]() [2/2]
template<typename Component >
const_reference_type Sparse_array< Component >::operator[] |
( |
size_t |
idx | ) |
const |
|
inline |
Overloads the operator [] const.
- Parameters
-
idx | Index to get in the Sparse Array |
- Returns
- const_reference_type Element at index
◆ size()
template<typename Component >
Overloads the operator size()
- Returns
- size_type The size of the Sparse Array
The documentation for this class was generated from the following file:
- /home/gurvan-le-letty/delivery/epitech_delivery/semester_5/B-CPP-500/B-CPP-500-PAR-5-1-rtype-martin.vanaud/Libraries/ECS/Source/SparseArray.hpp