blob: 8a519e2d419d93fa71a17c82df6361bee27e2a0a [file] [log] [blame]
#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