Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
google::cloud::spanner::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::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 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.

Member Typedef Documentation

◆ const_pointer

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

◆ const_reference

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

◆ difference_type

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

◆ iterator_category

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

◆ pointer

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

◆ reference

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

◆ value_type

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

Constructor & Destructor Documentation

◆ TupleStreamIterator() [1/2]

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

Default constructs an "end" iterator.

◆ TupleStreamIterator() [2/2]

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

Creates an iterator that wraps the given RowStreamIterator range.

Member Function Documentation

◆ operator*() [1/2]

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

◆ operator*() [2/2]

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

◆ operator++() [1/2]

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

◆ operator++() [2/2]

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

◆ operator->() [1/2]

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

◆ operator->() [2/2]

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

Friends And Related Function Documentation

◆ operator!=

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

◆ operator==

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