platform-mc: Defer adding sensor objects from PDRs

After all PDRs retrieved from the other terminus are parsed into pdr
structs. They will be processed further to create sensor objects (e.g
via `addNumericSensor` function for Numeric Sensors).

During this phase for one sensor, sensor name is achieved (may enlist
Sensor Aux Name PDRs), and NumericSensor object is constructed.
Sensor object construction involves parsing pdr struct elements into
sensor class variables, D-Bus interface initialization and many calls
to set D-Bus object properties.

They are actually not blocking actions, but as it continuously loops
through sensor PDRs in `parseTerminusPDRs` to add sensors, they take
too much time and prevent BMC from processing events coming from other
termini. Not to mention the adding of new sensor types in the future
and the increase in sensor numbers, the total time will be large, while
this is not a primary task in the initialization phase of a terminus.

This commit defers `addNumericSensor` and `addCompactNumericSensor`
calls using sdeventplus::source::Defer event source, instead of
continuously calling them while looping through the sensor PDRs, to let
events coming from other termini break in and be processed by BMC.

Tested:

While BMC is getting, parsing sensor PDRs and creating sensor objects
from those PDRs, events can still be received from the other termini.

Change-Id: I4a3bacd4139b51c302e36614757fa1b5e5105f21
Signed-off-by: Chau Ly <chaul@amperecomputing.com>
diff --git a/platform-mc/sensor_manager.hpp b/platform-mc/sensor_manager.hpp
index c82b336..ce61d8f 100644
--- a/platform-mc/sensor_manager.hpp
+++ b/platform-mc/sensor_manager.hpp
@@ -19,6 +19,8 @@
 namespace platform_mc
 {
 
+using namespace pldm::pdr;
+
 /**
  * @brief SensorManager
  *
@@ -117,9 +119,8 @@
     /** @brief Available state for pldm request of terminus */
     std::map<pldm_tid_t, Availability> availableState;
 
-    /** @brief round robin sensor list */
-    std::map<pldm_tid_t, std::queue<std::shared_ptr<NumericSensor>>>
-        roundRobinSensors;
+    /** @brief Round robin sensor iter of terminus */
+    std::map<pldm_tid_t, SensorID> roundRobinSensorItMap;
 
     /** @brief pointer to Manager */
     Manager* manager;