Wildmeshing Toolkit
wmtk::utils::DynamicArray< T, ArraySize > Class Template Reference

#include <DynamicArray.hpp>

Inheritance diagram for wmtk::utils::DynamicArray< T, ArraySize >:
[legend]

Classes

class  Iterator
 

Public Member Functions

T & operator[] (const uint64_t index)
 
const T & operator[] (const uint64_t index) const
 
void emplace_back (const T &val)
 
uint64_t size () const
 
uint64_t capacity () const
 
void reserve (const uint64_t new_capacity)
 
bool uses_vector () const
 
Iterator begin () const
 
Iterator end () const
 

Static Public Member Functions

constexpr static uint64_t array_size ()
 Return the size of the static array. More...
 

Private Member Functions

void switch_to_vector ()
 

Private Attributes

std::array< T, ArraySize > m_array
 
std::vector< T > m_vector
 
bool m_use_vector = false
 
uint64_t m_end_index = 0
 

Detailed Description

template<typename T, uint64_t ArraySize = 50>
class wmtk::utils::DynamicArray< T, ArraySize >

Definition at line 10 of file DynamicArray.hpp.

Member Function Documentation

◆ array_size()

template<typename T , uint64_t ArraySize>
constexpr uint64_t wmtk::utils::DynamicArray< T, ArraySize >::array_size
inlinestaticconstexpr

Return the size of the static array.

This function does NOT return the size of the DynamicArray!

Definition at line 71 of file DynamicArray.hxx.

◆ begin()

template<typename T , uint64_t ArraySize = 50>
Iterator wmtk::utils::DynamicArray< T, ArraySize >::begin ( ) const
inline

Definition at line 46 of file DynamicArray.hpp.

◆ capacity()

template<typename T , uint64_t ArraySize>
uint64_t wmtk::utils::DynamicArray< T, ArraySize >::capacity

Definition at line 62 of file DynamicArray.hxx.

◆ emplace_back()

template<typename T , uint64_t ArraySize>
void wmtk::utils::DynamicArray< T, ArraySize >::emplace_back ( const T &  val)

Definition at line 35 of file DynamicArray.hxx.

Referenced by wmtk::TriMesh::TriMeshOperationExecutor::collapse_edge().

Here is the caller graph for this function:

◆ end()

template<typename T , uint64_t ArraySize = 50>
Iterator wmtk::utils::DynamicArray< T, ArraySize >::end ( ) const
inline

◆ operator[]() [1/2]

template<typename T , uint64_t ArraySize>
T & wmtk::utils::DynamicArray< T, ArraySize >::operator[] ( const uint64_t  index)

Definition at line 13 of file DynamicArray.hxx.

◆ operator[]() [2/2]

template<typename T , uint64_t ArraySize>
const T & wmtk::utils::DynamicArray< T, ArraySize >::operator[] ( const uint64_t  index) const

Definition at line 24 of file DynamicArray.hxx.

◆ reserve()

template<typename T , uint64_t ArraySize>
void wmtk::utils::DynamicArray< T, ArraySize >::reserve ( const uint64_t  new_capacity)

Definition at line 77 of file DynamicArray.hxx.

◆ size()

template<typename T , uint64_t ArraySize>
uint64_t wmtk::utils::DynamicArray< T, ArraySize >::size

Definition at line 56 of file DynamicArray.hxx.

◆ switch_to_vector()

template<typename T , uint64_t ArraySize>
void wmtk::utils::DynamicArray< T, ArraySize >::switch_to_vector
private

Definition at line 97 of file DynamicArray.hxx.

References wmtk::logger().

Here is the call graph for this function:

◆ uses_vector()

template<typename T , uint64_t ArraySize>
bool wmtk::utils::DynamicArray< T, ArraySize >::uses_vector

Definition at line 91 of file DynamicArray.hxx.

Member Data Documentation

◆ m_array

template<typename T , uint64_t ArraySize = 50>
std::array<T, ArraySize> wmtk::utils::DynamicArray< T, ArraySize >::m_array
private

Definition at line 53 of file DynamicArray.hpp.

◆ m_end_index

template<typename T , uint64_t ArraySize = 50>
uint64_t wmtk::utils::DynamicArray< T, ArraySize >::m_end_index = 0
private

Definition at line 57 of file DynamicArray.hpp.

Referenced by wmtk::utils::DynamicArray< T, ArraySize >::end().

◆ m_use_vector

template<typename T , uint64_t ArraySize = 50>
bool wmtk::utils::DynamicArray< T, ArraySize >::m_use_vector = false
private

Definition at line 56 of file DynamicArray.hpp.

◆ m_vector

template<typename T , uint64_t ArraySize = 50>
std::vector<T> wmtk::utils::DynamicArray< T, ArraySize >::m_vector
private

Definition at line 54 of file DynamicArray.hpp.


The documentation for this class was generated from the following files: