Google Cloud Spanner C++ Client
A C++ Client Library for Google Cloud Spanner
backup.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_BACKUP_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_BACKUP_H
17 
20 #include <ostream>
21 #include <string>
22 
23 namespace google {
24 namespace cloud {
25 namespace spanner {
26 inline namespace SPANNER_CLIENT_NS {
27 
38 class Backup {
39  public:
42  Backup(Instance instance, std::string backup_id);
43 
45 
46  Backup(Backup const&) = default;
47  Backup& operator=(Backup const&) = default;
48  Backup(Backup&&) = default;
49  Backup& operator=(Backup&&) = default;
51 
56  std::string FullName() const;
57 
59  Instance const& instance() const { return instance_; }
60  std::string const& backup_id() const { return backup_id_; }
61 
63 
64  friend bool operator==(Backup const& a, Backup const& b);
65  friend bool operator!=(Backup const& a, Backup const& b);
67 
69  friend std::ostream& operator<<(std::ostream& os, Backup const& bn);
70 
71  private:
72  Instance instance_;
73  std::string backup_id_;
74 };
75 
76 } // namespace SPANNER_CLIENT_NS
77 } // namespace spanner
78 } // namespace cloud
79 } // namespace google
80 
81 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_BACKUP_H
This class identifies a Cloud Spanner Backup.
Definition: backup.h:38
bool operator!=(Backup const &a, Backup const &b)
Definition: backup.cc:33
This class identifies a Cloud Spanner Instance.
Definition: instance.h:41
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
Instance const & instance() const
Returns the Instance containing this backup.
Definition: backup.h:59
std::string const & backup_id() const
Definition: backup.h:60
std::ostream & operator<<(std::ostream &os, Backup const &bn)
Definition: backup.cc:35