GRPC C++  1.24.0
Namespaces | Data Structures | Typedefs | Enumerations | Functions | Variables
grpc Namespace Reference

This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInputStream interface. More...

Namespaces

 experimental
 ClientRpcInfo represents the state of a particular RPC as it appears to an interceptor.
 
 internal
 Models a gRPC server.
 
 protobuf
 
 testing
 

Data Structures

class  AsyncGenericService
 
class  AuthContext
 Class encapsulating the Authentication Information. More...
 
class  AuthPropertyIterator
 
class  ByteBuffer
 A sequence of bytes. More...
 
class  ChannelInterface
 Codegen interface for grpc::Channel. More...
 
class  CoreCodegen
 Implementation of the core codegen interface. More...
 
class  CoreCodegenInterface
 Interface between the codegen library and the minimal subset of core features required by the generated code. More...
 
class  GenericServerContext
 
class  GrpcLibraryCodegen
 Classes that require gRPC to be initialized should inherit from this class. More...
 
class  GrpcLibraryInterface
 
class  HealthCheckServiceServerBuilderOption
 
class  ProtoBufferReader
 This is a specialization of the protobuf class ZeroCopyInputStream The principle is to get one chunk of data at a time from the proto layer, with options to backup (re-see some bytes) or skip (forward past some bytes) More...
 
class  ProtoBufferWriter
 This is a specialization of the protobuf class ZeroCopyOutputStream. More...
 
class  SerializationTraits
 Defines how to serialize and deserialize some type. More...
 
class  SerializationTraits< ByteBuffer, void >
 
class  ServerBuilderPlugin
 This interface is meant for internal usage only. More...
 
class  ServerInterface
 
class  Service
 Desriptor of an RPC service and its various RPC methods. More...
 
class  Slice
 A wrapper around grpc_slice. More...
 
struct  SslServerCredentialsOptions
 Options to create ServerCredentials with SSL. More...
 
class  Status
 Did it work? If it didn't, why? More...
 
class  string_ref
 This class is a non owning reference to a string. More...
 
class  StubOptions
 Useful interface for generated stubs. More...
 
class  TimePoint
 If you are trying to use CompletionQueue::AsyncNext with a time class that isn't either gpr_timespec or std::chrono::system_clock::time_point, you will most likely be looking at this comment as your compiler will have fired an error below. More...
 
class  TimePoint< gpr_timespec >
 
class  TimePoint< std::chrono::system_clock::time_point >
 
class  WriteOptions
 Per-message write options. More...
 

Typedefs

typedef ::grpc_impl::Alarm Alarm
 
typedef ::grpc_impl::Channel Channel
 
typedef ::grpc_impl::GenericStub GenericStub
 
typedef ::grpc_impl::ClientAsyncReaderWriter< ByteBuffer, ByteBufferGenericClientAsyncReaderWriter
 
typedef ::grpc_impl::ClientAsyncResponseReader< ByteBufferGenericClientAsyncResponseReader
 
typedef ::grpc_impl::HealthCheckServiceInterface HealthCheckServiceInterface
 
typedef ::grpc_impl::ServerAsyncReaderWriter< ByteBuffer, ByteBufferGenericServerAsyncReaderWriter
 
typedef ::grpc_impl::ServerAsyncResponseWriter< ByteBufferGenericServerAsyncResponseWriter
 
typedef ::grpc_impl::ServerAsyncReader< ByteBuffer, ByteBufferGenericServerAsyncReader
 
typedef ::grpc_impl::ServerAsyncWriter< ByteBufferGenericServerAsyncWriter
 
template<class R >
using ClientAsyncReaderInterface = ::grpc_impl::ClientAsyncReaderInterface< R >
 
template<class R >
using ClientAsyncReader = ::grpc_impl::ClientAsyncReader< R >
 
template<class W >
using ClientAsyncWriterInterface = ::grpc_impl::ClientAsyncWriterInterface< W >
 
template<class W >
using ClientAsyncWriter = ::grpc_impl::ClientAsyncWriter< W >
 
template<class W , class R >
using ClientAsyncReaderWriterInterface = ::grpc_impl::ClientAsyncReaderWriterInterface< W, R >
 
