Google Cloud C++ Client  0.10.0
C++ Client Library for Google Cloud Platform
Classes | Enumerations | Functions
google::cloud::v0 Namespace Reference

The Google Cloud C++ Library inlined, versioned namespace. More...

Classes

class  future
 Implement ISO/IEC TS 19571:2016 future<T>. More...
 
class  future< void >
 Implement ISO/IEC TS 19571:2016 future for void. More...
 
class  IamBinding
 Represents a Binding which associates a member with a particular role which can be used for Identity and Access management for Cloud Platform Resources. More...
 
class  IamBindings
 Represents a container for providing users with a handful of operation to users which they can use to add and remove members to Binding which is used for defining IAM Policy for Cloud Platform Resources. More...
 
struct  IamPolicy
 Represent the result of a GetIamPolicy or SetIamPolicy request. More...
 
class  LogBackend
 A sink to receive log records. More...
 
class  Logger
 Define the class to capture a log message. More...
 
class  Logger< false >
 Define the logger for a disabled log level. More...
 
struct  LogRecord
 Represents a single log message. More...
 
class  LogSink
 
struct  NullStream
 Implements operator<< for all types, without any effect. More...
 
class  optional
 A poor's man version of std::optional<T>. More...
 
class  promise
 Implement promise<T> as defined in ISO/IEC TS 19571:2016. More...
 
class  promise< void >
 Specialize promise as defined in ISO/IEC TS 19571:2016 for void. More...
 
class  RuntimeStatusError
 
class  Status
 Reports error code and details from a remote request. More...
 
class  StatusOr
 Holds a value or a Status indicating why there is no value. More...
 

Enumerations

enum  Severity : int {
  Severity::GCP_LS_TRACE, Severity::GCP_LS_DEBUG, Severity::GCP_LS_INFO, Severity::GCP_LS_NOTICE,
  Severity::GCP_LS_WARNING, Severity::GCP_LS_ERROR, Severity::GCP_LS_CRITICAL, Severity::GCP_LS_ALERT,
  Severity::GCP_LS_FATAL, Severity::GCP_LS_HIGHEST = int(GCP_LS_FATAL), Severity::GCP_LS_LOWEST = int(GCP_LS_TRACE), Severity::GCP_LS_LOWEST_ENABLED = int(GOOGLE_CLOUD_CPP_LOGGING_MIN_SEVERITY_ENABLED)
}
 Define the severity levels for Google Cloud Platform C++ Libraries logging. More...
 
enum  StatusCode {
  StatusCode::kOk = 0, StatusCode::kCancelled = 1, StatusCode::kUnknown = 2, StatusCode::kInvalidArgument = 3,
  StatusCode::kDeadlineExceeded = 4, StatusCode::kNotFound = 5, StatusCode::kAlreadyExists = 6, StatusCode::kPermissionDenied = 7,
  StatusCode::kUnauthenticated = 16, StatusCode::kResourceExhausted = 8, StatusCode::kFailedPrecondition = 9, StatusCode::kAborted = 10,
  StatusCode::kOutOfRange = 11, StatusCode::kUnimplemented = 12, StatusCode::kInternal = 13, StatusCode::kUnavailable = 14,
  StatusCode::kDataLoss = 15
}
 Well-known status codes with grpc::StatusCode-compatible values. More...
 

Functions

std::ostream & operator<< (std::ostream &os, IamBindings const &rhs)
 
bool operator== (IamBindings const &lhs, IamBindings const &rhs)
 
bool operator< (IamBindings const &lhs, IamBindings const &rhs)
 
bool operator!= (IamBindings const &lhs, IamBindings const &rhs)
 
bool operator> (IamBindings const &lhs, IamBindings const &rhs)
 
bool operator<= (IamBindings const &lhs, IamBindings const &rhs)
 
bool operator>= (IamBindings const &lhs, IamBindings const &rhs)
 
std::ostream & operator<< (std::ostream &os, IamPolicy const &rhs)
 
bool operator== (IamPolicy const &lhs, IamPolicy const &rhs)
 
bool operator< (IamPolicy const &lhs, IamPolicy const &rhs)
 
bool operator!= (IamPolicy const &lhs, IamPolicy const &rhs)
 
bool operator> (IamPolicy const &lhs, IamPolicy const &rhs)
 
bool operator<= (IamPolicy const &lhs, IamPolicy const &rhs)
 
bool operator>= (IamPolicy const &lhs, IamPolicy const &rhs)
 
std::ostream & operator<< (std::ostream &os, Severity x)
 Streaming operator, writes a human readable representation. More...
 
