Google Cloud Spanner C++ Client  1.32.1
A C++ Client Library for Google Cloud Spanner
Public Member Functions | Friends | List of all members
google::cloud::spanner::v1::TupleStreamIterator< Tuple > Class Template Reference

A TupleStreamIterator<Tuple> is an "Input Iterator" that wraps a RowStreamIterator, parsing its elements into a sequence of StatusOr<Tuple> objects. More...

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

Public Types

Iterator type aliases
using iterator_category = std::input_iterator_tag
 
using value_type = StatusOr< Tuple >
 
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

 TupleStreamIterator ()=default
 Default constructs an "end" iterator. More...
 
 TupleStreamIterator (RowStreamIterator begin, RowStreamIterator end)
 Creates an iterator that wraps the given RowStreamIterator range. More...
 
reference operator* ()
 
pointer operator-> ()
 
const_reference operator* () const
 
const_pointer operator-> () const
 
TupleStreamIteratoroperator++ ()
 
TupleStreamIterator operator++ (int)
 

Friends

bool operator== (TupleStreamIterator const &a, TupleStreamIterator const &b)
 
bool operator!= (TupleStreamIterator const &a, TupleStreamIterator const &b)
 

Detailed Description

template<typename Tuple>
class google::cloud::spanner::v1::TupleStreamIterator< Tuple >

A TupleStreamIterator<Tuple> is an "Input Iterator" that wraps a RowStreamIterator, parsing its elements into a sequence of StatusOr<Tuple> objects.

As an Input Iterator, the sequence may only be consumed once. See https://en.cppreference.com/w/cpp/named_req/InputIterator for more details.

Default constructing this object creates an instance that represents "end".

Each Row returned by the wrapped RowStreamIterator must be convertible to the specified Tuple template parameter.

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".
Template Parameters
Tuplethe std::tuple<...> to parse each Row into.

Definition at line 317 of file row.h.

Member Typedef Documentation

◆ const_pointer

template<typename Tuple >
using google::cloud::spanner::v1::TupleStreamIterator< Tuple >::const_pointer = value_type const*

Definition at line 326 of file row.h.

◆ const_reference

template<typename Tuple >
using google::cloud::spanner::v1::TupleStreamIterator< Tuple >::const_reference = value_type const&

Definition at line 327 of file row.h.

◆ difference_type

template<typename Tuple >
using google::cloud::spanner::v1::TupleStreamIterator< Tuple >::difference_type = std::ptrdiff_t

Definition at line 323 of file row.h.

◆ iterator_category

template<typename Tuple >
using google::cloud::spanner::v1::TupleStreamIterator< Tuple >::iterator_category = std::input_iterator_tag

Definition at line 321 of file row.h.

◆ pointer

template<typename Tuple >
using google::cloud::spanner::v1::TupleStreamIterator< Tuple >::pointer = value_type*

Definition at line 324 of file row.h.

◆ reference

template<typename Tuple >
using google::cloud::spanner::v1::TupleStreamIterator< Tuple >::reference = value_type&

Definition at line 325 of file row.h.

◆ value_type

template<typename Tuple >
using google::cloud::spanner::v1::TupleStreamIterator< Tuple >::value_type = StatusOr<Tuple>

Definition at line 322 of file row.h.

Constructor & Destructor Documentation

◆ TupleStreamIterator() [1/2]

template<typename Tuple >
google::cloud::spanner::v1::TupleStreamIterator< Tuple >::TupleStreamIterator ( )
default

Default constructs an "end" iterator.

◆ TupleStreamIterator() [2/2]

template<typename Tuple >
google::cloud::spanner::v1::TupleStreamIterator< Tuple >::TupleStreamIterator ( RowStreamIterator  begin,
RowStreamIterator  end 
)
inline

Creates an iterator that wraps the given RowStreamIterator range.

Definition at line 334 of file row.h.

Member Function Documentation

◆ operator*() [1/2]

template<typename Tuple >
reference google::cloud::spanner::v1::TupleStreamIterator< Tuple >::operator* ( )
inline

Definition at line 339 of file row.h.

◆ operator*() [2/2]

template<typename Tuple >
const_reference google::cloud::spanner::v1::TupleStreamIterator< Tuple >::operator* ( ) const
inline

Definition at line 342 of file row.h.

◆ operator++() [1/2]

template<typename Tuple >
TupleStreamIterator& google::cloud::spanner::v1::TupleStreamIterator< Tuple >::operator++ ( )
inline

Definition at line 345 of file row.h.

◆ operator++() [2/2]

template<typename Tuple >
TupleStreamIterator google::cloud::spanner::v1::TupleStreamIterator< Tuple >::operator++ ( int  )
inline

Definition at line 355 of file row.h.

◆ operator->() [1/2]

template<typename Tuple >
pointer google::cloud::spanner::v1::TupleStreamIterator< Tuple >::operator-> ( )
inline

Definition at line 340 of file row.h.

◆ operator->() [2/2]

template<typename Tuple >
const_pointer google::cloud::spanner::v1::TupleStreamIterator< Tuple >::operator-> ( ) const
inline

Definition at line 343 of file row.h.

Friends And Related Function Documentation

◆ operator!=

template<typename Tuple >
bool operator!= ( TupleStreamIterator< Tuple > const &  a,
TupleStreamIterator< Tuple > const &  b 
)
friend

Definition at line 366 of file row.h.

◆ operator==

template<typename Tuple >
bool operator== ( TupleStreamIterator< Tuple > const &  a,
TupleStreamIterator< Tuple > const &  b 
)
friend

Definition at line 361 of file row.h.