template<class W , class R >
using ClientAsyncReaderWriter = ::grpc_impl::ClientAsyncReaderWriter< W, R >
 
template<class W , class R >
using ServerAsyncReaderInterface = ::grpc_impl::ServerAsyncReaderInterface< W, R >
 
template<class W , class R >
using ServerAsyncReader = ::grpc_impl::ServerAsyncReader< W, R >
 
template<class W >
using ServerAsyncWriterInterface = ::grpc_impl::ServerAsyncWriterInterface< W >
 
template<class W >
using ServerAsyncWriter = ::grpc_impl::ServerAsyncWriter< W >
 
template<class W , class R >
using ServerAsyncReaderWriterInterface = ::grpc_impl::ServerAsyncReaderWriterInterface< W, R >
 
template<class W , class R >
using ServerAsyncReaderWriter = ::grpc_impl::ServerAsyncReaderWriter< W, R >
 
template<class R >
using ClientAsyncResponseReaderInterface = grpc_impl::ClientAsyncResponseReaderInterface< R >
 
template<class R >
using ClientAsyncResponseReader = grpc_impl::ClientAsyncResponseReader< R >
 
template<class W >
using ServerAsyncResponseWriter = ::grpc_impl::ServerAsyncResponseWriter< W >
 
typedef ::grpc_impl::ClientContext ClientContext
 
typedef ::grpc_impl::PropagationOptions PropagationOptions
 
typedef ::grpc_impl::CompletionQueue CompletionQueue
 
typedef ::grpc_impl::ServerCompletionQueue ServerCompletionQueue
 
typedef std::string string
 
typedef std::pair< grpc::string_ref, grpc::string_refAuthProperty
 
typedef ::grpc_impl::ServerContext ServerContext
 
template<class R >
using ClientReaderInterface = ::grpc_impl::ClientReaderInterface< R >
 
template<class R >
using ClientReader = ::grpc_impl::ClientReader< R >
 
template<class W >
using ClientWriterInterface = ::grpc_impl::ClientWriterInterface< W >
 
template<class W >
using ClientWriter = ::grpc_impl::ClientWriter< W >
 
template<class W , class R >
using ClientReaderWriterInterface = ::grpc_impl::ClientReaderWriterInterface< W, R >
 
template<class W , class R >
using ClientReaderWriter = ::grpc_impl::ClientReaderWriter< W, R >
 
template<class R >
using ServerReaderInterface = ::grpc_impl::ServerReaderInterface< R >
 
template<class R >
using ServerReader = ::grpc_impl::ServerReader< R >
 
template<class W >
using ServerWriterInterface = ::grpc_impl::ServerWriterInterface< W >
 
template<class W >
using ServerWriter = ::grpc_impl::ServerWriter< W >
 
template<class W , class R >
using ServerReaderWriterInterface = ::grpc_impl::ServerReaderWriterInterface< W, R >
 
template<class W , class R >
using ServerReaderWriter = ::grpc_impl::ServerReaderWriter< W, R >
 
template<class RequestType , class ResponseType >
using ServerUnaryStreamer = ::grpc_impl::ServerUnaryStreamer< RequestType, ResponseType >
 
template<class RequestType , class ResponseType >
using ServerSplitStreamer = ::grpc_impl::ServerSplitStreamer< RequestType, ResponseType >
 
typedef ::grpc_impl::ServerBuilderOption ServerBuilderOption
 
typedef ::grpc_impl::ServerInitializer ServerInitializer
 
typedef ::grpc_impl::ResourceQuota ResourceQuota
 
typedef ::grpc_impl::AuthMetadataProcessor AuthMetadataProcessor
 
typedef ::grpc_impl::ChannelCredentials ChannelCredentials
 
typedef ::grpc_impl::CallCredentials CallCredentials
 
typedef ::grpc_impl::SslCredentialsOptions SslCredentialsOptions
 
typedef ::grpc_impl::SecureCallCredentials SecureCallCredentials
 
typedef ::grpc_impl::SecureChannelCredentials SecureChannelCredentials
 
typedef ::grpc_impl::MetadataCredentialsPlugin MetadataCredentialsPlugin
 
