|
ESPHome 2026.11.0-dev
|
#include <helpers.h>
Data Structures | |
| struct | Box |
| Heap home of a callable stored by create_boxed(); the header knows how to free it. More... | |
Public Member Functions | |
| void | call (Ts... args) const |
| Invoke the callback. Only valid on Callbacks created via create(), never on default-constructed instances. | |
| void | free_boxed () const |
| Free the callable of a Callback made by create_boxed(); the Callback must not be called afterwards. | |
Static Public Member Functions | |
| template<typename F > | |
| static constexpr bool | fits_inline () |
| Whether create() stores F inline in the ctx pointer. | |
| template<typename F > | |
| static Callback | create (F &&callable) |
| Create from any callable. | |
| template<typename F > | |
| static Callback | create_boxed (F &&callable) |
| Store any callable on the heap with a deleter, for an owner that can later free_boxed() it. | |
Data Fields | |
| void(* | fn_ )(void *, Ts...) |
| void * | ctx_ {nullptr} |
|
inline |
|
inlinestatic |
|
inlinestatic |
Store any callable on the heap with a deleter, for an owner that can later free_boxed() it.
|
inlinestaticconstexpr |
|
inline |
Free the callable of a Callback made by create_boxed(); the Callback must not be called afterwards.
| void* esphome::Callback< void(Ts...)>::ctx_ {nullptr} |
|
inline |