blob: 259ef861ab27745943d144a58089d909cb94d426 [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
Manojkiran Edaaf921752024-06-17 15:10:21 +053022 * derive from this interface class and override the methods declared
SunnySrivastava1984e12b1812020-05-26 02:23:11 -050023 * 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
Manojkiran Edaaf921752024-06-17 15:10:21 +053031 * parser interface.
SunnySrivastava1984e12b1812020-05-26 02:23:11 -050032 *
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
Manojkiran Edaaf921752024-06-17 15:10:21 +053042 * parser interface
SunnySrivastava1984e12b1812020-05-26 02:23:11 -050043 *
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 */
Patrick Williamsc78d8872023-05-10 07:50:56 -050052 virtual ~ParserInterface() {}
SunnySrivastava1984e12b1812020-05-26 02:23:11 -050053
54}; // class Parserinterface
55} // namespace interface
56} // namespace parser
57} // namespace vpd
58} // namespace openpower