typedef ::grpc_impl::ServerCredentials ServerCredentials
 
typedef ::grpc_impl::Server Server
 
typedef ::grpc_impl::ServerBuilder ServerBuilder
 
typedef ::grpc_impl::ChannelArguments ChannelArguments
 

Enumerations

enum  StatusCode {
  OK = 0, CANCELLED = 1, UNKNOWN = 2, INVALID_ARGUMENT = 3,
  DEADLINE_EXCEEDED = 4, NOT_FOUND = 5, ALREADY_EXISTS = 6, PERMISSION_DENIED = 7,
  UNAUTHENTICATED = 16, RESOURCE_EXHAUSTED = 8, FAILED_PRECONDITION = 9, ABORTED = 10,
  OUT_OF_RANGE = 11, UNIMPLEMENTED = 12, INTERNAL = 13, UNAVAILABLE = 14,
  DATA_LOSS = 15, DO_NOT_USE = -1
}
 

Functions

std::shared_ptr<::grpc_impl::ChannelCreateChannelInternal (const grpc::string &host, grpc_channel *c_channel, std::vector< std::unique_ptr< experimental::ClientInterceptorFactoryInterface >> interceptor_creators)
 
grpc::string Version ()
 Return gRPC library version. More...
 
std::unique_ptr< ServerBuilderOptionMakeChannelArgumentOption (const grpc::string &name, const grpc::string &value)
 
std::unique_ptr< ServerBuilderOptionMakeChannelArgumentOption (const grpc::string &name, int value)
 
std::shared_ptr< const AuthContextCreateAuthContext (grpc_call *call)
 
template<class ProtoBufferWriter , class T >
Status GenericSerialize (const grpc::protobuf::MessageLite &msg, ByteBuffer *bb, bool *own_buffer)
 
template<class ProtoBufferReader , class T >
Status GenericDeserialize (ByteBuffer *buffer, grpc::protobuf::MessageLite *msg)
 
grpc::string_ref StringRefFromSlice (const grpc_slice *slice)
 
grpc::string StringFromCopiedSlice (grpc_slice slice)
 
grpc_slice SliceReferencingString (const grpc::string &str)
 
grpc_slice SliceFromCopiedString (const grpc::string &str)
 
bool operator== (string_ref x, string_ref y)
 Comparison operators. More...
 
bool operator!= (string_ref x, string_ref y)
 
bool operator< (string_ref x, string_ref y)
 
bool operator<= (string_ref x, string_ref y)
 
bool operator> (string_ref x, string_ref y)
 
bool operator>= (string_ref x, string_ref y)
 
std::ostream & operator<< (std::ostream &out, const string_ref &string)
 
void Timepoint2Timespec (const std::chrono::system_clock::time_point &from, gpr_timespec *to)
 
void TimepointHR2Timespec (const std::chrono::high_resolution_clock::time_point &from, gpr_timespec *to)
 
std::chrono::system_clock::time_point Timespec2Timepoint (gpr_timespec t)
 

Variables

const char kHealthCheckServiceInterfaceArg []
 
CoreCodegenInterfaceg_core_codegen_interface
 
GrpcLibraryInterfaceg_glip
 Initialized by grpc::GrpcLibraryInitializer from <grpcpp/impl/grpc_library.h> More...
 
const int kProtoBufferWriterMaxBufferLength = 1024 * 1024
 
constexpr long kMaxAuthTokenLifetimeSecs
 Constant for maximum auth token lifetime. More...
 

Detailed Description

This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInputStream interface.

This header provides serialization and deserialization between gRPC messages serialized using protobuf and the C++ objects they represent.

This header provides an object that writes bytes directly into a grpc::ByteBuffer, via the ZeroCopyOutputStream interface.

Typedef Documentation

◆ Alarm

◆ AuthMetadataProcessor

◆ AuthProperty

◆ CallCredentials

◆ Channel

◆ ChannelArguments

◆ ChannelCredentials

◆ ClientAsyncReader

template<class R >
using grpc::ClientAsyncReader = typedef ::grpc_impl::ClientAsyncReader<R>

