|
ESP32 PSRAM Library
|
Vector implementation that uses ESP32's high memory (himem) for storage. More...
#include <VectorHIMEM.h>
Public Member Functions | |
| VectorHIMEM ()=default | |
| Default constructor - creates an empty vector. | |
| VectorHIMEM (const VectorHIMEM &other) | |
| Copy constructor. More... | |
| VectorHIMEM (size_type count) | |
| Constructs a vector with the given number of default-initialized elements. More... | |
| VectorHIMEM (size_type count, const T &value) | |
| Constructs a vector with the given number of copies of a value. More... | |
| VectorHIMEM (std::initializer_list< T > init) | |
| Initializer list constructor. More... | |
| VectorHIMEM (VectorHIMEM &&other) noexcept | |
| Move constructor. More... | |
| ~VectorHIMEM () | |
| Destructor - ensures all elements are properly destroyed. | |
| reference | at (size_type pos) |
| Access element with bounds checking. More... | |
| const_reference | at (size_type pos) const |
| Access element with bounds checking (const version) More... | |
| reference | back () |
| Access the last element. More... | |
| const_reference | back () const |
| Access the last element (const version) More... | |
| size_type | capacity () const |
| Get the number of elements that can be held in current storage. More... | |
| void | clear () |
| Clear the contents. | |
| bool | empty () const |
| Check if the vector is empty. More... | |
| void | erase (size_type pos) |
| Erase an element. More... | |
| reference | front () |
| Access the first element. More... | |
| const_reference | front () const |
| Access the first element (const version) More... | |
| void | insert (size_type pos, const T &value) |
| Insert an element at a specific position. More... | |
| size_type | max_size () const |
| Get the maximum possible number of elements. More... | |
| VectorHIMEM & | operator= (const VectorHIMEM &other) |
| Copy assignment operator. More... | |
| VectorHIMEM & | operator= (std::initializer_list< T > ilist) |
| Initializer list assignment operator. More... | |
| VectorHIMEM & | operator= (VectorHIMEM &&other) noexcept |
| Move assignment operator. More... | |
| reference | operator[] (size_type pos) |
| Access element without bounds checking. More... | |
| const_reference | operator[] (size_type pos) const |
| void | pop_back () |
| Remove the last element. | |
| void | push_back (const T &value) |
| Add an element to the end. More... | |
| void | push_back (T &&value) |
| Add an element to the end by moving it. More... | |
| void | reserve (size_type new_cap) |
| Reserve storage. More... | |
| void | resize (size_type count) |
| Change the number of elements stored. More... | |
| void | resize (size_type count, const value_type &value) |
| Change the number of elements stored. More... | |
| size_type | size () const |
| Get the number of elements. More... | |
| void | swap (VectorHIMEM &other) noexcept |
| Swap the contents of this vector with another. More... | |
Protected Member Functions | |
| bool | reallocate (size_t new_capacity) |
| Reallocate memory with a new capacity. More... | |
Static Protected Member Functions | |
| static size_t | calculate_size_bytes (size_t count) |
| Calculate required memory size in bytes for a given number of elements. More... | |
Protected Attributes | |
| size_t | element_capacity = 0 |
| size_t | element_count = 0 |
| HimemBlock | memory |
Static Protected Attributes | |
| static constexpr size_t | min_elements = 16 |
Vector implementation that uses ESP32's high memory (himem) for storage.
| T | Type of elements stored in the vector |
|
inlineexplicit |
Constructs a vector with the given number of default-initialized elements.
| count | The size of the vector |
|
inline |
Constructs a vector with the given number of copies of a value.
| count | The size of the vector |
| value | The value to initialize elements with |
|
inline |
Copy constructor.
| other | The vector to copy from |
|
inlinenoexcept |
Move constructor.
| other | The vector to move from |
|
inline |
Initializer list constructor.
| init | The initializer list to copy from |
|
inline |
Access element with bounds checking.
| pos | The position of the element |
| std::out_of_range | if pos is not within the range of the vector |
|
inline |
Access element with bounds checking (const version)
| pos | The position of the element |
| std::out_of_range | if pos is not within the range of the vector |
|
inline |
Access the last element.
|
inline |
Access the last element (const version)
|
inlinestaticprotected |
Calculate required memory size in bytes for a given number of elements.
| count | Number of elements |
|
inline |
Get the number of elements that can be held in current storage.
|
inline |
Check if the vector is empty.
|
inline |
Erase an element.
| pos | Index of the element to erase |
|
inline |
Access the first element.
|
inline |
Access the first element (const version)
|
inline |
Insert an element at a specific position.
| pos | Position where the element should be inserted |
| value | The value to insert |
|
inline |
Get the maximum possible number of elements.
|
inline |
Copy assignment operator.
| other | The vector to copy from |
|
inline |
Initializer list assignment operator.
| ilist | The initializer list to copy from |
|
inlinenoexcept |
Move assignment operator.
| other | The vector to move from |
|
inline |
Access element without bounds checking.
| pos | The position of the element |
|
inline |
Add an element to the end.
| value | The value to append |
|
inline |
Add an element to the end by moving it.
| value | The value to append |
|
inlineprotected |
Reallocate memory with a new capacity.
| new_capacity | The new capacity to allocate |
|
inline |
Reserve storage.
| new_cap | The new capacity of the vector |
|
inline |
Change the number of elements stored.
| count | The new size of the vector |
|
inline |
Change the number of elements stored.
| count | The new size of the vector |
| value | The value to initialize new elements with |
|
inline |
Get the number of elements.
|
inlinenoexcept |
Swap the contents of this vector with another.
| other | Vector to swap with |