|
Couchbase C++ SDK 1.4.0 (rev. 59aa900)
|
A single-pass input iterator that synchronously fetches rows one at a time. More...
#include <couchbase/analytics_stream_result.hxx>
Public Member Functions | |
| auto | operator* () const -> std::pair< error, analytics_row > |
| auto | operator++ () -> iterator & |
| iterator (std::shared_ptr< internal_analytics_stream_result > internal) | |
| Constructs an iterator over an internal result; prefer begin(). | |
Friends | |
| auto | operator== (const iterator &it, end_sentinel) -> bool |
| Compares an iterator against the end sentinel. | |
| auto | operator== (end_sentinel end, const iterator &it) -> bool |
| auto | operator!= (const iterator &it, end_sentinel end) -> bool |
| auto | operator!= (end_sentinel end, const iterator &it) -> bool |
A single-pass input iterator that synchronously fetches rows one at a time.
Dereferencing yields std::pair<error, analytics_row>: for a data row the error is falsy; if the stream ends with an error, the iterator visits exactly one final element whose error is truthy (and whose row is empty) before comparing equal to end(). A clean end-of-stream yields no such element. This guarantees a for (auto [err, row] : result) loop can observe a terminal error rather than silently stopping.
This is a minimal single-pass iterator intended for range-based for and manual while (it != result.end()) loops. It compares only against end() (never against another iterator), and provides neither operator-> nor post-increment, so it is deliberately not a LegacyInputIterator and does not work with <algorithm> or std::distance. begin() must be called once.
|
explicit |
| auto operator* | ( | ) | const -> std::pair< error, analytics_row > |
| auto operator++ | ( | ) | -> iterator & |
|
friend |
|
friend |
|
friend |
Compares an iterator against the end sentinel.
Provided in both argument orders (and as both == and !=) so the range-for idiom, while (it != result.end()) loops, and wrapper code all work regardless of which operand is written first. Iterators are intentionally never comparable to one another: a single-pass stream has one position, so iterator-to-iterator equality would be meaningless — the type only ever compares against end().
|
friend |