template<typename Tuple>
class google::cloud::spanner::TupleStream< Tuple >
A TupleStream<Tuple>
defines a range that parses Tuple
objects from the given range of RowStreamIterator
s.
Users create instances using the StreamOf<T>(range)
non-member factory function (defined below). The following is a typical usage of this class in a range-for loop.
auto row_range = ...
using RowType = std::tuple<std::int64_t, std::string, bool>;
for (auto const& row : StreamOf<RowType>(row_range)) {
if (!row) {
}
std::int64_t x = std::get<0>(*row);
...
}
- 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 a "range" defined by two "iterator" objects of type
TupleStreamIterator<Tuple>
.
- Template Parameters
-
Tuple | the std::tuple<...> to parse each Row into. |