SensESP 3.0.0-beta.3
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::Transform< C, P > Class Template Reference

The main Transform class. A transform is identified primarily by the type of value that is produces (i.e. a Transform<float> is a ValueProducer<float> that generates float values) More...

#include <sensesp/transforms/transform.h>

Inheritance diagram for sensesp::Transform< C, P >:
[legend]

Public Member Functions

 Transform (String config_path="")
 
Transform< C, P > * connect_from (ValueProducer< P > *producer0, ValueProducer< P > *producer1=NULL, ValueProducer< P > *producer2=NULL, ValueProducer< P > *producer3=NULL, ValueProducer< P > *producer4=NULL)
 
- Public Member Functions inherited from sensesp::TransformBase
 TransformBase (const String &config_path="")
 
- Public Member Functions inherited from sensesp::Configurable
 Configurable (String config_path="", String description="", int sort_order=1000)
 
virtual bool is_async ()
 Return true if the Configurable is asynchronous.
 
bool requires_restart ()
 Return true if the Configurable requires restart after saving.
 
void set_requires_restart (bool requires_restart)
 Set the requires_restart flag.
 
virtual void get_configuration (JsonObject &configObject)
 
virtual ConfigurableResult async_get_configuration ()
 Initiate an asynchronous request to get the current configuration.
 
virtual ConfigurableResult poll_get_result (JsonObject &config)
 Return the current status of the last async_get_configuration() call.
 
virtual bool set_configuration (const JsonObject &config)
 
virtual ConfigurableResult async_set_configuration (const JsonObject &config)
 Initiate an asynchronous request to set the configuration.
 
virtual ConfigurableResult poll_set_result ()
 Return the current status of the last async set_configuration call.
 
virtual String get_config_schema ()
 
String get_description ()
 
Configurableset_description (String description)
 Set the description of the Configurable.
 
int get_sort_order ()
 
Configurableset_sort_order (int sort_order)
 
virtual void save_configuration ()
 
virtual void clear_configuration ()
 Clear existing configuration data.
 
- Public Member Functions inherited from sensesp::ValueConsumer< C >
virtual void set (const C &new_value)
 
virtual void set_input (const C &new_value)
 
void connect_from (ValueProducer< C > *producer)
 
- Public Member Functions inherited from sensesp::ValueProducer< P >
 ValueProducer ()
 
 ValueProducer (const P &initial_value)
 
virtual const P & get () const
 
void connect_to (ValueConsumer< P > *consumer)
 
void connect_to (ValueConsumer< P > &consumer)
 
void connect_to (ValueConsumer< CT > *consumer)
 Connect a producer to a consumer of a different type.
 
void connect_to (ValueConsumer< CT > &consumer)
 
Transform< P, T2 > * connect_to (Transform< P, T2 > *consumer_producer)
 
Transform< P, T2 > * connect_to (Transform< P, T2 > &consumer_producer)
 
Transform< TT, T2 > * connect_to (Transform< TT, T2 > *consumer_producer)
 Connect a producer to a transform with a different input type.
 
Transform< TT, T2 > * connect_to (Transform< TT, T2 > &consumer_producer)
 
void emit (const P &new_value)
 
- Public Member Functions inherited from sensesp::Observable
 Observable ()
 
 Observable (Observable &&other)
 Move constructor.
 
void notify ()
 
void attach (std::function< void()> observer)
 

Additional Inherited Members

- Static Public Member Functions inherited from sensesp::TransformBase
static const std::set< TransformBase * > & get_transforms ()
 
- Static Public Member Functions inherited from sensesp::Configurable
static std::vector< Configurable * > get_configurables ()
 Get configurables.
 
static Configurableget_configurable (String key)
 Get a single Configurable by key.
 
- Public Attributes inherited from sensesp::Configurable
const String config_path_ {}
 
- Protected Member Functions inherited from sensesp::Configurable
virtual void load_configuration ()
 
- Protected Attributes inherited from sensesp::Configurable
String description_ = ""
 
int sort_order_ = 1000
 
bool requires_restart_ = false
 Flag to indicate if the Configurable requires a restart after saving the configuration.
 
- Protected Attributes inherited from sensesp::ValueProducer< P >
output
 
- Static Protected Attributes inherited from sensesp::Configurable
static std::map< String, Configurable * > configurables_
 

Detailed Description

template<typename C, typename P>
class sensesp::Transform< C, P >

The main Transform class. A transform is identified primarily by the type of value that is produces (i.e. a Transform<float> is a ValueProducer<float> that generates float values)

Definition at line 51 of file transform.h.

Constructor & Destructor Documentation

◆ Transform()

template<typename C , typename P >
sensesp::Transform< C, P >::Transform ( String config_path = "")
inline

Definition at line 55 of file transform.h.

Member Function Documentation

◆ connect_from()

template<typename C , typename P >
Transform< C, P > * sensesp::Transform< C, P >::connect_from ( ValueProducer< P > * producer0,
ValueProducer< P > * producer1 = NULL,
ValueProducer< P > * producer2 = NULL,
ValueProducer< P > * producer3 = NULL,
ValueProducer< P > * producer4 = NULL )
inline

A convenience method that allows up to five producers to be quickly connected to the input of the ValueConsumer side of this transform. The first producer will be connected to input channel zero, the second one to input channel 1, etc. "this" is returned, which allows the ValueProducer side of this transform to then be wired to other transforms via a call to connect_to().

Definition at line 67 of file transform.h.

Here is the call graph for this function:

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