|
CIRCT 23.0.0git
|
Cursor for incremental consumption of a SegmentedMessageData. More...
#include <Common.h>

Public Member Functions | |
| SegmentedMessageDataCursor (const SegmentedMessageData &msg) | |
| std::span< const uint8_t > | remaining () const |
| Contiguous span from current position to end of current segment. | |
| void | advance (size_t n) |
Advance by n bytes, crossing segment boundaries as needed. | |
| bool | done () const |
| True when all segments have been consumed. | |
| void | reset () |
| Reset to the beginning. | |
Private Attributes | |
| const SegmentedMessageData & | msg |
| size_t | segIdx = 0 |
| size_t | offset = 0 |
Cursor for incremental consumption of a SegmentedMessageData.
Tracks position across segment boundaries. Backends store this alongside a unique_ptr<SegmentedMessageData> for partial writes.
Deliberately a separate class (not embedded in SegmentedMessageData) so that generated types have no hidden members — their layout matches the hardware wire format exactly.
|
inline |
| void SegmentedMessageDataCursor::advance | ( | size_t | n | ) |
Advance by n bytes, crossing segment boundaries as needed.
Definition at line 93 of file Common.cpp.
References done(), msg, offset, segIdx, esi::SegmentedMessageData::segment(), and esi::Segment::size.
| bool SegmentedMessageDataCursor::done | ( | ) | const |
True when all segments have been consumed.
Definition at line 113 of file Common.cpp.
References msg, esi::SegmentedMessageData::numSegments(), and segIdx.
Referenced by advance().
| std::span< const uint8_t > SegmentedMessageDataCursor::remaining | ( | ) | const |
Contiguous span from current position to end of current segment.
Definition at line 79 of file Common.cpp.
References esi::Segment::data, msg, esi::SegmentedMessageData::numSegments(), offset, segIdx, esi::SegmentedMessageData::segment(), and esi::Segment::size.
| void SegmentedMessageDataCursor::reset | ( | ) |
|
private |
Definition at line 232 of file Common.h.
Referenced by advance(), done(), and remaining().
|
private |
Definition at line 234 of file Common.h.
Referenced by advance(), remaining(), and reset().
|
private |