PEL: SRC callouts subsection object

This Callouts class represents the optional subsection of an SRC PEL
section that contains FRU callouts.  It is only present in the SRC when
there are callouts, and it comes at the end of the section.

It is basically just a container for the Callout objects that represent
the actual callouts.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I1d4d95b82f9b4943728d7939e3bf89e4a7bcbb75
diff --git a/extensions/openpower-pels/callouts.cpp b/extensions/openpower-pels/callouts.cpp
new file mode 100644
index 0000000..8a519e2
--- /dev/null
+++ b/extensions/openpower-pels/callouts.cpp
@@ -0,0 +1,36 @@
+#include "callouts.hpp"
+
+namespace openpower
+{
+namespace pels
+{
+namespace src
+{
+
+Callouts::Callouts(Stream& pel)
+{
+    pel >> _subsectionID >> _subsectionFlags >> _subsectionWordLength;
+
+    size_t currentLength = sizeof(_subsectionID) + sizeof(_subsectionFlags) +
+                           sizeof(_subsectionWordLength);
+
+    while ((_subsectionWordLength * 4) > currentLength)
+    {
+        _callouts.emplace_back(new Callout(pel));
+        currentLength += _callouts.back()->flattenedSize();
+    }
+}
+
+void Callouts::flatten(Stream& pel)
+{
+    pel << _subsectionID << _subsectionFlags << _subsectionWordLength;
+
+    for (auto& callout : _callouts)
+    {
+        callout->flatten(pel);
+    }
+}
+
+} // namespace src
+} // namespace pels
+} // namespace openpower