sensorhandler: use entity-map from json if filled

Step 4 of the transition from YAML to JSON will return the data from the
JSON file if present and valid, otherwise it'll fallback and return the
default example YAML present in the repository.

Tested: This was not tested.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I33c773fc53660a9eb5e27a8c8c3e231c64fe079d
diff --git a/entity_map_json.hpp b/entity_map_json.hpp
index 54884ee..3ab4ff2 100644
--- a/entity_map_json.hpp
+++ b/entity_map_json.hpp
@@ -1,6 +1,7 @@
 #pragma once
 
 #include <ipmid/types.hpp>
+#include <memory>
 #include <nlohmann/json.hpp>
 
 namespace ipmi
@@ -33,5 +34,24 @@
  */
 EntityInfoMap buildJsonEntityMap(const nlohmann::json& data);
 
+/**
+ * @brief Owner of the EntityInfoMap.
+ */
+class EntityInfoMapContainer
+{
+  public:
+    /** Get ahold of the owner. */
+    static EntityInfoMapContainer* getContainer();
+    /** Get ahold of the records. */
+    const EntityInfoMap& getIpmiEntityRecords();
+
+  private:
+    EntityInfoMapContainer(const EntityInfoMap& entityRecords) :
+        entityRecords(entityRecords)
+    {
+    }
+    EntityInfoMap entityRecords;
+};
+
 } // namespace sensor
 } // namespace ipmi