Interface & Factory implementation for VPD Parsers

This commit abstracts the implementation logic of different parser.
A parser factory is implemented to provide instance of required
parser based on the type of vpd file needed to be parsed.

The interface should be derived to implement any further parser logic
related to vpd.

Status: This does not add any new function, so basic testing of
VPD parsing, VPD tool and writes was performed.

Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
Change-Id: I3ce1a2d6b7e8d8984fd7800132e78ab8a9a21e56
diff --git a/vpd-parser/parser_interface.hpp b/vpd-parser/parser_interface.hpp
new file mode 100644
index 0000000..2f11aff
--- /dev/null
+++ b/vpd-parser/parser_interface.hpp
@@ -0,0 +1,60 @@
+#pragma once
+
+#include "store.hpp"
+#include "types.hpp"
+
+#include <variant>
+
+namespace openpower
+{
+namespace vpd
+{
+namespace parser
+{
+namespace interface
+{
+using kwdVpdMap = openpower::vpd::inventory::KeywordVpdMap;
+
+/** @class ParserInterface
+ *  @brief Interface class for vpd parsers.
+ *
+ *  Any concrete parser class, implementing the parser logic needs to
+ *  derive from this interface class and ovverride the methods declared
+ *  in this class.
+ */
+class ParserInterface
+{
+  public:
+    /**
+     * @brief An api to implement parsing logic for VPD file.
+     * Needs to be implemented by all the class deriving from
+     * parser inerface.
+     *
+     * @return parsed format for vpd data, depending upon the
+     * parsing logic.
+     */
+    virtual std::variant<kwdVpdMap, Store> parse() = 0;
+
+    /**
+     * @brief An api to return interface name which will hold the
+     * data on cache.
+     * Needs to be implemented by all the class deriving fronm
+     * parser inerface
+     *
+     * @return - Interface name for that vpd type.
+     */
+    virtual std::string getInterfaceName() const = 0;
+    // virtual void test() = 0;
+
+    /**
+     * @brief Virtual destructor for the interface.
+     */
+    virtual ~ParserInterface()
+    {
+    }
+
+}; // class Parserinterface
+} // namespace interface
+} // namespace parser
+} // namespace vpd
+} // namespace openpower