blob: 2f11affae096980d48d811075fa7068a582fdd39 [file] [log] [blame]
SunnySrivastava1984e12b1812020-05-26 02:23:11 -05001#pragma once
2
3#include "store.hpp"
4#include "types.hpp"
5
6#include <variant>
7
8namespace openpower
9{
10namespace vpd
11{
12namespace parser
13{
14namespace interface
15{
16using kwdVpdMap = openpower::vpd::inventory::KeywordVpdMap;
17
18/** @class ParserInterface
19 * @brief Interface class for vpd parsers.
20 *
21 * Any concrete parser class, implementing the parser logic needs to
22 * derive from this interface class and ovverride the methods declared
23 * in this class.
24 */
25class ParserInterface
26{
27 public:
28 /**
29 * @brief An api to implement parsing logic for VPD file.
30 * Needs to be implemented by all the class deriving from
31 * parser inerface.
32 *
33 * @return parsed format for vpd data, depending upon the
34 * parsing logic.
35 */
36 virtual std::variant<kwdVpdMap, Store> parse() = 0;
37
38 /**
39 * @brief An api to return interface name which will hold the
40 * data on cache.
41 * Needs to be implemented by all the class deriving fronm
42 * parser inerface
43 *
44 * @return - Interface name for that vpd type.
45 */
46 virtual std::string getInterfaceName() const = 0;
47 // virtual void test() = 0;
48
49 /**
50 * @brief Virtual destructor for the interface.
51 */
52 virtual ~ParserInterface()
53 {
54 }
55
56}; // class Parserinterface
57} // namespace interface
58} // namespace parser
59} // namespace vpd
60} // namespace openpower