less hacky implementation
This commit is contained in:
parent
eb46386c36
commit
7bb5560150
|
@ -120,6 +120,13 @@ public:
|
|||
*/
|
||||
const char* getSensorName() { return getSensorName(m_type); }
|
||||
|
||||
// Retrieve the current reading from the sensor.
|
||||
//
|
||||
// Override this in a particular sensor's implementation. As reading sensors is in many hot paths,
|
||||
// it is unwise to synchronously read the sensor or do anything otherwise costly here. At the most,
|
||||
// this should be field lookup and simple math.
|
||||
virtual SensorResult get() const = 0;
|
||||
|
||||
protected:
|
||||
// Protected constructor - only subclasses call this
|
||||
explicit Sensor(SensorType type)
|
||||
|
@ -128,12 +135,6 @@ protected:
|
|||
static const char* getSensorName(SensorType type);
|
||||
|
||||
private:
|
||||
// Retrieve the current reading from the sensor.
|
||||
//
|
||||
// Override this in a particular sensor's implementation. As reading sensors is in many hot paths,
|
||||
// it is unwise to synchronously read the sensor or do anything otherwise costly here. At the most,
|
||||
// this should be field lookup and simple math.
|
||||
virtual SensorResult get() const = 0;
|
||||
|
||||
/*
|
||||
* Get an unconverted value from the sensor, if available.
|
||||
|
|
Loading…
Reference in New Issue