diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-14 14:13:54 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-03-14 14:13:54 +0100 |
commit | 5b6427dde0bb8e3b466793243bbfc185f4739ac6 (patch) | |
tree | bd8f09220d5c2354824f231c214dc6d9364717ce /src/sensor/calibration.hpp | |
parent | 5aa818e65eaa3cc288e097ed3b1a134015215500 (diff) |
refactor: implement & use shared ptr
Diffstat (limited to 'src/sensor/calibration.hpp')
-rw-r--r-- | src/sensor/calibration.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sensor/calibration.hpp b/src/sensor/calibration.hpp index 17f8fa9..c85d336 100644 --- a/src/sensor/calibration.hpp +++ b/src/sensor/calibration.hpp @@ -1,5 +1,6 @@ #pragma once +#include "common/memory/shared_ptr.hpp" #include "sensor/sensor.hpp" #include "serial.hpp" @@ -51,7 +52,8 @@ public: * @param sensor A sensor to calibrate * @param sout A Serial output stream */ - SensorCalibrator(Sensor &sensor, SerialStream sout); + SensorCalibrator(common::SharedPtr<Sensor> sensor, + common::SharedPtr<SerialStream> sout); /** * Calibrates the sensor. @@ -69,7 +71,6 @@ private: static void _adjustValues(SensorCalibratorValues &values); static bool _isValuesInRange(const SensorCalibratorValues &values); - Sensor &_sensor; - - SerialStream _sout; + common::SharedPtr<Sensor> _sensor; + common::SharedPtr<SerialStream> _sout; }; |