std::ostream & operator<< (std::ostream &os, LogRecord const &rhs)
 Default formatting of a LogRecord. More...
 
std::string StatusCodeToString (StatusCode code)
 
std::ostream & operator<< (std::ostream &os, StatusCode code)
 
std::ostream & operator<< (std::ostream &os, Status const &rhs)
 
bool operator== (Status const &lhs, Status const &rhs)
 
bool operator!= (Status const &lhs, Status const &rhs)
 
template<typename T >
future< typename internal::make_ready_return< T >::type > make_ready_future (T &&t)
 Create a future<void> that is immediately ready. More...
 
future< void > make_ready_future ()
 Create a future<void> that is immediately ready. More...
 
template<typename T >
optional< T > make_optional (T &&t)
 
template<typename T >
bool operator== (optional< T > const &lhs, optional< T > const &rhs)
 
template<typename T >
bool operator< (optional< T > const &lhs, optional< T > const &rhs)
 
template<typename T >
bool operator!= (optional< T > const &lhs, optional< T > const &rhs)
 
template<typename T >
bool operator> (optional< T > const &lhs, optional< T > const &rhs)
 
template<typename T >
bool operator>= (optional< T > const &lhs, optional< T > const &rhs)
 
template<typename T >
bool operator<= (optional< T > const &lhs, optional< T > const &rhs)
 
template<typename T >
bool operator== (StatusOr< T > const &a, StatusOr< T > const &b)
 
template<typename T >
bool operator!= (StatusOr< T > const &a, StatusOr< T > const &b)
 
template<typename T >
StatusOr< T > make_status_or (T rhs)
 
int constexpr version_major ()
 The Google Cloud Storage C++ Client major version. More...
 
int constexpr version_minor ()
 The Google Cloud Storage C++ Client minor version. More...
 
int constexpr version_patch ()
 The Google Cloud Storage C++ Client patch version. More...
 
int constexpr version ()
 A single integer representing the Major/Minor/Patch version. More...
 
std::string version_string ()
 The version as a string, in MAJOR.MINOR.PATCH+gitrev format. More...
 

Control behaviour on unrecoverable errors.

The following APIs are google::cloud counterpart for std::{set,get}_terminate functions.

If exceptions are not enabled via GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS, calling any function from throw_delegate.h will result in calling the handler installed via this API. By default, a call to std::abort() is used.

using TerminateHandler = std::function< void(const char *msg)>
 Terminate handler. More...
 
TerminateHandler SetTerminateHandler (TerminateHandler f)
 Install terminate handler and get the old one atomically. More...
 
TerminateHandler GetTerminateHandler ()
 Get the currently installed handler. More...
 
void Terminate (const char *msg)
 Invoke the currently installed handler. More...
 

Detailed Description

The Google Cloud C++ Library inlined, versioned namespace.

Applications may need to link multiple versions of the Google Cloud C++ Libraries, for example, if they link a library that uses an older version of the libraries than they do. This namespace is inlined, so applications can use google::cloud::Foo in their source, but the symbols are versioned, i.e., the symbol becomes google::cloud::v1::Foo.

Note that, consistent with the semver.org guidelines, the v0 version makes no guarantees with respect to backwards compatibility.

Typedef Documentation

◆ TerminateHandler

using google::cloud::v0::TerminateHandler = typedef std::function<void(const char* msg)>

Terminate handler.

It should handle the error, whose description are given in msg and should never return.

Definition at line 41 of file terminate_handler.h.

Enumeration Type Documentation

◆ Severity

enum google::cloud::v0::Severity : int
strong

Define the severity levels for Google Cloud Platform C++ Libraries logging.

These are modelled after the severity level in syslog(1) and many derived tools.

We force the enum to be represented as an int because we will store the values in an std::atomic<> and the implementations usually optimize std::atomic<int> but not std::atomic<Foo>

Enumerator
GCP_LS_TRACE 

Use this level for messages that indicate the code is entering and leaving functions.

GCP_LS_DEBUG 

Use this level for debug messages that should not be present in production.

GCP_LS_INFO 

Informational messages, such as normal progress.

GCP_LS_NOTICE 

Informational messages, such as unusual, but expected conditions.

GCP_LS_WARNING 

An indication of problems, users may need to take action.

GCP_LS_ERROR 

An error has been detected.

Do not use for normal conditions, such as remote servers disconnecting.

GCP_LS_CRITICAL 

The system is in a critical state, such as running out of local resources.

GCP_LS_ALERT 

The system is at risk of immediate failure.

GCP_LS_FATAL 

The system is about to crash or terminate.

GCP_LS_HIGHEST 

The highest possible severity level.

