control: Switch to using static instance of bus
Update main to use the static reference of the bus from
util::SDBusPlus.getBus() and have each object that needs the bus call
that same util::SDBusPlus.getBus() function to retrieve the same static
reference.
Change-Id: Icd5a0e61819bf1bec8b46daae05443fdcc542b05
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/zone.cpp b/control/json/zone.cpp
index 4d353d5..8db1b4e 100644
--- a/control/json/zone.cpp
+++ b/control/json/zone.cpp
@@ -18,6 +18,7 @@
#include "zone.hpp"
#include "fan.hpp"
+#include "sdbusplus.hpp"
#include <cereal/archives/json.hpp>
#include <cereal/cereal.hpp>
@@ -50,10 +51,10 @@
{{supportedProp, zone::property::supported},
{currentProp, zone::property::current}}}};
-Zone::Zone(const json& jsonObj, sdbusplus::bus::bus& bus,
- const sdeventplus::Event& event, Manager* mgr) :
+Zone::Zone(const json& jsonObj, const sdeventplus::Event& event, Manager* mgr) :
ConfigBase(jsonObj),
- ThermalObject(bus, (fs::path{CONTROL_OBJPATH} /= getName()).c_str(), true),
+ ThermalObject(util::SDBusPlus::getBus(),
+ (fs::path{CONTROL_OBJPATH} /= getName()).c_str(), true),
_manager(mgr), _incDelay(0), _floor(0), _target(0), _incDelta(0),
_decDelta(0), _requestTargetBase(0), _isActive(true),
_incTimer(event, std::bind(&Zone::incTimerExpired, this)),