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:
  • iterFrame 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 offset without bounds checking.

Parameters:

offset – Element index.

Returns:

Element reference.

inline T &at(const uint32_t offset)

Returns element reference at offset with 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 T *begin()

Returns pointer to first element.

inline T *end()

Returns pointer one-past-last element.