blob: 8807eba095d4da8df27f5eed8ce5f05c85e94f41 [file] [log] [blame]
Matt Spinler131870c2019-09-25 13:29:04 -05001#pragma once
2
3#include "section.hpp"
4#include "stream.hpp"
5
6namespace openpower
7{
8namespace pels
9{
10namespace section_factory
11{
12
13/**
14 * @brief Create a PEL section based on its data
15 *
16 * This creates the appropriate PEL section object based on the section ID in
17 * the first 2 bytes of the stream, but returns the base class Section pointer.
18 *
19 * If there isn't a class specifically for that section, it defaults to
20 * creating an instance of the 'Generic' class.
21 *
22 * @param[in] pelData - The PEL data stream
23 *
24 * @return std::unique_ptr<Section> - class of the appropriate type
25 */
26std::unique_ptr<Section> create(Stream& pelData);
27
28} // namespace section_factory
29} // namespace pels
30} // namespace openpower