Google Cloud Spanner C++ Client
A C++ Client Library for Google Cloud Spanner
Public Member Functions | Friends | List of all members
google::cloud::spanner::v1::Instance Class Reference

This class identifies a Cloud Spanner Instance. More...

#include <google/cloud/spanner/instance.h>

Public Member Functions

 Instance (std::string project_id, std::string instance_id)
 Constructs a Instance object identified by the given IDs. More...
 
std::string const & project_id () const
 Returns the Project ID. More...
 
std::string const & instance_id () const
 Returns the Instance ID. More...
 
std::string FullName () const
 Returns the fully qualified instance name as a string of the form: "projects/<project-id>/instances/<instance-id>". More...
 
Copy and move
 Instance (Instance const &)=default
 
Instanceoperator= (Instance const &)=default
 
 Instance (Instance &&)=default
 
Instanceoperator= (Instance &&)=default
 

Friends

std::ostream & operator<< (std::ostream &os, Instance const &dn)
 Output the FullName() format. More...
 
Equality operators
bool operator== (Instance const &a, Instance const &b)
 
bool operator!= (Instance const &a, Instance const &b)
 

Detailed Description

This class identifies a Cloud Spanner Instance.

A Cloud Spanner instance is identified by its project_id and instance_id.

Note
this class makes no effort to validate the components of the database name. It is the application's responsibility to provide valid project, and instance ids. Passing invalid values will not be checked until the instance name is used in a RPC to spanner.

For more info about the instance_id format, see https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.instance.v1#createinstancerequest

Definition at line 41 of file instance.h.

Constructor & Destructor Documentation

◆ Instance() [1/3]

google::cloud::spanner::v1::Instance::Instance ( std::string  project_id,
std::string  instance_id 
)

Constructs a Instance object identified by the given IDs.

Definition at line 23 of file instance.cc.

◆ Instance() [2/3]

google::cloud::spanner::v1::Instance::Instance ( Instance const &  )
default

◆ Instance() [3/3]

google::cloud::spanner::v1::Instance::Instance ( Instance &&  )
default

Member Function Documentation

◆ FullName()

std::string google::cloud::spanner::v1::Instance::FullName ( ) const

Returns the fully qualified instance name as a string of the form: "projects/<project-id>/instances/<instance-id>".

Definition at line 27 of file instance.cc.

◆ instance_id()

std::string const& google::cloud::spanner::v1::Instance::instance_id ( ) const
inline

Returns the Instance ID.

Definition at line 58 of file instance.h.

◆ operator=() [1/2]

Instance& google::cloud::spanner::v1::Instance::operator= ( Instance const &  )
default

◆ operator=() [2/2]

Instance& google::cloud::spanner::v1::Instance::operator= ( Instance &&  )
default

◆ project_id()

std::string const& google::cloud::spanner::v1::Instance::project_id ( ) const
inline

Returns the Project ID.

Definition at line 55 of file instance.h.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( Instance const &  a,
Instance const &  b 
)
friend

Definition at line 35 of file instance.cc.

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
Instance const &  dn 
)
friend

Output the FullName() format.

Definition at line 37 of file instance.cc.

◆ operator==

bool operator== ( Instance const &  a,
Instance const &  b 
)
friend

Definition at line 31 of file instance.cc.