Line |
Branch |
Decision |
Exec |
Source |
1 |
|
|
|
#pragma once |
2 |
|
|
|
|
3 |
|
|
|
#include "sensor.h" |
4 |
|
|
|
|
5 |
|
|
|
struct SensorConverter { |
6 |
|
|
|
// Trying to copy a converter func by value is almost guaranteed to be a bug - disallow it |
7 |
|
|
|
SensorConverter(const SensorConverter&) = delete; |
8 |
|
|
|
// ...but doing so requires explicitly declaring the default constructor, so do that too. |
9 |
|
|
64 |
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 |
|
|
|
}; |
17 |
|
|
|
|