GCP_LS_LOWEST 

The lowest possible severity level.

GCP_LS_LOWEST_ENABLED 

The lowest level that is enabled at compile-time.

Definition at line 171 of file log.h.

◆ StatusCode

Well-known status codes with grpc::StatusCode-compatible values.

The semantics of these values are documented in: https://grpc.io/grpc/cpp/classgrpc_1_1_status.html

Enumerator
kOk 

Not an error; returned on success.

kCancelled 
kUnknown 
kInvalidArgument 
kDeadlineExceeded 
kNotFound 
kAlreadyExists 
kPermissionDenied 
kUnauthenticated 
kResourceExhausted 
kFailedPrecondition 
kAborted 
kOutOfRange 
kUnimplemented 
kInternal 
kUnavailable 
kDataLoss 

Definition at line 32 of file status.h.

Function Documentation

◆ GetTerminateHandler()

TerminateHandler google::cloud::v0::GetTerminateHandler ( )

Get the currently installed handler.

Returns
The currently installed handler.

Definition at line 58 of file terminate_handler.cc.

◆ make_optional()

template<typename T >
optional<T> google::cloud::v0::make_optional ( T &&  t)

Definition at line 234 of file optional.h.

◆ make_ready_future() [1/2]

future<void> google::cloud::v0::make_ready_future ( )
inline

Create a future<void> that is immediately ready.

Definition at line 188 of file future_void.h.

◆ make_ready_future() [2/2]

template<typename T >
future<typename internal::make_ready_return<T>::type> google::cloud::v0::make_ready_future ( T &&  t)
inline

Create a future<void> that is immediately ready.

Definition at line 203 of file future_generic.h.

◆ make_status_or()

template<typename T >
StatusOr<T> google::cloud::v0::make_status_or ( rhs)

Definition at line 352 of file status_or.h.

◆ operator!=() [1/5]

bool google::cloud::v0::operator!= ( IamPolicy const &  lhs,
IamPolicy const &  rhs 
)
inline

Definition at line 51 of file iam_policy.h.

◆ operator!=() [2/5]

bool google::cloud::v0::operator!= ( Status const &  lhs,
Status const &  rhs 
)
inline

Definition at line 88 of file status.h.

◆ operator!=() [3/5]

bool google::cloud::v0::operator!= ( IamBindings const &  lhs,
IamBindings const &  rhs 
)
inline

Definition at line 166 of file iam_bindings.h.

◆ operator!=() [4/5]

template<typename T >
bool google::cloud::v0::operator!= ( optional< T > const &  lhs,
optional< T > const &  rhs 
)
inline

Definition at line 265 of file optional.h.

◆ operator!=() [5/5]

template<typename T >
bool google::cloud::v0::operator!= ( StatusOr< T > const &  a,
StatusOr< T > const &  b 
)

Definition at line 347 of file status_or.h.

◆ operator<() [1/3]

bool google::cloud::v0::operator< ( IamPolicy const &  lhs,
IamPolicy const &  rhs 
)
inline

Definition at line 46 of file iam_policy.h.

◆ operator<() [2/3]

bool google::cloud::v0::operator< ( IamBindings const &  lhs,
IamBindings const &  rhs 
)
inline

Definition at line 162 of file iam_bindings.h.

◆ operator<() [3/3]

template<typename T >
bool google::cloud::v0::operator< ( optional< T > const &  lhs,
optional< T > const &  rhs 
)
inline

Definition at line 250 of file optional.h.

◆ operator<<() [1/6]

std::ostream & google::cloud::v0::operator<< ( std::ostream &  os,
IamPolicy const &  rhs 
)

Definition at line 21 of file iam_policy.cc.

◆ operator<<() [2/6]

std::ostream & google::cloud::v0::operator<< ( std::ostream &  os,
Severity  x 
)

Streaming operator, writes a human readable representation.

Definition at line 27 of file log.cc.

◆ operator<<() [3/6]

std::ostream & google::cloud::v0::operator<< ( std::ostream &  os,
LogRecord const &  rhs 
)

Default formatting of a LogRecord.

Definition at line 36 of file log.cc.

◆ operator<<() [4/6]

std::ostream & google::cloud::v0::operator<< ( std::ostream &  os,
StatusCode  code 
)

Definition at line 70 of file status.cc.

◆ operator<<() [5/6]

std::ostream& google::cloud::v0::operator<< ( std::ostream &  os,
Status const &  rhs 
)
inline

Definition at line 80 of file status.h.

◆ operator<<() [6/6]

std::ostream & google::cloud::v0::operator<< ( std::ostream &  os,
IamBindings const &  rhs 
)

