15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_RESULTS_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_RESULTS_H
18 #include "google/cloud/spanner/row.h"
19 #include "google/cloud/spanner/timestamp.h"
20 #include "google/cloud/spanner/version.h"
21 #include "google/cloud/optional.h"
22 #include "absl/types/optional.h"
23 #include <google/spanner/v1/spanner.pb.h>
26 #include <unordered_map>
30 namespace spanner_internal {
32 class ResultSourceInterface {
34 virtual ~ResultSourceInterface() =
default;
37 virtual absl::optional<
google::spanner::v1::ResultSetMetadata> Metadata() = 0;
38 virtual absl::optional<
google::spanner::v1::ResultSetStats> Stats()
const = 0;
56 using ExecutionPlan = ::
google::spanner::v1::QueryPlan;
77 std::unique_ptr<spanner_internal::ResultSourceInterface> source)
78 : source_(std::move(source)) {}
101 std::unique_ptr<spanner_internal::ResultSourceInterface> source_;
120 std::unique_ptr<spanner_internal::ResultSourceInterface> source)
121 : source_(std::move(source)) {}
136 std::unique_ptr<spanner_internal::ResultSourceInterface> source_;
161 std::unique_ptr<spanner_internal::ResultSourceInterface> source)
162 : source_(std::move(source)) {}
191 absl::optional<std::unordered_map<std::string, std::string>>
ExecutionStats()
197 absl::optional<
spanner::ExecutionPlan> ExecutionPlan()
const;
200 std::unique_ptr<spanner_internal::ResultSourceInterface> source_;
220 std::unique_ptr<spanner_internal::ResultSourceInterface> source)
221 : source_(std::move(source)) {}
241 absl::optional<std::unordered_map<std::string, std::string>>
ExecutionStats()
247 absl::optional<
spanner::ExecutionPlan> ExecutionPlan()
const;
250 std::unique_ptr<spanner_internal::ResultSourceInterface> source_;