BioDynaMo
v1.05.120-25dc9790
|
#include <inline_vector.h>
Classes | |
struct | Iterator |
Public Types | |
using | value_type = T |
using | iterator = typename InlineVector::template Iterator< T, InlineVector > |
using | const_iterator = typename InlineVector::template Iterator< const T, const InlineVector > |
Public Member Functions | |
InlineVector (TRootIOCtor *io_ctor) | |
InlineVector ()=default | |
InlineVector (const InlineVector< T, N > &other) | |
InlineVector (InlineVector< T, N > &&other) noexcept | |
~InlineVector () | |
uint16_t | capacity () const |
void | clear () |
void | reserve (uint16_t new_capacity) |
uint16_t | size () const |
returns the number of elements in this container More... | |
void | push_back (const T &element) |
iterator | erase (const iterator &it) |
std::vector< T > | make_std_vector () const |
InlineVector< T, N > & | operator= (const InlineVector< T, N > &other) |
InlineVector< T, N > & | operator= (InlineVector< T, N > &&other) noexcept |
T & | operator[] (uint16_t index) |
const T & | operator[] (uint16_t index) const |
bool | operator== (const InlineVector< T, N > &other) const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
Private Member Functions | |
uint16_t | HeapSize () const |
BDM_CLASS_DEF_NV (InlineVector, 2) | |
Private Attributes | |
std::array< T, N > | data_ |
uint16_t | size_ = 0 |
uint16_t | heap_capacity_ = 0 |
T * | heap_data_ = nullptr |
Static Private Attributes | |
static constexpr float | kGrowFactor = 1.5 |
Friends | |
std::ostream & | operator<< (std::ostream &out, const InlineVector< T, N > &other) |
This contains stores up to N elements without heap allocations If further elements are added elements are stored on the heap Container grows in a geometric sequence Elements are contiguous in memory except the transition from internal to heap allocated memory (between index N-1 and N) This container is optimized for minimal overhead. Therefore, it can only store 65535 elements.
Definition at line 49 of file inline_vector.h.
using bdm::InlineVector< T, N >::const_iterator = typename InlineVector::template Iterator<const T, const InlineVector> |
Definition at line 155 of file inline_vector.h.
using bdm::InlineVector< T, N >::iterator = typename InlineVector::template Iterator<T, InlineVector> |
Definition at line 153 of file inline_vector.h.
using bdm::InlineVector< T, N >::value_type = T |
Definition at line 152 of file inline_vector.h.
|
inlineexplicit |
Definition at line 157 of file inline_vector.h.
|
default |
|
inline |
Definition at line 160 of file inline_vector.h.
|
inlinenoexcept |
Definition at line 170 of file inline_vector.h.
|
inline |
Definition at line 178 of file inline_vector.h.
|
private |
|
inline |
Definition at line 344 of file inline_vector.h.
|
inline |
Definition at line 346 of file inline_vector.h.
|
inline |
Returns the number of elements that the container has currently allocated space for.
Definition at line 187 of file inline_vector.h.
|
inline |
Removes all elements from the container. Leaves capacity() unchanged.
Definition at line 191 of file inline_vector.h.
|
inline |
Definition at line 345 of file inline_vector.h.
|
inline |
Definition at line 347 of file inline_vector.h.
|
inline |
Definition at line 240 of file inline_vector.h.
|
inlineprivate |
Definition at line 356 of file inline_vector.h.
|
inline |
Definition at line 261 of file inline_vector.h.
|
inline |
Definition at line 269 of file inline_vector.h.
|
inlinenoexcept |
Definition at line 287 of file inline_vector.h.
|
inline |
Definition at line 315 of file inline_vector.h.
|
inline |
Definition at line 299 of file inline_vector.h.
|
inline |
Definition at line 307 of file inline_vector.h.
|
inline |
adds elements to this container and allocates additional memory on the heap if required
Definition at line 219 of file inline_vector.h.
|
inline |
Increase the capacity of the container to a value that's greater or equal to new_capacity. If new_cap is greater than the current capacity()
, new storage is allocated, otherwise the method does nothing.
If new_cap is greater than capacity()
, all iterators and references, including the past-the-end iterator, are invalidated. Otherwise, no iterators or references are invalidated.
Definition at line 202 of file inline_vector.h.
|
inline |
returns the number of elements in this container
Definition at line 215 of file inline_vector.h.
|
friend |
Definition at line 336 of file inline_vector.h.
|
private |
Definition at line 351 of file inline_vector.h.
|
private |
Definition at line 353 of file inline_vector.h.
|
private |
Definition at line 354 of file inline_vector.h.
|
staticconstexprprivate |
Definition at line 350 of file inline_vector.h.
|
private |
Definition at line 352 of file inline_vector.h.