ESPHome  2021.11.4
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_callable< F, X... >::value, int > = 0>
 TemplatableValue (F value)
 
template<typename F , enable_if_t< is_callable< 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  { EMPTY, 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 20 of file automation.h.

Member Enumeration Documentation

◆ anonymous enum

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

Definition at line 55 of file automation.h.

Constructor & Destructor Documentation

◆ TemplatableValue() [1/3]

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

Definition at line 22 of file automation.h.

◆ TemplatableValue() [2/3]

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

Definition at line 25 of file automation.h.

◆ TemplatableValue() [3/3]

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

Definition at line 28 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 30 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 40 of file automation.h.

◆ value()

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

Definition at line 32 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 47 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 62 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 61 of file automation.h.


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