|
rogue
|
Random-access byte iterator across a Frame payload.
More...
#include <FrameIterator.h>
Public Member Functions | |
| FrameIterator () | |
| Constructs an empty iterator for later assignment. | |
| const rogue::interfaces::stream::FrameIterator | operator= (const rogue::interfaces::stream::FrameIterator &rhs) |
| Copy-assigns iterator state. | |
| rogue::interfaces::stream::FrameIterator | endBuffer () |
| Returns iterator marking the end of the current buffer segment. | |
| uint32_t | remBuffer () |
| Returns remaining bytes in the current buffer span. | |
| uint8_t & | operator* () const |
| Dereferences iterator to current byte. | |
| uint8_t * | ptr () const |
| Returns pointer to byte at current iterator position. | |
| uint8_t | operator[] (const uint32_t offset) const |
| Returns byte value at relative offset from current position. | |
| const rogue::interfaces::stream::FrameIterator & | operator++ () |
| Prefix-increments iterator by one byte. | |
| rogue::interfaces::stream::FrameIterator | operator++ (int) |
| Postfix-increments iterator by one byte. | |
| const rogue::interfaces::stream::FrameIterator & | operator-- () |
| Prefix-decrements iterator by one byte. | |
| rogue::interfaces::stream::FrameIterator | operator-- (int) |
| Postfix-decrements iterator by one byte. | |
| bool | operator!= (const rogue::interfaces::stream::FrameIterator &other) const |
| Compares two iterators for inequality. | |
| bool | operator== (const rogue::interfaces::stream::FrameIterator &other) const |
| Compares two iterators for equality. | |
| bool | operator< (const rogue::interfaces::stream::FrameIterator &other) const |
| Returns whether this iterator is before another iterator. | |
| bool | operator> (const rogue::interfaces::stream::FrameIterator &other) const |
| Returns whether this iterator is after another iterator. | |
| bool | operator<= (const rogue::interfaces::stream::FrameIterator &other) const |
| Returns whether this iterator is before or equal to another iterator. | |
| bool | operator>= (const rogue::interfaces::stream::FrameIterator &other) const |
| Returns whether this iterator is after or equal to another iterator. | |
| rogue::interfaces::stream::FrameIterator | operator+ (const int32_t add) const |
Returns a new iterator offset forward by add. | |
| rogue::interfaces::stream::FrameIterator | operator- (const int32_t sub) const |
Returns a new iterator offset backward by sub. | |
| int32_t | operator- (const rogue::interfaces::stream::FrameIterator &other) const |
| Returns byte-distance between two iterators. | |
| rogue::interfaces::stream::FrameIterator & | operator+= (const int32_t add) |
In-place increments iterator by add. | |
| rogue::interfaces::stream::FrameIterator & | operator-= (const int32_t sub) |
In-place decrements iterator by sub. | |
Friends | |
| class | Frame |
Random-access byte iterator across a Frame payload.
FrameIterator provides STL-style random-access semantics over frame payload bytes, even when payload storage spans multiple underlying buffers. It hides buffer boundary transitions and allows efficient copy operations with helper APIs (toFrame, fromFrame, copyFrame).
This class is C++ only and is not exposed directly to Python.
Definition at line 45 of file FrameIterator.h.
| rogue::interfaces::stream::FrameIterator::FrameIterator | ( | ) |
Constructs an empty iterator for later assignment.
Definition at line 107 of file FrameIterator.cpp.
| rogue::interfaces::stream::FrameIterator rogue::interfaces::stream::FrameIterator::endBuffer | ( | ) |
Returns iterator marking the end of the current buffer segment.
Get iterator to end of buffer or end of frame, whichever is lower.
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().
Definition at line 130 of file FrameIterator.cpp.
| bool rogue::interfaces::stream::FrameIterator::operator!= | ( | const rogue::interfaces::stream::FrameIterator & | other | ) | const |
Compares two iterators for inequality.
Not Equal.
Compare this iterator to another iterator and return true if they are at different positions.
| other | Iterator to compare against. |
true if the two iterators are not equal. Definition at line 190 of file FrameIterator.cpp.
| uint8_t & rogue::interfaces::stream::FrameIterator::operator* | ( | ) | const |
Dereferences iterator to current byte.
De-reference.
Allows data at the current iterator position to be accessed using *it syntax.
Definition at line 142 of file FrameIterator.cpp.
| rogue::interfaces::stream::FrameIterator rogue::interfaces::stream::FrameIterator::operator+ | ( | const int32_t | add | ) | const |
Returns a new iterator offset forward by add.
Increment by value.
Create a new iterator and increment its position by the passed value.
| add | Positive or negative value to increment the current position by. |
Definition at line 220 of file FrameIterator.cpp.
| const rogue::interfaces::stream::FrameIterator & rogue::interfaces::stream::FrameIterator::operator++ | ( | ) |
Prefix-increments iterator by one byte.
Increment.
Increment the current iterator position by a single location and return a reference to the current iterator.
Definition at line 164 of file FrameIterator.cpp.
| rogue::interfaces::stream::FrameIterator rogue::interfaces::stream::FrameIterator::operator++ | ( | int | ) |
Postfix-increments iterator by one byte.
post Increment
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.
Definition at line 170 of file FrameIterator.cpp.
| rogue::interfaces::stream::FrameIterator & rogue::interfaces::stream::FrameIterator::operator+= | ( | const int32_t | add | ) |
In-place increments iterator by add.
Increment by value.
Increment the current iterator by the passed value.
| add | Positive or negative value to increment the current position by. |
Definition at line 245 of file FrameIterator.cpp.
| rogue::interfaces::stream::FrameIterator rogue::interfaces::stream::FrameIterator::operator- | ( | const int32_t | sub | ) | const |
Returns a new iterator offset backward by sub.
Descrment by value.
Create a new iterator and decrement its position by the passed value.
| sub | Positive or negative value to decrement the current position by. |
Definition at line 230 of file FrameIterator.cpp.
| int32_t rogue::interfaces::stream::FrameIterator::operator- | ( | const rogue::interfaces::stream::FrameIterator & | other | ) | const |
Returns byte-distance between two iterators.
Sub incrementers.
Return the difference between the current iterator position (left of -) and the compared iterator position.
| other | Iterator to compare against. |
int32_t. Definition at line 240 of file FrameIterator.cpp.
| const rogue::interfaces::stream::FrameIterator & rogue::interfaces::stream::FrameIterator::operator-- | ( | ) |
Prefix-decrements iterator by one byte.
Decrement.
Decrement the current iterator position by a single location and return a reference to the current iterator.
Definition at line 177 of file FrameIterator.cpp.
| rogue::interfaces::stream::FrameIterator rogue::interfaces::stream::FrameIterator::operator-- | ( | int | ) |
Postfix-decrements iterator by one byte.
post Decrement
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.
Definition at line 183 of file FrameIterator.cpp.
| rogue::interfaces::stream::FrameIterator & rogue::interfaces::stream::FrameIterator::operator-= | ( | const int32_t | sub | ) |
In-place decrements iterator by sub.
Descrment by value.
Decrement the current iterator by the passed value.
| sub | Positive or negative value to decrement the current position by. |
Definition at line 254 of file FrameIterator.cpp.
| bool rogue::interfaces::stream::FrameIterator::operator< | ( | const rogue::interfaces::stream::FrameIterator & | other | ) | const |
Returns whether this iterator is before another iterator.
Less than.
Compare this iterator to another iterator and return true if the local iterator (left of <) is less than the iterator being compared against.
| other | Iterator to compare against. |
true if the left iterator is less than the right. Definition at line 200 of file FrameIterator.cpp.
| bool rogue::interfaces::stream::FrameIterator::operator<= | ( | const rogue::interfaces::stream::FrameIterator & | other | ) | const |
Returns whether this iterator is before or equal to another iterator.
Less than equal.
Compare this iterator to another iterator and return true if the local iterator (left of <=) is less than or equal to the iterator being compared against.
| other | Iterator to compare against. |
true if the left iterator is less than or equal to the right. Definition at line 210 of file FrameIterator.cpp.
| const rogue::interfaces::stream::FrameIterator rogue::interfaces::stream::FrameIterator::operator= | ( | const rogue::interfaces::stream::FrameIterator & | rhs | ) |
Copy-assigns iterator state.
Copy assignment.
| rhs | Source iterator. |
Definition at line 117 of file FrameIterator.cpp.
| bool rogue::interfaces::stream::FrameIterator::operator== | ( | const rogue::interfaces::stream::FrameIterator & | other | ) | const |
Compares two iterators for equality.
Equal.
Compare this iterator to another iterator and return true if they reference the same position within the frame.
| other | Iterator to compare against. |
true if the two iterators are equal. Definition at line 195 of file FrameIterator.cpp.
| bool rogue::interfaces::stream::FrameIterator::operator> | ( | const rogue::interfaces::stream::FrameIterator & | other | ) | const |
Returns whether this iterator is after another iterator.
greater than
Compare this iterator to another iterator and return true if the local iterator (left of >) is greater than the iterator being compared against.
| other | Iterator to compare against. |
true if the left iterator is greater than the right. Definition at line 205 of file FrameIterator.cpp.
| bool rogue::interfaces::stream::FrameIterator::operator>= | ( | const rogue::interfaces::stream::FrameIterator & | other | ) | const |
Returns whether this iterator is after or equal to another iterator.
greater than equal
Compare this iterator to another iterator and return true if the local iterator (left of >=) is greater than or equal to the iterator being compared against.
| other | Iterator to compare against. |
true if the left iterator is greater than or equal to the right. Definition at line 215 of file FrameIterator.cpp.
| uint8_t rogue::interfaces::stream::FrameIterator::operator[] | ( | const uint32_t | offset | ) | const |
Returns byte value at relative offset from current position.
De-reference by index.
| offset | Relative offset to access. |
Definition at line 157 of file FrameIterator.cpp.
| uint8_t * rogue::interfaces::stream::FrameIterator::ptr | ( | ) | const |
Returns pointer to byte at current iterator position.
Pointer.
Pointer
Definition at line 152 of file FrameIterator.cpp.
| uint32_t rogue::interfaces::stream::FrameIterator::remBuffer | ( | ) |
Returns remaining bytes in the current buffer span.
Get remaining bytes in current buffer.
Similar to endBuffer(), this returns remaining bytes in the current underlying buffer region without crossing to the next one.
Definition at line 137 of file FrameIterator.cpp.
|
friend |
Definition at line 46 of file FrameIterator.h.