Frame Helpers
The following inline functions are provided to assist in moving single data values into and out of a Frame using a Frame Iterator.
-
static inline void rogue::interfaces::stream::toFrame(rogue::interfaces::stream::FrameIterator &iter, uint32_t size, void *src)
Copies bytes from a source pointer into a frame iterator.
This helper function copies from the passed data pointer into the frame at the iterator position. The iterator is incremented by the copied byte count.
Caller is expected to ensure sufficient writable frame capacity for
sizebytes from the iterator position.- Parameters:
iter – FrameIterator at position to copy the data to.
size – Number of bytes to copy.
src – Pointer to source data.
-
static inline void rogue::interfaces::stream::fromFrame(rogue::interfaces::stream::FrameIterator &iter, uint32_t size, void *dst)
Copies bytes from a frame iterator to a destination pointer.
This helper function copies data from the frame at the iterator location into the passed data pointer. The iterator is incremented by the copied byte count.
Caller is expected to ensure sufficient readable frame payload for
sizebytes from the iterator position.- Parameters:
iter – FrameIterator at position to copy the data from.
size – Number of bytes to copy.
dst – Pointer to destination data.
-
static inline void rogue::interfaces::stream::copyFrame(rogue::interfaces::stream::FrameIterator &srcIter, uint32_t size, rogue::interfaces::stream::FrameIterator &dstIter)
Copies bytes between frame iterators.
This helper function copies data from the source frame at the iterator location into the destination frame at the iterator location. Both iterators are incremented by the copied byte count.
Caller is expected to ensure sufficient readable bytes in
srcIterand writable capacity indstIterforsizebytes.- Parameters:
srcIter – FrameIterator at position to copy the data from.
size – Number of bytes to copy.
dstIter – FrameIterator at position to copy the data to.