◆ ClientAsyncReaderInterface

◆ ClientAsyncReaderWriter

template<class W , class R >
using grpc::ClientAsyncReaderWriter = typedef ::grpc_impl::ClientAsyncReaderWriter<W, R>

◆ ClientAsyncReaderWriterInterface

template<class W , class R >
using grpc::ClientAsyncReaderWriterInterface = typedef ::grpc_impl::ClientAsyncReaderWriterInterface<W, R>

◆ ClientAsyncResponseReader

◆ ClientAsyncResponseReaderInterface

◆ ClientAsyncWriter

template<class W >
using grpc::ClientAsyncWriter = typedef ::grpc_impl::ClientAsyncWriter<W>

◆ ClientAsyncWriterInterface

◆ ClientContext

◆ ClientReader

template<class R >
using grpc::ClientReader = typedef ::grpc_impl::ClientReader<R>

◆ ClientReaderInterface

template<class R >
using grpc::ClientReaderInterface = typedef ::grpc_impl::ClientReaderInterface<R>

◆ ClientReaderWriter

template<class W , class R >
using grpc::ClientReaderWriter = typedef ::grpc_impl::ClientReaderWriter<W, R>

◆ ClientReaderWriterInterface

template<class W , class R >
using grpc::ClientReaderWriterInterface = typedef ::grpc_impl::ClientReaderWriterInterface<W, R>

◆ ClientWriter

template<class W >
using grpc::ClientWriter = typedef ::grpc_impl::ClientWriter<W>

◆ ClientWriterInterface

template<class W >
using grpc::ClientWriterInterface = typedef ::grpc_impl::ClientWriterInterface<W>

◆ CompletionQueue

◆ GenericClientAsyncReaderWriter

◆ GenericClientAsyncResponseReader

◆ GenericServerAsyncReader

◆ GenericServerAsyncReaderWriter

◆ GenericServerAsyncResponseWriter

◆ GenericServerAsyncWriter

◆ GenericStub

◆ HealthCheckServiceInterface

◆ MetadataCredentialsPlugin

typedef::grpc_impl::MetadataCredentialsPlugin grpc::MetadataCredentialsPlugin

◆ PropagationOptions

◆ ResourceQuota

◆ SecureCallCredentials

typedef ::grpc_impl::SecureCallCredentials grpc::SecureCallCredentials

◆ SecureChannelCredentials

typedef ::grpc_impl::SecureChannelCredentials grpc::SecureChannelCredentials

◆ Server

◆ ServerAsyncReader

template<class W , class R >
using grpc::ServerAsyncReader = typedef ::grpc_impl::ServerAsyncReader<W, R>

◆ ServerAsyncReaderInterface

template<class W , class R >
using grpc::ServerAsyncReaderInterface = typedef ::grpc_impl::ServerAsyncReaderInterface<W, R>

◆ ServerAsyncReaderWriter

template<class W , class R >
using grpc::ServerAsyncReaderWriter = typedef ::grpc_impl::ServerAsyncReaderWriter<W, R>

◆ ServerAsyncReaderWriterInterface

template<class W , class R >
using grpc::ServerAsyncReaderWriterInterface = typedef ::grpc_impl::ServerAsyncReaderWriterInterface<W, R>

◆ ServerAsyncResponseWriter

◆ ServerAsyncWriter

template<class W >
using grpc::ServerAsyncWriter = typedef ::grpc_impl::ServerAsyncWriter<W>

◆ ServerAsyncWriterInterface

◆ ServerBuilder

◆ ServerBuilderOption

◆ ServerCompletionQueue

◆ ServerContext

◆ ServerCredentials

◆ ServerInitializer

◆ ServerReader

template<class R >
using grpc::ServerReader = typedef ::grpc_impl::ServerReader<R>

◆ ServerReaderInterface

template<class R >
using grpc::ServerReaderInterface = typedef ::grpc_impl::ServerReaderInterface<R>

◆ ServerReaderWriter

template<class W , class R >
using grpc::ServerReaderWriter = typedef ::grpc_impl::ServerReaderWriter<W, R>

◆ ServerReaderWriterInterface

