Frame Accessor
The class description is shown below:
-
template<typename T>
class FrameAccessor Typed accessor over a contiguous frame-data region.
FrameAccessor<T>provides typed element access into frame payload data when the requested range is fully contained in a single underlying buffer span. This avoids per-byte iterator overhead in tight loops while preserving a checked construction step.Public Functions
-
inline FrameAccessor(rogue::interfaces::stream::FrameIterator &iter, uint32_t size)
Creates a typed accessor at the iterator location.
- Parameters:
iter – Frame iterator positioned at the first element.
size – Number of elements in the accessor.
- Throws:
rogue::GeneralError – If the range spans multiple buffers.
-
inline T &operator[](const uint32_t offset)
Dereference by index.
Returns element reference at
offsetwithout bounds checking.- Parameters:
offset – Element index.
- Returns:
Element reference.
-
inline T &at(const uint32_t offset)
Returns element reference at
offsetwith bounds checking.- Parameters:
offset – Element index.
- Throws:
rogue::GeneralError – If
offset >= size().- Returns:
Element reference.
-
inline uint32_t size()
Returns number of elements in this accessor.
-
inline FrameAccessor(rogue::interfaces::stream::FrameIterator &iter, uint32_t size)