1 #pragma once
2 
3 #include "section.hpp"
4 #include "stream.hpp"
5 
6 namespace openpower
7 {
8 namespace pels
9 {
10 namespace 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  */
26 std::unique_ptr<Section> create(Stream& pelData);
27 
28 } // namespace section_factory
29 } // namespace pels
30 } // namespace openpower
31