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/pel.hpp b/extensions/openpower-pels/pel.hpp
index ff45acb..29a7978 100644
--- a/extensions/openpower-pels/pel.hpp
+++ b/extensions/openpower-pels/pel.hpp
@@ -163,6 +163,17 @@
     }
 
     /**
+     * @brief Returns the optional sections, which is everything but
+     *        the Private and User Headers.
+     *
+     * @return const std::vector<std::unique_ptr<Section>>&
+     */
+    const std::vector<std::unique_ptr<Section>>& optionalSections() const
+    {
+        return _optionalSections;
+    }
+
+    /**
      * @brief Returns the PEL data.
      *
      * @return std::vector<uint8_t> - the raw PEL data
@@ -225,6 +236,11 @@
      * @brief If the PEL came from a flattened data stream.
      */
     bool _fromStream = false;
+
+    /**
+     * @brief Holds all sections by the PH and UH.
+     */
+    std::vector<std::unique_ptr<Section>> _optionalSections;
 };
 
 } // namespace pels