SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::ObservableValue< T > Class Template Reference

A value that notifies its observers if it gets changed. More...

#include <sensesp/system/observablevalue.h>

Inheritance diagram for sensesp::ObservableValue< T >:
[legend]

Public Member Functions

 ObservableValue ()
 
 ObservableValue (const T &value)
 
void set (const T &value)
 
const T & operator= (const T &value)
 
- Public Member Functions inherited from sensesp::ValueProducer< T >
 ValueProducer ()
 
virtual const T & get () const
 
void connect_to (ValueConsumer< T > *consumer, uint8_t input_channel=0)
 
template<typename CT >
void connect_to (ValueConsumer< CT > *consumer, uint8_t input_channel=0)
 Connect a producer to a consumer of a different type.
 
template<typename T2 >
Transform< T, T2 > * connect_to (Transform< T, T2 > *consumer_producer, uint8_t input_channel=0)
 
template<typename TT , typename T2 >
Transform< TT, T2 > * connect_to (Transform< TT, T2 > *consumer_producer, uint8_t input_channel=0)
 Connect a producer to a transform with a different input type.
 
void emit (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

- Protected Attributes inherited from sensesp::ValueProducer< T >
output
 

Detailed Description

template<class T>
class sensesp::ObservableValue< T >

A value that notifies its observers if it gets changed.

Definition at line 27 of file observablevalue.h.

Constructor & Destructor Documentation

◆ ObservableValue() [1/2]

template<class T >
sensesp::ObservableValue< T >::ObservableValue ( )
inline

Definition at line 29 of file observablevalue.h.

◆ ObservableValue() [2/2]

template<class T >
sensesp::ObservableValue< T >::ObservableValue ( const T &  value)
inline

Definition at line 31 of file observablevalue.h.

Member Function Documentation

◆ operator=()

template<class T >
const T & sensesp::ObservableValue< T >::operator= ( const T &  value)
inline

Definition at line 35 of file observablevalue.h.

Here is the call graph for this function:

◆ set()

template<class T >
void sensesp::ObservableValue< T >::set ( const T &  value)
inline

Definition at line 33 of file observablevalue.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

template<class T >
template<class U >
bool operator!= ( ObservableValue< U > const lhs,
U const rhs 
)
friend

◆ operator==

template<class T >
template<class U >
bool operator== ( ObservableValue< U > const lhs,
U const rhs 
)
friend

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