rename Object type to InterfaceMap
Rename the Object type to InterfaceMap to give it a less opaque name.
The word object is somewhat overloaded.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ie1862450c15c8a8cecf7fcbec3552608d6a20cce
diff --git a/mainloop.cpp b/mainloop.cpp
index f99decb..09c148b 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -163,7 +163,7 @@
objectPath.append(1, '/');
objectPath.append(std::get<sensorLabel>(properties));
- ObjectInfo info(&_bus, std::move(objectPath), Object());
+ ObjectInfo info(&_bus, std::move(objectPath), InterfaceMap());
RetryIO retryIO(hwmonio::retries, hwmonio::delay);
if (_rmSensors.find(sensor.first) != _rmSensors.end())
{
@@ -375,7 +375,7 @@
{
int64_t value;
auto& objInfo = std::get<ObjectInfo>(i.second);
- auto& obj = std::get<Object>(objInfo);
+ auto& obj = std::get<InterfaceMap>(objInfo);
auto it = obj.find(InterfaceType::STATUS);
if (it != obj.end())
diff --git a/sensor.cpp b/sensor.cpp
index 89f8330..e6e8413 100644
--- a/sensor.cpp
+++ b/sensor.cpp
@@ -131,7 +131,7 @@
// Get the initial value for the value interface.
auto& bus = *std::get<sdbusplus::bus::bus*>(info);
- auto& obj = std::get<Object>(info);
+ auto& obj = std::get<InterfaceMap>(info);
auto& objPath = std::get<std::string>(info);
SensorValueType val = 0;
@@ -193,7 +193,7 @@
std::shared_ptr<StatusObject> iface = nullptr;
auto& objPath = std::get<std::string>(info);
- auto& obj = std::get<Object>(info);
+ auto& obj = std::get<InterfaceMap>(info);
// Check if fault sysfs file exists
std::string faultName = _sensor.first;
diff --git a/targets.hpp b/targets.hpp
index 540338c..a954394 100644
--- a/targets.hpp
+++ b/targets.hpp
@@ -70,7 +70,7 @@
std::shared_ptr<T> target;
namespace fs = std::filesystem;
- auto& obj = std::get<Object>(info);
+ auto& obj = std::get<InterfaceMap>(info);
auto& objPath = std::get<std::string>(info);
auto type = Targets<T>::type;
diff --git a/thresholds.hpp b/thresholds.hpp
index 188dc76..4d2fcff 100644
--- a/thresholds.hpp
+++ b/thresholds.hpp
@@ -86,7 +86,7 @@
int64_t value, ObjectInfo& info, int64_t scale)
{
auto& objPath = std::get<std::string>(info);
- auto& obj = std::get<Object>(info);
+ auto& obj = std::get<InterfaceMap>(info);
std::shared_ptr<T> iface;
auto tLo = env::getEnv(Thresholds<T>::envLo, sensorType, sensorID);
diff --git a/types.hpp b/types.hpp
index 2ba6a21..e079003 100644
--- a/types.hpp
+++ b/types.hpp
@@ -9,7 +9,7 @@
#include <tuple>
#include <utility>
-using Object = std::map<InterfaceType, std::any>;
-using ObjectInfo = std::tuple<sdbusplus::bus::bus*, std::string, Object>;
+using InterfaceMap = std::map<InterfaceType, std::any>;
+using ObjectInfo = std::tuple<sdbusplus::bus::bus*, std::string, InterfaceMap>;
using RetryIO = std::tuple<size_t, std::chrono::milliseconds>;
using ObjectStateData = std::pair<std::string, ObjectInfo>;