SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
|
A value container that notifies its observers if it gets changed. More...
#include <sensesp/system/observablevalue.h>
Public Member Functions | |
ObservableValue ()=default | |
ObservableValue (const T &value) | |
ObservableValue (const ObservableValue &)=delete | |
ObservableValue & | operator= (const ObservableValue &)=delete |
void | set (const T &value) override |
const T & | operator= (const T &value) |
T & | operator++ () |
T & | operator-- () |
T | operator++ (int) |
T | operator-- (int) |
const T & | operator+= (const T &value) |
const T & | operator-= (const T &value) |
Public Member Functions inherited from sensesp::ValueConsumer< T > | |
virtual void | set_input (const T &new_value) |
void | connect_from (ValueProducer< T > *producer) |
Public Member Functions inherited from sensesp::ValueProducer< T > | |
ValueProducer () | |
ValueProducer (const T &initial_value) | |
virtual const T & | get () const |
template<typename VConsumer > | |
std::enable_if< std::is_base_of< ValueConsumer< typenameVConsumer::input_type >, VConsumer >::value &&std::is_convertible< T, typenameVConsumer::input_type >::value, std::shared_ptr< VConsumer > >::type | connect_to (std::shared_ptr< VConsumer > consumer) |
Connect a producer to a transform with a different input type. | |
template<typename VConsumer > | |
std::enable_if< std::is_base_of< ValueConsumer< typenameVConsumer::input_type >, VConsumer >::value &&std::is_convertible< T, typenameVConsumer::input_type >::value, VConsumer * >::type | connect_to (VConsumer *consumer) |
template<typename VConsumer > | |
std::enable_if< std::is_base_of< ValueConsumer< typenameVConsumer::input_type >, VConsumer >::value &&std::is_convertible< T, typenameVConsumer::input_type >::value, VConsumer * >::type | connect_to (VConsumer &consumer) |
void | emit (const T &new_value) |
Public Member Functions inherited from sensesp::Observable | |
Observable () | |
Observable (Observable &&other) | |
Move constructor. | |
void | notify () |
void | attach (std::function< void()> observer) |
Friends | |
template<class U > | |
bool | operator== (ObservableValue< U > const &lhs, U const &rhs) |
template<class U > | |
bool | operator!= (ObservableValue< U > const &lhs, U const &rhs) |
Additional Inherited Members | |
Public Types inherited from sensesp::ValueConsumer< T > | |
using | input_type = T |
Protected Attributes inherited from sensesp::ValueProducer< T > | |
T | output_ |
A value container that notifies its observers if it gets changed.
Definition at line 29 of file observablevalue.h.
|
default |
|
inline |
Definition at line 33 of file observablevalue.h.
|
delete |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
delete |
|
inline |
|
inlineoverridevirtual |
Used to set an input of this consumer. It is called automatically by a ValueProducer but can also be called manually.
new_value | the value of the input |
Reimplemented from sensesp::ValueConsumer< T >.
Reimplemented in sensesp::PersistingObservableValue< T >, sensesp::PersistingObservableValue< String >, sensesp::TaskQueueProducer< T >, sensesp::TaskQueueProducer< int >, and sensesp::TaskQueueProducer< SKWSConnectionState >.
Definition at line 40 of file observablevalue.h.
|
friend |
|
friend |