Definition at line 80 of file iam_bindings.cc.

◆ operator<=() [1/3]

bool google::cloud::v0::operator<= ( IamPolicy const &  lhs,
IamPolicy const &  rhs 
)
inline

Definition at line 59 of file iam_policy.h.

◆ operator<=() [2/3]

bool google::cloud::v0::operator<= ( IamBindings const &  lhs,
IamBindings const &  rhs 
)
inline

Definition at line 174 of file iam_bindings.h.

◆ operator<=() [3/3]

template<typename T >
bool google::cloud::v0::operator<= ( optional< T > const &  lhs,
optional< T > const &  rhs 
)
inline

Definition at line 280 of file optional.h.

◆ operator==() [1/5]

bool google::cloud::v0::operator== ( IamPolicy const &  lhs,
IamPolicy const &  rhs 
)
inline

Definition at line 41 of file iam_policy.h.

◆ operator==() [2/5]

bool google::cloud::v0::operator== ( Status const &  lhs,
Status const &  rhs 
)
inline

Definition at line 84 of file status.h.

◆ operator==() [3/5]

bool google::cloud::v0::operator== ( IamBindings const &  lhs,
IamBindings const &  rhs 
)
inline

Definition at line 158 of file iam_bindings.h.

◆ operator==() [4/5]

template<typename T >
bool google::cloud::v0::operator== ( optional< T > const &  lhs,
optional< T > const &  rhs 
)
inline

Definition at line 239 of file optional.h.

◆ operator==() [5/5]

template<typename T >
bool google::cloud::v0::operator== ( StatusOr< T > const &  a,
StatusOr< T > const &  b 
)

Definition at line 339 of file status_or.h.

◆ operator>() [1/3]

bool google::cloud::v0::operator> ( IamPolicy const &  lhs,
IamPolicy const &  rhs 
)
inline

Definition at line 55 of file iam_policy.h.

◆ operator>() [2/3]

bool google::cloud::v0::operator> ( IamBindings const &  lhs,
IamBindings const &  rhs 
)
inline

Definition at line 170 of file iam_bindings.h.

◆ operator>() [3/3]

template<typename T >
bool google::cloud::v0::operator> ( optional< T > const &  lhs,
optional< T > const &  rhs 
)
inline

Definition at line 270 of file optional.h.

◆ operator>=() [1/3]

bool google::cloud::v0::operator>= ( IamPolicy const &  lhs,
IamPolicy const &  rhs 
)
inline

Definition at line 63 of file iam_policy.h.

◆ operator>=() [2/3]

bool google::cloud::v0::operator>= ( IamBindings const &  lhs,
IamBindings const &  rhs 
)
inline

Definition at line 178 of file iam_bindings.h.

◆ operator>=() [3/3]

template<typename T >
bool google::cloud::v0::operator>= ( optional< T > const &  lhs,
optional< T > const &  rhs 
)
inline

Definition at line 275 of file optional.h.

◆ SetTerminateHandler()

TerminateHandler google::cloud::v0::SetTerminateHandler ( TerminateHandler  f)

Install terminate handler and get the old one atomically.

Parameters
fthe handler. It should never return, behaviour is undefined otherwise.
Returns
Previously set handler.

Definition at line 54 of file terminate_handler.cc.

◆ StatusCodeToString()

std::string google::cloud::v0::StatusCodeToString ( StatusCode  code)

Definition at line 29 of file status.cc.

◆ Terminate()

void google::cloud::v0::Terminate ( const char *  msg)

Invoke the currently installed handler.

Parameters
msgDetails about the error.

This function should never return.

Definition at line 60 of file terminate_handler.cc.

◆ version()

int constexpr google::cloud::v0::version ( )

A single integer representing the Major/Minor/Patch version.

Definition at line 68 of file version.h.

◆ version_major()

int constexpr google::cloud::v0::version_major ( )

The Google Cloud Storage C++ Client major version.

See also
https://semver.org/spec/v2.0.0.html for details.

Definition at line 51 of file version.h.

◆ version_minor()

int constexpr google::cloud::v0::version_minor ( )

The Google Cloud Storage C++ Client minor version.

See also
https://semver.org/spec/v2.0.0.html for details.

Definition at line 58 of file version.h.

◆ version_patch()

int constexpr google::cloud::v0::version_patch ( )

The Google Cloud Storage C++ Client patch version.

See also
https://semver.org/spec/v2.0.0.html for details.

Definition at line 65 of file version.h.

◆ version_string()

std::string google::cloud::v0::version_string ( )

The version as a string, in MAJOR.MINOR.PATCH+gitrev format.