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

#include <helpers.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 227 of file helpers.h.

Member Enumeration Documentation

◆ anonymous enum

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

Definition at line 262 of file helpers.h.

Constructor & Destructor Documentation

◆ TemplatableValue() [1/3]

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

Definition at line 229 of file helpers.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 232 of file helpers.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 235 of file helpers.h.

Member Function Documentation

◆ has_value()

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

Definition at line 237 of file helpers.h.

◆ optional_value()

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

Definition at line 247 of file helpers.h.

◆ value()

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

Definition at line 239 of file helpers.h.

◆ value_or()

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

Definition at line 254 of file helpers.h.

Field Documentation

◆ f_

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

Definition at line 269 of file helpers.h.

◆ type_

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

◆ value_

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

Definition at line 268 of file helpers.h.


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