#pragma once #include "parser_interface.hpp" #include "types.hpp" namespace openpower { namespace vpd { namespace parser { namespace factory { /** @class ParserFactory * @brief Factory class 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. * @param[in] - vpdFilePath for VPD HW path. * @param[in] - vpdStartOffset for starting offset of VPD. * @return - Pointer to concrete parser class object. */ static interface::ParserInterface* getParser(const Binary& vpdVector, const std::string& inventoryPath, const std::string& vpdFilePath, uint32_t vpdStartOffset); /** * @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