Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 1 | #include "private_header.hpp" |
| 2 | |
| 3 | namespace attn |
| 4 | { |
| 5 | namespace pel |
| 6 | { |
| 7 | |
| 8 | PrivateHeader::PrivateHeader(Stream& pel) |
| 9 | { |
| 10 | unflatten(pel); |
| 11 | } |
| 12 | |
| 13 | void PrivateHeader::flatten(Stream& stream) const |
| 14 | { |
| 15 | stream << _header << _createTimestamp << _commitTimestamp << _creatorID |
| 16 | << _reservedByte1 << _reservedByte2 << _sectionCount << _obmcLogID |
| 17 | << _creatorVersion << _plid << _id; |
| 18 | } |
| 19 | |
| 20 | void PrivateHeader::unflatten(Stream& stream) |
| 21 | { |
| 22 | stream >> _header >> _createTimestamp >> _commitTimestamp >> _creatorID >> |
| 23 | _reservedByte1 >> _reservedByte2 >> _sectionCount >> _obmcLogID >> |
| 24 | _creatorVersion >> _plid >> _id; |
| 25 | } |
| 26 | |
| 27 | uint8_t PrivateHeader::getSectionCount() |
| 28 | { |
| 29 | return _sectionCount; |
| 30 | } |
| 31 | |
| 32 | void PrivateHeader::setSectionCount(uint8_t sectionCount) |
| 33 | { |
| 34 | _sectionCount = sectionCount; |
| 35 | } |
| 36 | |
Ben Tyner | 135793a | 2021-10-27 09:18:41 -0500 | [diff] [blame] | 37 | void PrivateHeader::setPlid(uint32_t plid) |
| 38 | { |
| 39 | _plid = plid; |
| 40 | } |
| 41 | |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 42 | } // namespace pel |
| 43 | } // namespace attn |