rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
sensor_converter_func.h
Go to the documentation of this file.
1#pragma once
2
3#include "sensor.h"
4
6 // Trying to copy a converter func by value is almost guaranteed to be a bug - disallow it
8 // ...but doing so requires explicitly declaring the default constructor, so do that too.
9 SensorConverter() = default;
10
11 virtual SensorResult convert(float raw) const = 0;
12 virtual void showInfo(float testRawValue) const {
13 // Unused base - nothing to print
14 (void)testRawValue;
15 }
16};
Base class for sensors. Inherit this class to implement a new type of sensor.
expected< float > SensorResult
Definition sensor.h:46
virtual void showInfo(float testRawValue) const
SensorConverter()=default
SensorConverter(const SensorConverter &)=delete
virtual SensorResult convert(float raw) const =0