Add CPU and memory LocationCode DBus interface

LocationCode DBus interface can describe the sockets with physical
labels printed on the board. Bmcweb looks up the LocationCode for CPU
and DIMM resources and then identify the resource location. Those
physical CPU and DIMM socket labels are hardcoded in SMBIOS table as
socket designation.

Tested:
CPU and memory DBus objects show the
xyz.openbmc_project.Inventory.Decorator.LocationCode interface and the
LocationCode property is the socket label.

Signed-off-by: Jie Yang <jjy@google.com>
Change-Id: I6131567aca1958505989773fc800a4c2d1dd7e1f
diff --git a/include/cpu.hpp b/include/cpu.hpp
index d4871fb..96cb367 100644
--- a/include/cpu.hpp
+++ b/include/cpu.hpp
@@ -18,6 +18,7 @@
 #include "smbios_mdrv2.hpp"
 
 #include <xyz/openbmc_project/Inventory/Decorator/Asset/server.hpp>
+#include <xyz/openbmc_project/Inventory/Decorator/LocationCode/server.hpp>
 #include <xyz/openbmc_project/Inventory/Decorator/Revision/server.hpp>
 #include <xyz/openbmc_project/Inventory/Item/Cpu/server.hpp>
 #include <xyz/openbmc_project/Inventory/Item/server.hpp>
@@ -32,6 +33,8 @@
     sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Revision;
 using asset =
     sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Asset;
+using location =
+    sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::LocationCode;
 using processor = sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu;
 using Item = sdbusplus::xyz::openbmc_project::Inventory::server::Item;
 
@@ -90,7 +93,7 @@
                          std::nullopt,
                          std::nullopt};
 
-class Cpu : sdbusplus::server::object_t<processor, asset, rev, Item>
+class Cpu : sdbusplus::server::object_t<processor, asset, location, rev, Item>
 {
   public:
     Cpu() = delete;
@@ -102,7 +105,7 @@
 
     Cpu(sdbusplus::bus::bus& bus, const std::string& objPath,
         const uint8_t& cpuId, uint8_t* smbiosTableStorage) :
-        sdbusplus::server::object_t<processor, asset, rev, Item>(
+        sdbusplus::server::object_t<processor, asset, location, rev, Item>(
             bus, objPath.c_str()),
         cpuNum(cpuId), storage(smbiosTableStorage)
     {