ESPHome  2024.12.2
Public Member Functions | Protected Types | Protected Attributes
esphome::TemplatableValue< T, X > Class Template Reference

#include <automation.h>

Public Member Functions

 TemplatableValue ()
 
template<typename F , enable_if_t<!is_invocable< F, X... >::value, int > = 0>
 TemplatableValue (F value)
 
template<typename F , enable_if_t< is_invocable< F, X... >::value, int > = 0>
 TemplatableValue (F f)
 
bool has_value ()
 
value (X... x)
 
optional< T > optional_value (X... x)
 
value_or (X... x, T default_value)
 

Protected Types

enum  { NONE, VALUE, LAMBDA }
 

Protected Attributes

enum esphome::TemplatableValue:: { ... }  type_
 
value_ {}
 
std::function< T(X...)> f_ {}
 

Detailed Description

template<typename T, typename... X>
class esphome::TemplatableValue< T, X >

Definition at line 25 of file automation.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename T, typename... X>
anonymous enum
protected
Enumerator
NONE 
VALUE 
LAMBDA 

Definition at line 60 of file automation.h.

Constructor & Destructor Documentation

◆ TemplatableValue() [1/3]

template<typename T, typename... X>
esphome::TemplatableValue< T, X >::TemplatableValue ( )
inline

Definition at line 27 of file automation.h.

◆ TemplatableValue() [2/3]

template<typename T, typename... X>
template<typename F , enable_if_t<!is_invocable< F, X... >::value, int > = 0>
esphome::TemplatableValue< T, X >::TemplatableValue ( value)
inline

Definition at line 30 of file automation.h.

◆ TemplatableValue() [3/3]

template<typename T, typename... X>
template<typename F , enable_if_t< is_invocable< F, X... >::value, int > = 0>
esphome::TemplatableValue< T, X >::TemplatableValue ( f)
inline

Definition at line 33 of file automation.h.

Member Function Documentation

◆ has_value()

template<typename T, typename... X>
bool esphome::TemplatableValue< T, X >::has_value ( )
inline

Definition at line 35 of file automation.h.

◆ optional_value()

template<typename T, typename... X>
optional<T> esphome::TemplatableValue< T, X >::optional_value ( X...  x)
inline

Definition at line 45 of file automation.h.

◆ value()

template<typename T, typename... X>
T esphome::TemplatableValue< T, X >::value ( X...  x)
inline

Definition at line 37 of file automation.h.

◆ value_or()

template<typename T, typename... X>
T esphome::TemplatableValue< T, X >::value_or ( X...  x,
default_value 
)
inline

Definition at line 52 of file automation.h.

Field Documentation

◆ f_

template<typename T, typename... X>
std::function<T(X...)> esphome::TemplatableValue< T, X >::f_ {}
protected

Definition at line 67 of file automation.h.

◆ type_

enum { ... } esphome::TemplatableValue< T, X >::type_

◆ value_

template<typename T, typename... X>
T esphome::TemplatableValue< T, X >::value_ {}
protected

Definition at line 66 of file automation.h.


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