summaryrefslogtreecommitdiff
path: root/memory_reader.cpp
AgeCommit message (Collapse)Author
2016-10-21add MemoryReadermukesh agrawal
When dumping log messages, we want to deconstruct an arbitrary memory region into semantically meaningful parts. E.g. protocol::Command header, protocol::AsciiMessage header, message tag, message data. MemoryReader aids in this deconstruction. A MemoryReader refers to an un-owned memory region, and provides convenient ways to: a) read a trivially-copyable object out the memory region, and b) read |n| bytes out of the memory region. In both cases, MemoryReader verifies that the requested read operation does not exceed the number of available bytes. Bug: 32256071 Test: ./runtests.sh (on angler) Change-Id: I8ca77aceff7204756fe225149178f34dd584c757