SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
transform.h
Go to the documentation of this file.
1#ifndef _transform_H_
2#define _transform_H_
3
4#include <ArduinoJson.h>
5
6#include <set>
7
8#include "sensesp.h"
14
15namespace sensesp {
16
17// TODO: Split into multiple files
18
20// Transforms transform raw device readouts into useful sensor values.
21
31class TransformBase : public Configurable, public Startable {
32 public:
34
35 // Primary purpose of this was to supply Signal K sources
36 // (now handled by SKEmitter::get_sources). Should
37 // this be deprecated?
38 static const std::set<TransformBase*>& get_transforms() {
39 return transforms_;
40 }
41
42 private:
43 static std::set<TransformBase*> transforms_;
44};
45
51template <typename C, typename P>
89
94template <typename T>
95class SymmetricTransform : public Transform<T, T> {
96 public:
98};
99
104
105} // namespace sensesp
106
107#endif
An object that is capable of having configuration data that can be set remotely using a RESTful API,...
Construct a new transform based on a single function.
Automatic calling of the start() method at startup.
Definition startable.h:20
A common type of transform that consumes, transforms, then outputs values of the same data type.
Definition transform.h:95
SymmetricTransform(String config_path="")
Definition transform.h:97
The base class for all transforms. A transforms takes a value in, transforms it in some way,...
Definition transform.h:31
static const std::set< TransformBase * > & get_transforms()
Definition transform.h:38
The main Transform class. A transform is identified primarily by the type of value that is produces (...
Definition transform.h:54
Transform(String config_path="")
Definition transform.h:56
Transform< C, P > * connect_from(ValueProducer< P > *producer0, ValueProducer< P > *producer1=NULL, ValueProducer< P > *producer2=NULL, ValueProducer< P > *producer3=NULL, ValueProducer< P > *producer4=NULL)
Definition transform.h:68
A base class for piece of code (like a transform) that accepts data for input. ValueConsumers can acc...
void connect_from(ValueProducer< T > *producer, uint8_t input_channel=0)
A base class for any sensor or piece of code that outputs a value for consumption elsewhere.
SymmetricTransform< String > StringTransform
Definition transform.h:103
SymmetricTransform< bool > BooleanTransform
Definition transform.h:102
SymmetricTransform< int > IntegerTransform
Definition transform.h:101
SymmetricTransform< float > FloatTransform
Definition transform.h:100