template<class W , class R >
using grpc::ServerReaderWriterInterface = typedef ::grpc_impl::ServerReaderWriterInterface<W, R>

◆ ServerSplitStreamer

template<class RequestType , class ResponseType >
using grpc::ServerSplitStreamer = typedef ::grpc_impl::ServerSplitStreamer<RequestType, ResponseType>

◆ ServerUnaryStreamer

template<class RequestType , class ResponseType >
using grpc::ServerUnaryStreamer = typedef ::grpc_impl::ServerUnaryStreamer<RequestType, ResponseType>

◆ ServerWriter

template<class W >
using grpc::ServerWriter = typedef ::grpc_impl::ServerWriter<W>

◆ ServerWriterInterface

template<class W >
using grpc::ServerWriterInterface = typedef ::grpc_impl::ServerWriterInterface<W>

◆ SslCredentialsOptions

◆ string

typedef std::string grpc::string

Enumeration Type Documentation

◆ StatusCode

Enumerator
OK 

Not an error; returned on success.

CANCELLED 

The operation was cancelled (typically by the caller).

UNKNOWN 

Unknown error.

An example of where this error may be returned is if a Status value received from another address space belongs to an error-space that is not known in this address space. Also errors raised by APIs that do not return enough error information may be converted to this error.

INVALID_ARGUMENT 

Client specified an invalid argument.

Note that this differs from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are problematic regardless of the state of the system (e.g., a malformed file name).

DEADLINE_EXCEEDED 

Deadline expired before operation could complete.

For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire.

NOT_FOUND 

Some requested entity (e.g., file or directory) was not found.

ALREADY_EXISTS 

Some entity that we attempted to create (e.g., file or directory) already exists.

PERMISSION_DENIED 

The caller does not have permission to execute the specified operation.

PERMISSION_DENIED must not be used for rejections caused by exhausting some resource (use RESOURCE_EXHAUSTED instead for those errors). PERMISSION_DENIED must not be used if the caller can not be identified (use UNAUTHENTICATED instead for those errors).

UNAUTHENTICATED 

The request does not have valid authentication credentials for the operation.

RESOURCE_EXHAUSTED 

Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space.

FAILED_PRECONDITION 

Operation was rejected because the system is not in a state required for the operation's execution.

For example, directory to be deleted may be non-empty, an rmdir operation is applied to a non-directory, etc.

A litmus test that may help a service implementor in deciding between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE: (a) Use UNAVAILABLE if the client can retry just the failing call. (b) Use ABORTED if the client should retry at a higher-level (e.g., restarting a read-modify-write sequence). (c) Use FAILED_PRECONDITION if the client should not retry until the system state has been explicitly fixed. E.g., if an "rmdir" fails because the directory is non-empty, FAILED_PRECONDITION should be returned since the client should not retry unless they have first fixed up the directory by deleting files from it. (d) Use FAILED_PRECONDITION if the client performs conditional REST Get/Update/Delete on a resource and the resource on the server does not match the condition. E.g., conflicting read-modify-write on the same resource.

ABORTED 

The operation was aborted, typically due to a concurrency issue like sequencer check failures, transaction aborts, etc.

See litmus test above for deciding between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE.

OUT_OF_RANGE 

Operation was attempted past the valid range.

E.g., seeking or reading past end of file.

Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed if the system state changes. For example, a 32-bit file system will generate INVALID_ARGUMENT if asked to read at an offset that is not in the range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from an offset past the current file size.

There is a fair bit of overlap between FAILED_PRECONDITION and OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error) when it applies so that callers who are iterating through a space can easily look for an OUT_OF_RANGE error to detect when they are done.

UNIMPLEMENTED 

Operation is not implemented or not supported/enabled in this service.

INTERNAL 

Internal errors.

Means some invariants expected by underlying System has been broken. If you see one of these errors, Something is very broken.

UNAVAILABLE 

The service is currently unavailable.

This is a most likely a transient condition and may be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations.

Warning
Although data MIGHT not have been transmitted when this status occurs, there is NOT A GUARANTEE that the server has not seen anything. So in general it is unsafe to retry on this status code if the call is non-idempotent.

