Google Cloud Spanner C++ Client
A C++ Client Library for Google Cloud Spanner
instance.h
Go to the documentation of this file.
1 // Copyright 2019 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_INSTANCE_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_INSTANCE_H
17 
19 #include <ostream>
20 #include <string>
21 #include <tuple>
22 
23 namespace google {
24 namespace cloud {
25 namespace spanner {
26 inline namespace SPANNER_CLIENT_NS {
27 
41 class Instance {
42  public:
44  Instance(std::string project_id, std::string instance_id);
45 
47 
48  Instance(Instance const&) = default;
49  Instance& operator=(Instance const&) = default;
50  Instance(Instance&&) = default;
51  Instance& operator=(Instance&&) = default;
53 
55  std::string const& project_id() const { return project_id_; }
56 
58  std::string const& instance_id() const { return instance_id_; }
59 
64  std::string FullName() const;
65 
67 
68  friend bool operator==(Instance const& a, Instance const& b);
69  friend bool operator!=(Instance const& a, Instance const& b);
71 
73  friend std::ostream& operator<<(std::ostream& os, Instance const& dn);
74 
75  private:
76  std::string project_id_;
77  std::string instance_id_;
78 };
79 
80 } // namespace SPANNER_CLIENT_NS
81 } // namespace spanner
82 } // namespace cloud
83 } // namespace google
84 
85 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_INSTANCE_H
bool operator!=(Backup const &a, Backup const &b)
Definition: backup.cc:33
This class identifies a Cloud Spanner Instance.
Definition: instance.h:41
std::string const & project_id() const
Returns the Project ID.
Definition: instance.h:55
bool operator==(Backup const &a, Backup const &b)
Definition: backup.cc:29
Contains all the Cloud Spanner C++ client types and functions.
#define SPANNER_CLIENT_NS
Definition: version.h:22
std::string const & instance_id() const
Returns the Instance ID.
Definition: instance.h:58
std::ostream & operator<<(std::ostream &os, Backup const &bn)
Definition: backup.cc:35