MRPT
2.0.1
|
Container that transparently and dynamically switches between a std::array and std::vector.
Used to avoid heap allocations with small vectors.
#include <mrpt/containers/vector_with_small_size_optimization.h>
Definition at line 34 of file vector_with_small_size_optimization.h.
#include <mrpt/containers/vector_with_small_size_optimization.h>
Classes | |
class | iteratorImpl |
Public Types | |
using | value_type = T |
using | reference = T & |
using | const_reference = const T & |
using | difference_type = typename large_vec::difference_type |
using | size_type = typename large_vec::size_type |
using | iterator = iteratorImpl< VAL, VAL *, VAL & > |
using | const_iterator = iteratorImpl< VAL, const VAL *, const VAL & > |
Public Member Functions | |
vector_with_small_size_optimization ()=default | |
vector_with_small_size_optimization (size_t n) | |
void | resize (size_type n) |
void | fill (const T &v) |
size_t | size () const |
bool | empty () const |
reference | operator[] (size_type n) |
const_reference | operator[] (size_type n) const |
const_reference | back () const |
reference | back () |
const_reference | front () const |
reference | front () |
void | swap (self_t &x) |
iterator | begin () noexcept |
const_iterator | begin () const noexcept |
iterator | end () noexcept |
const_iterator | end () const noexcept |
Private Types | |
using | T = std::conditional_t< std::is_same_v< VAL, bool >, UnspecializedBool, VAL > |
using | ALLOC = mrpt::aligned_allocator_cpp11< T > |
using | self_t = vector_with_small_size_optimization< VAL, small_size, alignment > |
using | large_vec = std::vector< T, ALLOC > |
using | small_array = std::array< T, small_size > |
Private Attributes | |
large_vec | m_v |
small_array | m_a |
bool | m_is_small = true |
size_t | m_size = 0 |
|
private |
Definition at line 39 of file vector_with_small_size_optimization.h.
using mrpt::containers::vector_with_small_size_optimization< VAL, small_size, alignment >::const_iterator = iteratorImpl<VAL, const VAL*, const VAL&> |
Definition at line 141 of file vector_with_small_size_optimization.h.
using mrpt::containers::vector_with_small_size_optimization< VAL, small_size, alignment >::const_reference = const T& |
Definition at line 53 of file vector_with_small_size_optimization.h.
using mrpt::containers::vector_with_small_size_optimization< VAL, small_size, alignment >::difference_type = typename large_vec::difference_type |
Definition at line 54 of file vector_with_small_size_optimization.h.
using mrpt::containers::vector_with_small_size_optimization< VAL, small_size, alignment >::iterator = iteratorImpl<VAL, VAL*, VAL&> |
Definition at line 140 of file vector_with_small_size_optimization.h.
|
private |
Definition at line 42 of file vector_with_small_size_optimization.h.
using mrpt::containers::vector_with_small_size_optimization< VAL, small_size, alignment >::reference = T& |
Definition at line 52 of file vector_with_small_size_optimization.h.
|
private |
Definition at line 41 of file vector_with_small_size_optimization.h.
using mrpt::containers::vector_with_small_size_optimization< VAL, small_size, alignment >::size_type = typename large_vec::size_type |
Definition at line 55 of file vector_with_small_size_optimization.h.
|
private |
Definition at line 43 of file vector_with_small_size_optimization.h.
|
private |
Definition at line 38 of file vector_with_small_size_optimization.h.
using mrpt::containers::vector_with_small_size_optimization< VAL, small_size, alignment >::value_type = T |
Definition at line 51 of file vector_with_small_size_optimization.h.
|
default |
|
inline |
Definition at line 58 of file vector_with_small_size_optimization.h.
|
inline |
Definition at line 182 of file vector_with_small_size_optimization.h.
Referenced by mrpt::math::CVectorDynamic< KFTYPE >::push_back(), and TEST().
|
inline |
Definition at line 186 of file vector_with_small_size_optimization.h.
|
inlinenoexcept |
Definition at line 218 of file vector_with_small_size_optimization.h.
Referenced by mrpt::math::CVectorDynamic< KFTYPE >::begin(), mrpt::math::CMatrixDynamic< mrpt::math::TPoint3D_data< double > >::begin(), mrpt::math::CVectorDynamic< KFTYPE >::cbegin(), and mrpt::math::CMatrixDynamic< mrpt::math::TPoint3D_data< double > >::cbegin().
|
inlinenoexcept |
Definition at line 219 of file vector_with_small_size_optimization.h.
|
inline |
Definition at line 173 of file vector_with_small_size_optimization.h.
Referenced by mrpt::math::CMatrixDynamic< mrpt::math::TPoint3D_data< double > >::data(), mrpt::math::CVectorDynamic< KFTYPE >::empty(), and TEST().
|
inlinenoexcept |
Definition at line 224 of file vector_with_small_size_optimization.h.
Referenced by mrpt::math::CVectorDynamic< KFTYPE >::cend(), mrpt::math::CMatrixDynamic< mrpt::math::TPoint3D_data< double > >::cend(), mrpt::math::CVectorDynamic< KFTYPE >::end(), and mrpt::math::CMatrixDynamic< mrpt::math::TPoint3D_data< double > >::end().
|
inlinenoexcept |
Definition at line 228 of file vector_with_small_size_optimization.h.
|
inline |
Definition at line 164 of file vector_with_small_size_optimization.h.
|
inline |
Definition at line 188 of file vector_with_small_size_optimization.h.
Referenced by TEST().
|
inline |
Definition at line 192 of file vector_with_small_size_optimization.h.
|
inline |
Definition at line 175 of file vector_with_small_size_optimization.h.
|
inline |
Definition at line 177 of file vector_with_small_size_optimization.h.
|
inline |
Definition at line 143 of file vector_with_small_size_optimization.h.
Referenced by mrpt::math::CVectorDynamic< KFTYPE >::push_back(), mrpt::math::CVectorDynamic< KFTYPE >::realloc(), and TEST().
|
inline |
Definition at line 172 of file vector_with_small_size_optimization.h.
Referenced by mrpt::math::CVectorDynamic< KFTYPE >::asEigen(), mrpt::math::CVectorDynamic< KFTYPE >::operator()(), mrpt::math::CVectorDynamic< KFTYPE >::operator[](), mrpt::math::CVectorDynamic< KFTYPE >::push_back(), mrpt::math::CVectorDynamic< KFTYPE >::realloc(), mrpt::math::CVectorDynamic< KFTYPE >::rows(), mrpt::math::CVectorDynamic< KFTYPE >::size(), and TEST().
|
inline |
Definition at line 194 of file vector_with_small_size_optimization.h.
Referenced by mrpt::math::CMatrixDynamic< mrpt::math::TPoint3D_data< double > >::realloc(), mrpt::math::CVectorDynamic< KFTYPE >::swap(), and mrpt::math::CMatrixDynamic< mrpt::math::TPoint3D_data< double > >::swap().
|
private |
Definition at line 46 of file vector_with_small_size_optimization.h.
Referenced by mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::back(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::begin(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::end(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::fill(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::front(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::operator[](), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::resize(), and mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::swap().
|
private |
Definition at line 47 of file vector_with_small_size_optimization.h.
Referenced by mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::back(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::begin(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::end(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::fill(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::front(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::operator[](), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::resize(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::swap(), and mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::vector_with_small_size_optimization().
|
private |
Definition at line 48 of file vector_with_small_size_optimization.h.
Referenced by mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::back(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::empty(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::end(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::resize(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::size(), and mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::swap().
|
private |
Definition at line 45 of file vector_with_small_size_optimization.h.
Referenced by mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::back(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::begin(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::end(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::fill(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::front(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::operator[](), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::resize(), mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::swap(), and mrpt::containers::vector_with_small_size_optimization< NUMTYPE, small_size, MRPT_MAX_STATIC_ALIGN_BYTES >::vector_with_small_size_optimization().
Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020 |