phosphor-post-code-manager: Add post code support for multi host

Added implementation to handle post codes from multiple host to BMC with
multi process approach. Each process handles post codes for corresponding host.

TESTED : Built the openbmc image targetting Facebook YosemiteV2 hardware.
Verified all the host's postcodes stored in corresponding host directories.

Signed-off-by: Kumar Thangavel <thangavel.k@hcl.com>
Change-Id: I29d55558ed165d9e4494f017e13808dff6252b04
diff --git a/src/post_code.cpp b/src/post_code.cpp
index 67a9d8f..d0ba711 100644
--- a/src/post_code.cpp
+++ b/src/post_code.cpp
@@ -17,12 +17,17 @@
 
 #include "iomanip"
 
+PostCodeDataHolder* PostCodeDataHolder::instance = 0;
+
 void PostCode::deleteAll()
 {
-    auto dir = fs::path(PostCodeListPath);
+    auto dir = fs::path(postcodeDataHolderObj->PostCodeListPathPrefix +
+                        std::to_string(postcodeDataHolderObj->node));
     std::uintmax_t n = fs::remove_all(dir);
     std::cerr << "clearPostCodes deleted " << n << " files in "
-              << PostCodeListPath << std::endl;
+              << postcodeDataHolderObj->PostCodeListPathPrefix +
+                     std::to_string(postcodeDataHolderObj->node)
+              << std::endl;
     fs::create_directories(dir);
     postCodes.clear();
     currentBootCycleIndex = 1;
@@ -88,7 +93,7 @@
     }
 
     postCodes.insert(std::make_pair(tsUS, code));
-    serialize(fs::path(PostCodeListPath));
+    serialize(fs::path(strPostCodeListPath));
 
     return;
 }
@@ -207,4 +212,4 @@
         bootNum = currentBootCycleIndex - index + 1;
     }
     return bootNum;
-}
\ No newline at end of file
+}