|
ESPHome 2026.11.0-dev
|
Owning variant: a codegen table that outlives it, or a heap copy of a runtime list it owns. More...
#include <helpers.h>
Public Types | |
| using | value_type = T |
Public Member Functions | |
| constexpr | ConstVector ()=default |
| constexpr | ConstVector (const T *data, size_t size) |
| ConstVector (const ConstVector &)=delete | |
| ConstVector & | operator= (const ConstVector &)=delete |
| ~ConstVector () | |
| const T * | begin () const |
| const T * | end () const |
| const T * | data () const |
| size_t | size () const |
| bool | empty () const |
| const T & | operator[] (size_t index) const |
| const T & | at (size_t index) const |
| void | assign_static (const T *data, size_t size) |
| Codegen only: call before any runtime copy; it does not free a previous owned copy (generated setup() runs before any lambda or automation can call set_options). | |
| void | assign_copy (const T *data, size_t size) |
| Copies the list into a heap array this owns, freeing a previous owned copy. | |
Protected Member Functions | |
| void | release_ () |
Protected Attributes | |
| const T * | data_ {nullptr} |
| size_t | size_ {0} |
Static Protected Attributes | |
| static constexpr size_t | OWNED_BIT = size_t{1} << (sizeof(size_t) * 8 - 1) |
Owning variant: a codegen table that outlives it, or a heap copy of a runtime list it owns.
Ownership is the top bit of the size; it is not copyable, so a copy can never outlive the owner. Elements must be whole words so ESP8266 can read a codegen table from flash.
| using esphome::ConstVector< T, true >::value_type = T |
|
constexprdefault |
|
inlineconstexpr |
|
delete |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
delete |
|
inline |
|
inlineprotected |
|
inline |
|
protected |
|
staticconstexprprotected |
|
protected |