blob: cb8c48907e601f9a6c9486c4272ba5d04559bc46 [file] [log] [blame]
#pragma once
#include "const.hpp"
#include "parser_interface.hpp"
#include "store.hpp"
#include "types.hpp"
#include <vector>
namespace openpower
{
namespace vpd
{
namespace ipz
{
namespace parser
{
using ParserInterface = openpower::vpd::parser::interface::ParserInterface;
using kwdVpdMap = openpower::vpd::inventory::KeywordVpdMap;
class IpzVpdParser : public ParserInterface
{
public:
IpzVpdParser() = delete;
IpzVpdParser(const IpzVpdParser&) = delete;
IpzVpdParser& operator=(const IpzVpdParser&) = delete;
IpzVpdParser(IpzVpdParser&&) = delete;
IpzVpdParser& operator=(IpzVpdParser&&) = delete;
~IpzVpdParser() = default;
/**
* @brief Constructor
*/
IpzVpdParser(Binary&& VpdVector) : vpd(std::move(VpdVector))
{
}
/**
* @brief Parse the memory VPD binary data.
* Collects and emplace the keyword-value pairs in map.
*
* @return map of keyword:value
*/
std::variant<kwdVpdMap, Store> parse();
/**
* @brief An api to return interface name with respect to
* the parser selected.
*
* @return - Interface name for that vpd type.
*/
std::string getInterfaceName() const;
/** @brief API to check vpd header
* @param [in] vpd - VPDheader in binary format
*/
void processHeader();
private:
Binary vpd;
}; // class IpzVpdParser
} // namespace parser
} // namespace ipz
} // namespace vpd
} // namespace openpower