Google Cloud Spanner C++ Client  1.32.1
A C++ Client Library for Google Cloud Spanner
Public Types | Public Member Functions | Friends | List of all members
google::cloud::spanner::v1::RowStreamIterator Class Reference

A RowStreamIterator is an Input Iterator (see below) that returns a sequence of StatusOr<Row> objects. More...

#include <google/cloud/spanner/row.h>

Public Types

using Source = std::function< StatusOr< Row >()>
 A function that returns a sequence of StatusOr<Row> objects. More...
 
Iterator type aliases
using iterator_category = std::input_iterator_tag
 
using value_type = StatusOr< Row >
 
using difference_type = std::ptrdiff_t
 
using pointer = value_type *
 
using reference = value_type &
 
using const_pointer = value_type const *
 
using const_reference = value_type const &
 

Public Member Functions

 RowStreamIterator ()
 Default constructs an "end" iterator. More...
 
 RowStreamIterator (Source source)
 Constructs a RowStreamIterator that will consume rows from the given source, which must not be nullptr. More...
 
reference operator* ()
 
pointer operator-> ()
 
const_reference operator* () const
 
const_pointer operator-> () const
 
RowStreamIteratoroperator++ ()
 
RowStreamIterator operator++ (int)
 

Friends

bool operator== (RowStreamIterator const &, RowStreamIterator const &)
 
bool operator!= (RowStreamIterator const &, RowStreamIterator const &)
 

Detailed Description

A RowStreamIterator is an Input Iterator (see below) that returns a sequence of StatusOr<Row> objects.

As an Input Iterator, the sequence may only be consumed once. Default constructing a RowStreamIterator creates an instance that represents "end".

Note
The term "stream" in this name refers to the general nature of the the data source, and is not intended to suggest any similarity to C++'s I/O streams library. Syntactically, this class is an "iterator".

Definition at line 252 of file row.h.

Member Typedef Documentation

◆ const_pointer

Definition at line 267 of file row.h.

◆ const_reference

Definition at line 268 of file row.h.

◆ difference_type

Definition at line 264 of file row.h.

◆ iterator_category

Definition at line 262 of file row.h.

◆ pointer

Definition at line 265 of file row.h.

◆ reference

Definition at line 266 of file row.h.

◆ Source

using google::cloud::spanner::v1::RowStreamIterator::Source = std::function<StatusOr<Row>()>

A function that returns a sequence of StatusOr<Row> objects.

Returning an empty Row indicates that there are no more rows to be returned.

Definition at line 258 of file row.h.

◆ value_type

Definition at line 263 of file row.h.

Constructor & Destructor Documentation

◆ RowStreamIterator() [1/2]

google::cloud::spanner::v1::RowStreamIterator::RowStreamIterator ( )
default

Default constructs an "end" iterator.

◆ RowStreamIterator() [2/2]

google::cloud::spanner::v1::RowStreamIterator::RowStreamIterator ( Source  source)
explicit

Constructs a RowStreamIterator that will consume rows from the given source, which must not be nullptr.

Definition at line 80 of file row.cc.

Member Function Documentation

◆ operator*() [1/2]

reference google::cloud::spanner::v1::RowStreamIterator::operator* ( )
inline

Definition at line 280 of file row.h.

◆ operator*() [2/2]

const_reference google::cloud::spanner::v1::RowStreamIterator::operator* ( ) const
inline

Definition at line 283 of file row.h.

◆ operator++() [1/2]

RowStreamIterator & google::cloud::spanner::v1::RowStreamIterator::operator++ ( )

Definition at line 85 of file row.cc.

◆ operator++() [2/2]

RowStreamIterator google::cloud::spanner::v1::RowStreamIterator::operator++ ( int  )

Definition at line 98 of file row.cc.

◆ operator->() [1/2]

pointer google::cloud::spanner::v1::RowStreamIterator::operator-> ( )
inline

Definition at line 281 of file row.h.

◆ operator->() [2/2]

const_pointer google::cloud::spanner::v1::RowStreamIterator::operator-> ( ) const
inline

Definition at line 284 of file row.h.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( RowStreamIterator const &  a,
RowStreamIterator const &  b 
)
friend

Definition at line 112 of file row.cc.

◆ operator==

bool operator== ( RowStreamIterator const &  a,
RowStreamIterator const &  b 
)
friend

Definition at line 104 of file row.cc.