blob: 97a96b8fd203764a6d9f88d24d8e450862823612 [file] [log] [blame]
#pragma once
#include "parser_interface.hpp"
#include "types.hpp"
namespace openpower
{
namespace vpd
{
namespace parser
{
namespace factory
{
/** @class ParserFactory
* @brief Factory calss to instantiate concrete parser class.
*
* This class should be used to instantiate an instance of parser class based
* on the typeof vpd file.
*/
class ParserFactory
{
public:
ParserFactory() = delete;
~ParserFactory() = delete;
ParserFactory(const ParserFactory&) = delete;
ParserFactory& operator=(const ParserFactory&) = delete;
ParserFactory(ParserFactory&&) = delete;
ParserFactory& operator=(ParserFactory&&) = delete;
/**
* @brief A method to get object of concrete parser class.
* @param[in] - vpd file to check for the type.
* @param[in] - InventoryPath to call out FRU in case PEL is logged.
* @return - Pointer to concrete parser class object.
*/
static interface::ParserInterface*
getParser(const Binary& vpdVector, const std::string& inventoryPath);
/**
* @brief A method to delete the parser object.
* @param[in] - Pointer to the parser object.
*/
static void freeParser(interface::ParserInterface* parser);
}; // ParserFactory
} // namespace factory
} // namespace parser
} // namespace vpd
} // namespace openpower