Frame Iterator

The FrameIterator class is also aliased as a Frame::iterator

rogue::interfaces::stream::Frame::iterator

The class description is shown below:

class FrameIterator : public std::iterator<std::random_access_iterator_tag, uint8_t>

Frame iterator.

The FrameIterator class implements a C++ standard random access iterator with a base type of uint8_t.

This class is not available in Python.

Public Functions

FrameIterator()

Create an empty iterator for later assignment.

const rogue::interfaces::stream::FrameIterator operator=(const rogue::interfaces::stream::FrameIterator &rhs)

Copy assignment.

Copy the state of another iterator into the current iterator.

rogue::interfaces::stream::FrameIterator endBuffer()

Get iterator marking the end of the current Buffer.

The returned iterator is an end marker for the current buffer, and possibly the end of the frame. If the current Buffer is followed by another buffer containing valid data for a Read or available space for a write, the returned iterator will mark the start of the next Buffer. Having this iterator is useful when iterating through contiguous memory blocks for more efficient data copying when using std::copy().

Returns:

Iterator marking the end of the current Buffer

uint32_t remBuffer()

Get remaining bytes in current buffer.

Similar to the endBuffer() call, this method returns the remaining bytes in the current Buffer.

Returns:

Remaining bytes in the current Buffer.

uint8_t &operator*() const

De-reference.

This allows data at the current iterator position to be accessed using a *it de-reference

uint8_t *ptr() const

Return uint8_t pointer to current position.

Returns:

uint8_t pointer to current position

uint8_t operator[](const uint32_t) const

De-reference by index.

Returns the data value at the passed relative offset

Parameters:

offset – Relative offset to access

Returns:

Data value at passed offset

const rogue::interfaces::stream::FrameIterator &operator++()

Pre-increment the iterator position.

Increment the current iterator position by a single location and return a reference to the current iterator.

Returns:

Reference to iterator at the new position.

rogue::interfaces::stream::FrameIterator operator++(int)

Post-increment the iterator position.

Increment the current iterator position by a single location and return a reference to the previous iterator position. This results in a copy of the iterator being created before the increment.

Returns:

Reference to iterator at the old position.

const rogue::interfaces::stream::FrameIterator &operator--()

Pre-decrement the iterator position.

Decrement the current iterator position by a single location and return a reference to the current iterator.

Returns:

Reference to iterator at the new position.

rogue::interfaces::stream::FrameIterator operator--(int)

Post-decrement the iterator position.

Decrement the current iterator position by a single location and return a reference to the previous iterator position. This results in a copy of the iterator being created before the decrement.

Returns:

Reference to iterator at the old position.

bool operator!=(const rogue::interfaces::stream::FrameIterator &other) const

Not Equal.

Compare this iterator to another iterator and return True if they are at different positions.

Returns:

True if the two iterators are not equal

bool operator==(const rogue::interfaces::stream::FrameIterator &other) const

Equal.

Compare this iterator to another iterator and return True if they are reference the same position within the Frame.

Returns:

True if the two iterators are equal

bool operator<(const rogue::interfaces::stream::FrameIterator &other) const

Less than.

Compare this iterator to another iterator and return True if the local iterator (left of <) is less than the iterator being compare against.

Returns:

True if the left iterator is less than the right.

bool operator>(const rogue::interfaces::stream::FrameIterator &other) const

Greater than.

Compare this iterator to another iterator and return True if the local iterator (left of >) is greater than the iterator being compare against.

Returns:

True if the left iterator is greater than the right.

bool operator<=(const rogue::interfaces::stream::FrameIterator &other) const

Less than or equal to.

Compare this iterator to another iterator and return True if the local iterator (left of <=) is less than or equal to the iterator being compare against.

Returns:

True if the left iterator is less than or equal to the right.

bool operator>=(const rogue::interfaces::stream::FrameIterator &other) const

Greater than or equal to.

Compare this iterator to another iterator and return True if the local iterator (left of >=) is greater than or equal to the iterator being compare against.

Returns:

True if the left iterator is greater than or equal to the right.

rogue::interfaces::stream::FrameIterator operator+(const int32_t add) const

Increment by value.

Create a new iterator and increment its position by the passed value.

Parameters:

add – Positive or negative value to increment the current position by.

Returns:

New iterator at the new position

rogue::interfaces::stream::FrameIterator operator-(const int32_t sub) const

Decrement by value.

Create a new iterator and decrement its position by the passed value.

Parameters:

sub – Positive or negative value to decrement the current position by.

Returns:

New iterator at the new position

int32_t operator-(const rogue::interfaces::stream::FrameIterator &other) const

Subtract incrementers.

Return the difference between the current incrementer position (left of -) and the compared incrementer position.

Returns:

Different of the two positions as a int32_t

rogue::interfaces::stream::FrameIterator &operator+=(const int32_t add)

Increment by value.

Increment the current iterator by the passed value

Parameters:

add – Positive or negative value to increment the current position by.

Returns:

Reference to current iterator at the new position

rogue::interfaces::stream::FrameIterator &operator-=(const int32_t sub)

Decrement by value.

Decrement the current iterator by the passed value

Parameters:

sub – Positive or negative value to decrement the current position by.

Returns:

Reference to current iterator at the new position