Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 1 | #include "user_header.hpp" |
| 2 | |
| 3 | namespace attn |
| 4 | { |
| 5 | namespace pel |
| 6 | { |
| 7 | |
| 8 | UserHeader::UserHeader(Stream& pel) |
| 9 | { |
| 10 | unflatten(pel); |
| 11 | } |
| 12 | |
| 13 | void UserHeader::flatten(Stream& stream) const |
| 14 | { |
| 15 | stream << _header << _eventSubsystem << _eventScope << _eventSeverity |
| 16 | << _eventType << _reserved4Byte1 << _problemDomain << _problemVector |
| 17 | << _actionFlags << _reserved4Byte2; |
| 18 | } |
| 19 | |
| 20 | void UserHeader::unflatten(Stream& stream) |
| 21 | { |
| 22 | stream >> _header >> _eventSubsystem >> _eventScope >> _eventSeverity >> |
| 23 | _eventType >> _reserved4Byte1 >> _problemDomain >> _problemVector >> |
| 24 | _actionFlags >> _reserved4Byte2; |
| 25 | } |
| 26 | |
| 27 | void UserHeader::setSubsystem(uint8_t subsystem) |
| 28 | { |
| 29 | _eventSubsystem = subsystem; |
| 30 | } |
| 31 | |
| 32 | void UserHeader::setSeverity(uint8_t severity) |
| 33 | { |
| 34 | _eventSeverity = severity; |
| 35 | } |
| 36 | |
| 37 | void UserHeader::setType(uint8_t type) |
| 38 | { |
| 39 | _eventType = type; |
| 40 | } |
| 41 | |
| 42 | void UserHeader::setAction(uint16_t action) |
| 43 | { |
| 44 | _actionFlags = action; |
| 45 | } |
| 46 | |
| 47 | } // namespace pel |
| 48 | } // namespace attn |