blob: 8a519e2d419d93fa71a17c82df6361bee27e2a0a [file] [log] [blame]
Matt Spinler32f13c92019-10-09 12:48:25 -05001#include "callouts.hpp"
2
3namespace openpower
4{
5namespace pels
6{
7namespace src
8{
9
10Callouts::Callouts(Stream& pel)
11{
12 pel >> _subsectionID >> _subsectionFlags >> _subsectionWordLength;
13
14 size_t currentLength = sizeof(_subsectionID) + sizeof(_subsectionFlags) +
15 sizeof(_subsectionWordLength);
16
17 while ((_subsectionWordLength * 4) > currentLength)
18 {
19 _callouts.emplace_back(new Callout(pel));
20 currentLength += _callouts.back()->flattenedSize();
21 }
22}
23
24void Callouts::flatten(Stream& pel)
25{
26 pel << _subsectionID << _subsectionFlags << _subsectionWordLength;
27
28 for (auto& callout : _callouts)
29 {
30 callout->flatten(pel);
31 }
32}
33
34} // namespace src
35} // namespace pels
36} // namespace openpower