Add the restoreLedsAssert method for LED manager

- Logically, Since the physical LEDs states should not be operated
  during the lamp test, all the physical LEDs states before and
  during the lamp test should be saved and restored after the lamp
  test.

Tested:
- Store the state of all the physical LEDs before the lamp test,
  and keep the state of all the physical LEDs consistent after
  the lamp test.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I8b321bae2e38001ea33a80bda8badcf4c8a55040
diff --git a/lamptest.hpp b/lamptest.hpp
index ffce377..ef0d7b0 100644
--- a/lamptest.hpp
+++ b/lamptest.hpp
@@ -5,6 +5,7 @@
 
 #include <sdeventplus/utility/timer.hpp>
 
+#include <queue>
 #include <vector>
 
 namespace phosphor
@@ -47,6 +48,18 @@
      */
     void requestHandler(Group* group, bool value);
 
+    /** @brief Update physical LEDs states during lamp test and the lamp test is
+     *         running
+     *
+     *  @param[in]  ledsAssert    -  LEDs that are to be asserted newly or to a
+     *                               different state
+     *  @param[in]  ledsDeAssert  -  LEDs that are to be Deasserted
+     *
+     *  @return Is running lamp test, true running
+     */
+    bool processLEDUpdates(const Manager::group& ledsAssert,
+                           const Manager::group& ledsDeAssert);
+
   private:
     /** @brief Timer used for LEDs lamp test period */
     sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic> timer;
@@ -63,6 +76,16 @@
     /** all the Physical paths */
     std::vector<std::string> physicalLEDPaths;
 
+    /** @brief Queue to save LED states during lamp test */
+    std::queue<std::pair<Manager::group, Manager::group>>
+        updatedLEDsDuringLampTest;
+
+    /** @brief Get state of the lamp test operation */
+    bool isLampTestRunning{false};
+
+    /** @brief Physical LED states prior to lamp test */
+    Manager::group physicalLEDStatesPriorToLampTest;
+
     /** @brief Start and restart lamp test depending on what is the current
      *         state. */
     void start();
@@ -73,6 +96,20 @@
     /** @brief This method gets called when the lamp test procedure is done as
      *         part of timeout. */
     void timeOutHandler();
+
+    /** @brief Restore the physical LEDs states after the lamp test finishes */
+    void restorePhysicalLedStates();
+
+    /** @brief Store the physical LEDs states before the lamp test start */
+    void storePhysicalLEDsStates();
+
+    /** @brief Returns action enum based on string
+     *
+     *  @param[in]  str - Action string
+     *
+     *  @return enumeration equivalent of the passed in string
+     */
+    Layout::Action getActionFromString(const std::string& str);
 };
 
 } // namespace led