PEL: Create object for every section

When unflattening a PEL, create objects for every PEL section in the
log.  It will use a factory method to choose which object type to create
based on the section ID in the section header.  All of these object will
go into a vector of Section objects, which is the base class for every
PEL section class.

The factory will default to creating a Generic object when it doesn't
have any other type to create.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ief0e4df5c586a46cea66ca47b4479e3444815309
diff --git a/extensions/openpower-pels/section_factory.hpp b/extensions/openpower-pels/section_factory.hpp
new file mode 100644
index 0000000..8807eba
--- /dev/null
+++ b/extensions/openpower-pels/section_factory.hpp
@@ -0,0 +1,30 @@
+#pragma once
+
+#include "section.hpp"
+#include "stream.hpp"
+
+namespace openpower
+{
+namespace pels
+{
+namespace section_factory
+{
+
+/**
+ * @brief Create a PEL section based on its data
+ *
+ * This creates the appropriate PEL section object based on the section ID in
+ * the first 2 bytes of the stream, but returns the base class Section pointer.
+ *
+ * If there isn't a class specifically for that section, it defaults to
+ * creating an instance of the 'Generic' class.
+ *
+ * @param[in] pelData - The PEL data stream
+ *
+ * @return std::unique_ptr<Section> - class of the appropriate type
+ */
+std::unique_ptr<Section> create(Stream& pelData);
+
+} // namespace section_factory
+} // namespace pels
+} // namespace openpower