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

Represents the stream of Rows returned from spanner::Client::Read() or spanner::Client::ExecuteQuery(). More...

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

Public Member Functions

 RowStream ()=default
 
 RowStream (std::unique_ptr< spanner_internal::ResultSourceInterface > source)
 
 RowStream (RowStream &&)=default
 
RowStreamoperator= (RowStream &&)=default
 
RowStreamIterator begin ()
 Returns a RowStreamIterator defining the beginning of this range. More...
 
RowStreamIterator end ()
 Returns a RowStreamIterator defining the end of this range. More...
 
absl::optional< TimestampReadTimestamp () const
 Retrieves the timestamp at which the read occurred. More...
 

Detailed Description

Represents the stream of Rows returned from spanner::Client::Read() or spanner::Client::ExecuteQuery().

This is a range defined by the Input Iterators returned from its begin() and end() members. Callers may directly iterate the RowStream instance, which will return a sequence of StatusOr<Row> objects.

For convenience, callers may wrap instances in a StreamOf<std::tuple<...>> object, which will automatically parse each Row into a std::tuple with the specified types.

Definition at line 73 of file results.h.

Constructor & Destructor Documentation

◆ RowStream() [1/3]

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

◆ RowStream() [2/3]

google::cloud::spanner::v1::RowStream::RowStream ( std::unique_ptr< spanner_internal::ResultSourceInterface >  source)
inlineexplicit

Definition at line 76 of file results.h.

◆ RowStream() [3/3]

google::cloud::spanner::v1::RowStream::RowStream ( RowStream &&  )
default

Member Function Documentation

◆ begin()

RowStreamIterator google::cloud::spanner::v1::RowStream::begin ( )
inline

Returns a RowStreamIterator defining the beginning of this range.

Definition at line 85 of file results.h.

◆ end()

RowStreamIterator google::cloud::spanner::v1::RowStream::end ( )
inline

Returns a RowStreamIterator defining the end of this range.

Definition at line 91 of file results.h.

◆ operator=()

RowStream& google::cloud::spanner::v1::RowStream::operator= ( RowStream &&  )
default

◆ ReadTimestamp()

absl::optional< Timestamp > google::cloud::spanner::v1::RowStream::ReadTimestamp ( ) const

Retrieves the timestamp at which the read occurred.

Note
Only available if a read-only transaction was used.

Definition at line 69 of file results.cc.