Google Cloud Spanner C++ Client
A C++ Client Library for Google Cloud Spanner
client_options.h
Go to the documentation of this file.
1 // Copyright 2020 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_CLIENT_OPTIONS_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_CLIENT_OPTIONS_H
17 
20 #include <string>
21 
22 namespace google {
23 namespace cloud {
24 namespace spanner {
25 inline namespace SPANNER_CLIENT_NS {
26 
32  public:
33  ClientOptions() = default;
34  ClientOptions(ClientOptions const&) = default;
35  ClientOptions& operator=(ClientOptions const&) = default;
36  ClientOptions(ClientOptions&&) = default;
37  ClientOptions& operator=(ClientOptions&&) = default;
38 
40  QueryOptions const& query_options() const { return query_options_; }
41 
44  query_options_ = std::move(qo);
45  return *this;
46  }
47 
48  friend bool operator==(ClientOptions const& a, ClientOptions const& b) {
49  return a.query_options_ == b.query_options_;
50  }
51 
52  friend bool operator!=(ClientOptions const& a, ClientOptions const& b) {
53  return !(a == b);
54  }
55 
56  private:
57  QueryOptions query_options_;
58 };
59 
60 } // namespace SPANNER_CLIENT_NS
61 } // namespace spanner
62 } // namespace cloud
63 } // namespace google
64 
65 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_CLIENT_OPTIONS_H
ClientOptions allows the caller to set a variety of options when constructing a Client instance.
ClientOptions & set_query_options(QueryOptions qo)
Sets the QueryOptions
QueryOptions const & query_options() const
Returns the QueryOptions
Contains all the Cloud Spanner C++ client types and functions.
These QueryOptions allow users to configure features about how their SQL queries executes on the serv...
Definition: query_options.h:31
#define SPANNER_CLIENT_NS
Definition: version.h:22
friend bool operator!=(ClientOptions const &a, ClientOptions const &b)
friend bool operator==(ClientOptions const &a, ClientOptions const &b)