sensormanager: use bus reference_wrapper over pointer
Switch the SensorManager class to use a `reference_wrapper` to the
sdbusplus connection rather than a raw pointer for code safety.
This has a side-effect of disabling the default constructor for the
class, which implicates using wrappers like `std::optional`.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I799d4564f0dbd9698951f0ec8e86a7272299ebf6
diff --git a/sensors/builder.cpp b/sensors/builder.cpp
index 166977b..1c63623 100644
--- a/sensors/builder.cpp
+++ b/sensors/builder.cpp
@@ -46,7 +46,7 @@
const std::map<std::string, conf::SensorConfig>& config,
sdbusplus::bus_t& passive, sdbusplus::bus_t& host)
{
- SensorManager mgmr(passive, host);
+ SensorManager mgmr{passive, host};
auto& hostSensorBus = mgmr.getHostBus();
auto& passiveListeningBus = mgmr.getPassiveBus();