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

A base class for piece of code (like a transform) that accepts data for input. ValueConsumers can accept one or more input values via the set_input() method. They are connected to ValueProducers via the connect_to() method. More...

#include <sensesp/system/valueconsumer.h>

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

Public Member Functions

virtual void set_input (T new_value, uint8_t input_channel=0)
 
void connect_from (ValueProducer< T > *producer, uint8_t input_channel=0)
 

Detailed Description

template<typename T>
class sensesp::ValueConsumer< T >

A base class for piece of code (like a transform) that accepts data for input. ValueConsumers can accept one or more input values via the set_input() method. They are connected to ValueProducers via the connect_to() method.

See also
ValueProducer::connect_to()

Definition at line 22 of file valueconsumer.h.

Member Function Documentation

◆ connect_from()

template<typename T >
void sensesp::ValueConsumer< T >::connect_from ( ValueProducer< T > *  producer,
uint8_t  input_channel = 0 
)
inline

Registers this consumer with the specified producer, letting it know that this consumer would like to receive notifications whenever its value changes.

Parameters
input_channelConsumers can have one or more inputs feeding them. This parameter allows you to specify which input number the producer is connecting to. For single input consumers, leave the index at zero.

Definition at line 42 of file valueconsumer.h.

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

◆ set_input()

template<typename T >
virtual void sensesp::ValueConsumer< T >::set_input ( new_value,
uint8_t  input_channel = 0 
)
inlinevirtual

Used to set an input of this consumer. It is usually called automatically by a ValueProducer.

Parameters
new_valuethe value of the input
input_channelConsumers can have one or more inputs feeding them. This parameter allows you to specify which input number the producer is connecting to. For single input consumers, leave the index at zero.

Reimplemented in sensesp::RgbLed, sensesp::IntegratorT< C, P >, sensesp::ThresholdTransform< C, P >, sensesp::SmartSwitchController, sensesp::ThresholdTransform< float, bool >, sensesp::PWMOutput, sensesp::LambdaConsumer< IN >, sensesp::SystemStatusLed, sensesp::PressRepeater, sensesp::ThresholdTransform< int, bool >, sensesp::RgbLed, sensesp::SmartSwitchController, sensesp::SystemStatusLed, sensesp::DebounceTemplate< T >, sensesp::Enable< T >, sensesp::TimeCounter< T >, sensesp::RepeatReport< T >, sensesp::SKOutput< T >, sensesp::SKPutRequest< T >, sensesp::UIOutput< T >, sensesp::SystemStatusController, and sensesp::SystemStatusController.

Definition at line 32 of file valueconsumer.h.

Here is the caller graph for this function:

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