|
ESPHome 2026.1.4
|
#include <automation.h>
Public Member Functions | |
| TemplatableValue () | |
| TemplatableValue (const char *str) | |
| template<typename F > requires (!std::invocable<F, X...>) | |
| TemplatableValue (F value) | |
| template<typename F > requires std::invocable<F, X...> && std::convertible_to<F, T (*)(X...)> | |
| TemplatableValue (F f) | |
| template<typename F > requires std::invocable<F, X...> &&(!std::convertible_to<F, T (*)(X...)>) | |
| TemplatableValue (F f) | |
| TemplatableValue (const TemplatableValue &other) | |
| TemplatableValue (TemplatableValue &&other) noexcept | |
| TemplatableValue & | operator= (const TemplatableValue &other) |
| TemplatableValue & | operator= (TemplatableValue &&other) noexcept |
| ~TemplatableValue () | |
| bool | has_value () const |
| T | value (X... x) const |
| optional< T > | optional_value (X... x) |
| T | value_or (X... x, T default_value) |
| bool | is_static_string () const |
| Check if this holds a static string (const char* stored without allocation) | |
| const char * | get_static_string () const |
| Get the static string pointer (only valid if is_static_string() returns true) | |
Protected Types | |
| enum | : uint8_t { NONE , VALUE , LAMBDA , STATELESS_LAMBDA , STATIC_STRING } |
| using | ValueStorage = std::conditional_t<USE_HEAP_STORAGE, T *, T> |
Protected Attributes | ||
| enum esphome::TemplatableValue:: { ... } | type_ | |
| union { | ||
| ValueStorage value_ | ||
| std::function< T(X...)> * f_ | ||
| T(* stateless_f_ )(X...) | ||
| const char * static_str_ | ||
| }; | ||
Definition at line 44 of file automation.h.
|
protected |
Definition at line 204 of file automation.h.
|
protected |
| Enumerator | |
|---|---|
| NONE | |
| VALUE | |
| LAMBDA | |
| STATELESS_LAMBDA | |
| STATIC_STRING | |
Definition at line 194 of file automation.h.
|
inline |
Definition at line 50 of file automation.h.
|
inline |
Definition at line 54 of file automation.h.
|
inline |
Definition at line 58 of file automation.h.
|
inline |
Definition at line 68 of file automation.h.
|
inline |
Definition at line 75 of file automation.h.
|
inline |
Definition at line 80 of file automation.h.
|
inlinenoexcept |
Definition at line 97 of file automation.h.
|
inline |
Definition at line 133 of file automation.h.
|
inline |
Get the static string pointer (only valid if is_static_string() returns true)
Definition at line 191 of file automation.h.
|
inline |
Definition at line 146 of file automation.h.
|
inline |
Check if this holds a static string (const char* stored without allocation)
Definition at line 188 of file automation.h.
|
inline |
Definition at line 117 of file automation.h.
|
inlinenoexcept |
Definition at line 125 of file automation.h.
|
inline |
Definition at line 173 of file automation.h.
|
inline |
Definition at line 148 of file automation.h.
|
inline |
Definition at line 180 of file automation.h.
| union { ... } esphome::TemplatableValue< T, X > |
| std::function<T(X...)>* esphome::TemplatableValue< T, X >::f_ |
Definition at line 207 of file automation.h.
| T(* esphome::TemplatableValue< T, X >::stateless_f_) (X...) |
Definition at line 208 of file automation.h.
| const char* esphome::TemplatableValue< T, X >::static_str_ |
Definition at line 209 of file automation.h.
| enum { ... } esphome::TemplatableValue< T, X >::type_ |
| ValueStorage esphome::TemplatableValue< T, X >::value_ |
Definition at line 206 of file automation.h.