Google Cloud Spanner C++ Client  1.32.0
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 
18 #include "google/cloud/spanner/query_options.h"
19 #include "google/cloud/spanner/version.h"
20 
21 namespace google {
22 namespace cloud {
23 namespace spanner {
24 inline namespace SPANNER_CLIENT_NS {
25 
26 /**
27  * ClientOptions allows the caller to set a variety of options when
28  * constructing a `Client` instance.
29  */
31  public:
32  ClientOptions() = default;
33  ClientOptions(ClientOptions const&) = default;
34  ClientOptions& operator=(ClientOptions const&) = default;
37 
38  /// Returns the `QueryOptions`
39  QueryOptions const& query_options() const { return query_options_; }
40 
41  /// Sets the `QueryOptions`
43  query_options_ = std::move(qo);
44  return *this;
45  }
46 
47  friend bool operator==(ClientOptions const& a, ClientOptions const& b) {
48  return a.query_options_ == b.query_options_;
49  }
50 
51  friend bool operator!=(ClientOptions const& a, ClientOptions const& b) {
52  return !(a == b);
53  }
54 
55  private:
56  QueryOptions query_options_;
57 };
58 
59 } // namespace SPANNER_CLIENT_NS
60 } // namespace spanner
61 } // namespace cloud
62 } // namespace google
63 
64 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_CLIENT_OPTIONS_H