See litmus test above for deciding between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE.

DATA_LOSS 

Unrecoverable data loss or corruption.

DO_NOT_USE 

Force users to include a default branch:

Function Documentation

◆ CreateAuthContext()

std::shared_ptr<const AuthContext> grpc::CreateAuthContext ( grpc_call call)

◆ CreateChannelInternal()

std::shared_ptr<::grpc_impl::Channel> grpc::CreateChannelInternal ( const grpc::string host,
grpc_channel c_channel,
std::vector< std::unique_ptr< experimental::ClientInterceptorFactoryInterface >>  interceptor_creators 
)

◆ GenericDeserialize()

template<class ProtoBufferReader , class T >
Status grpc::GenericDeserialize ( ByteBuffer buffer,
grpc::protobuf::MessageLite msg 
)

◆ GenericSerialize()

template<class ProtoBufferWriter , class T >
Status grpc::GenericSerialize ( const grpc::protobuf::MessageLite msg,
ByteBuffer bb,
bool *  own_buffer 
)

◆ MakeChannelArgumentOption() [1/2]

std::unique_ptr<ServerBuilderOption> grpc::MakeChannelArgumentOption ( const grpc::string name,
const grpc::string value 
)

◆ MakeChannelArgumentOption() [2/2]

std::unique_ptr<ServerBuilderOption> grpc::MakeChannelArgumentOption ( const grpc::string name,
int  value 
)

◆ operator!=()

bool grpc::operator!= ( string_ref  x,
string_ref  y 
)
inline

◆ operator<()

bool grpc::operator< ( string_ref  x,
string_ref  y 
)
inline

◆ operator<<()

std::ostream& grpc::operator<< ( std::ostream &  out,
const string_ref string 
)
inline

◆ operator<=()

bool grpc::operator<= ( string_ref  x,
string_ref  y 
)
inline

◆ operator==()

bool grpc::operator== ( string_ref  x,
string_ref  y 
)
inline

Comparison operators.

◆ operator>()

bool grpc::operator> ( string_ref  x,
string_ref  y 
)
inline

◆ operator>=()

bool grpc::operator>= ( string_ref  x,
string_ref  y 
)
inline

◆ SliceFromCopiedString()

grpc_slice grpc::SliceFromCopiedString ( const grpc::string str)
inline

◆ SliceReferencingString()

grpc_slice grpc::SliceReferencingString ( const grpc::string str)
inline

◆ StringFromCopiedSlice()

grpc::string grpc::StringFromCopiedSlice ( grpc_slice  slice)
inline

◆ StringRefFromSlice()

grpc::string_ref grpc::StringRefFromSlice ( const grpc_slice slice)
inline

◆ Timepoint2Timespec()

void grpc::Timepoint2Timespec ( const std::chrono::system_clock::time_point &  from,
gpr_timespec to 
)

◆ TimepointHR2Timespec()

void grpc::TimepointHR2Timespec ( const std::chrono::high_resolution_clock::time_point &  from,
gpr_timespec to 
)

◆ Timespec2Timepoint()

std::chrono::system_clock::time_point grpc::Timespec2Timepoint ( gpr_timespec  t)

◆ Version()

grpc::string grpc::Version ( )

Return gRPC library version.

Variable Documentation

◆ g_core_codegen_interface

CoreCodegenInterface * grpc::g_core_codegen_interface

◆ g_glip

GrpcLibraryInterface* grpc::g_glip

Initialized by grpc::GrpcLibraryInitializer from <grpcpp/impl/grpc_library.h>

◆ kHealthCheckServiceInterfaceArg

const char grpc::kHealthCheckServiceInterfaceArg[]
Initial value:
=
"grpc.health_check_service_interface"

◆ kMaxAuthTokenLifetimeSecs

constexpr long grpc::kMaxAuthTokenLifetimeSecs
Initial value:
=
constexpr long kMaxAuthTokenLifetimeSecs
Constant for maximum auth token lifetime.
Definition: credentials.h:49

Constant for maximum auth token lifetime.

◆ kProtoBufferWriterMaxBufferLength

const int grpc::kProtoBufferWriterMaxBufferLength = 1024 * 1024