Google Cloud C++ Client  0.4.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, StatusCode::kDoNotUse = -1
}
 Well-known status codes with grpc::StatusCode-compatible values. More...
 

Functions

std::ostream & operator<< (std::ostream &os, 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)
 
template<typename T >
optional< T > make_optional (T &&t)
 
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 
kDoNotUse 

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 59 of file terminate_handler.cc.

◆ make_optional()

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

Definition at line 258 of file optional.h.

◆ make_status_or()

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

Definition at line 325 of file status_or.h.

◆ operator!=()

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

Definition at line 51 of file iam_policy.h.

◆ operator<()

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

Definition at line 46 of file iam_policy.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,
IamBindings const &  rhs 
)

Definition at line 80 of file iam_bindings.cc.

◆ operator<<() [6/6]

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

Definition at line 86 of file status.h.

◆ operator<=()

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

Definition at line 59 of file iam_policy.h.

◆ operator==()

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

Definition at line 41 of file iam_policy.h.

◆ operator>()

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

Definition at line 55 of file iam_policy.h.

◆ operator>=()

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

Definition at line 63 of file iam_policy.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 55 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 61 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.