Emit signal and remove sensors from dbus

When a sensor is configured to be removed upon certain return codes
being returned when read, that sensor object should emit the proper
signals and be removed from dbus. This may have previously been
occurring but recently it was noticed that is not the case, so emit an
object removed signal so the sensor object is removed from dbus and any
applications subscribed to that sensor will be notified.

Tested:
    For a sensor configured to be removed upon a rc, triggered that bad
sensor read rc and used `busctl monitor` to see signals.

Change-Id: Ia9557ea548bd5a00a9bd6fdf91d4aa91d8458225
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/mainloop.cpp b/mainloop.cpp
index db79134..7f446a7 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -479,6 +479,11 @@
     // Remove any sensors marked for removal
     for (const auto& i : _rmSensors)
     {
+        // Remove sensor object from dbus using emit_object_removed()
+        auto& objInfo = std::get<ObjectInfo>(_state[i.first]);
+        auto& objPath = std::get<std::string>(objInfo);
+        _bus.emit_object_removed(objPath.c_str());
+        // Erase sensor object info
         _state.erase(i.first);
     }