blob: 12b21ae5ce748e5c75d4631e11aa2207e7d2e093 [file] [log] [blame]
#include "pce_identity.hpp"
namespace openpower
{
namespace pels
{
namespace src
{
PCEIdentity::PCEIdentity(Stream& pel)
{
pel >> _type >> _size >> _flags >> _mtms;
// Whatever is left is the enclosure name.
if (_size < (4 + _mtms.flattenedSize()))
{
throw std::runtime_error("PCE identity structure size field too small");
}
size_t pceNameSize = _size - (4 + _mtms.flattenedSize());
_pceName.resize(pceNameSize);
pel >> _pceName;
}
void PCEIdentity::flatten(Stream& pel)
{
pel << _type << _size << _flags << _mtms << _pceName;
}
} // namespace src
} // namespace pels
} // namespace openpower