Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
grpc::ChannelArguments Class Reference

#include <channel_arguments.h>

Classes

struct  PointerVtableMembers
 Default pointer argument operations. More...
 

Public Member Functions

grpc_channel_args c_channel_args () const
 
 ChannelArguments ()
 
 ChannelArguments (const ChannelArguments &other)
 
ChannelArgumentsoperator= (ChannelArguments other)
 
void SetChannelArgs (grpc_channel_args *channel_args) const
 
void SetCompressionAlgorithm (grpc_compression_algorithm algorithm)
 Set the compression algorithm for the channel. More...
 
void SetGrpclbFallbackTimeout (int fallback_timeout)
 
void SetInt (const std::string &key, int value)
 Set an integer argument value under key. More...
 
void SetLoadBalancingPolicyName (const std::string &lb_policy_name)
 
void SetMaxReceiveMessageSize (int size)
 Set the max receive and send message sizes. More...
 
void SetMaxSendMessageSize (int size)
 
void SetPointer (const std::string &key, void *value)
 
void SetPointerWithVtable (const std::string &key, void *value, const grpc_arg_pointer_vtable *vtable)
 
void SetResourceQuota (const grpc::ResourceQuota &resource_quota)
 Set the buffer pool to be attached to the constructed channel. More...
 
void SetServiceConfigJSON (const std::string &service_config_json)
 
void SetSocketMutator (grpc_socket_mutator *mutator)
 Set a mutator for the underlying socket. More...
 
void SetSslTargetNameOverride (const std::string &name)
 
void SetString (const std::string &key, const std::string &value)
 Set a textual argument value under key. More...
 
void SetUserAgentPrefix (const std::string &user_agent_prefix)
 Set the string to prepend to the user agent. More...
 
void Swap (ChannelArguments &other)
 
 ~ChannelArguments ()
 

Private Member Functions

std::string GetSslTargetNameOverride () const
 

Private Attributes

std::vector< grpc_argargs_
 
std::list< std::string > strings_
 

Friends

class grpc::SecureChannelCredentials
 
class grpc::testing::ChannelArgumentsTest
 

Detailed Description

Options for channel creation. The user can use generic setters to pass key value pairs down to C channel creation code. For gRPC related options, concrete setters are provided.

Definition at line 39 of file grpcpp/support/channel_arguments.h.

Constructor & Destructor Documentation

◆ ChannelArguments() [1/2]

grpc::ChannelArguments::ChannelArguments ( )

Definition at line 37 of file channel_arguments.cc.

◆ ~ChannelArguments()

grpc::ChannelArguments::~ChannelArguments ( )

Definition at line 73 of file channel_arguments.cc.

◆ ChannelArguments() [2/2]

grpc::ChannelArguments::ChannelArguments ( const ChannelArguments other)

Definition at line 42 of file channel_arguments.cc.

Member Function Documentation

◆ c_channel_args()

grpc_channel_args grpc::ChannelArguments::c_channel_args ( ) const
inline

Return (by value) a C grpc_channel_args structure which points to arguments owned by this ChannelArguments instance

Definition at line 115 of file grpcpp/support/channel_arguments.h.

◆ GetSslTargetNameOverride()

std::string grpc::ChannelArguments::GetSslTargetNameOverride ( ) const
private

Definition at line 33 of file secure_channel_arguments.cc.

◆ operator=()

ChannelArguments& grpc::ChannelArguments::operator= ( ChannelArguments  other)
inline

Definition at line 45 of file grpcpp/support/channel_arguments.h.

◆ SetChannelArgs()

void grpc::ChannelArguments::SetChannelArgs ( grpc_channel_args channel_args) const

Dump arguments in this instance to channel_args. Does not take ownership of channel_args.

Note that the underlying arguments are shared. Changes made to either channel_args or this instance would be reflected on both.

Definition at line 215 of file channel_arguments.cc.

◆ SetCompressionAlgorithm()

void grpc::ChannelArguments::SetCompressionAlgorithm ( grpc_compression_algorithm  algorithm)

Set the compression algorithm for the channel.

Definition at line 87 of file channel_arguments.cc.

◆ SetGrpclbFallbackTimeout()

void grpc::ChannelArguments::SetGrpclbFallbackTimeout ( int  fallback_timeout)

Set the grpclb fallback timeout (in ms) for the channel. If this amount of time has passed but we have not gotten any non-empty serverlist from the balancer, we will fall back to use the backend address(es) returned by the resolver.

Definition at line 92 of file channel_arguments.cc.

◆ SetInt()

void grpc::ChannelArguments::SetInt ( const std::string &  key,
int  value 
)

Set an integer argument value under key.

Definition at line 174 of file channel_arguments.cc.

◆ SetLoadBalancingPolicyName()

void grpc::ChannelArguments::SetLoadBalancingPolicyName ( const std::string &  lb_policy_name)

Set LB policy name. Note that if the name resolver returns only balancer addresses, the grpclb LB policy will be used, regardless of what is specified here.

Definition at line 164 of file channel_arguments.cc.

◆ SetMaxReceiveMessageSize()

void grpc::ChannelArguments::SetMaxReceiveMessageSize ( int  size)

Set the max receive and send message sizes.

Definition at line 156 of file channel_arguments.cc.

◆ SetMaxSendMessageSize()

void grpc::ChannelArguments::SetMaxSendMessageSize ( int  size)

Definition at line 160 of file channel_arguments.cc.

◆ SetPointer()

void grpc::ChannelArguments::SetPointer ( const std::string &  key,
void *  value 
)

Set a pointer argument value under key. Ownership is not transferred.

Definition at line 184 of file channel_arguments.cc.

◆ SetPointerWithVtable()

void grpc::ChannelArguments::SetPointerWithVtable ( const std::string &  key,
void *  value,
const grpc_arg_pointer_vtable vtable 
)

Set a pointer argument value under key, transferring ownership of value to the ChannelArguments object. The vtable::Delete function is responsible for value cleanup/destruction when called.

Definition at line 191 of file channel_arguments.cc.

◆ SetResourceQuota()

void grpc::ChannelArguments::SetResourceQuota ( const grpc::ResourceQuota resource_quota)

Set the buffer pool to be attached to the constructed channel.

Definition at line 149 of file channel_arguments.cc.

◆ SetServiceConfigJSON()

void grpc::ChannelArguments::SetServiceConfigJSON ( const std::string &  service_config_json)

Set service config in JSON form. Primarily meant for use in unit tests.

Definition at line 169 of file channel_arguments.cc.

◆ SetSocketMutator()

void grpc::ChannelArguments::SetSocketMutator ( grpc_socket_mutator mutator)

Set a mutator for the underlying socket.

Definition at line 96 of file channel_arguments.cc.

◆ SetSslTargetNameOverride()

void grpc::ChannelArguments::SetSslTargetNameOverride ( const std::string &  name)

Set target name override for SSL host name checking. This option should be used with caution in production.

Definition at line 29 of file secure_channel_arguments.cc.

◆ SetString()

void grpc::ChannelArguments::SetString ( const std::string &  key,
const std::string &  value 
)

Set a textual argument value under key.

Definition at line 203 of file channel_arguments.cc.

◆ SetUserAgentPrefix()

void grpc::ChannelArguments::SetUserAgentPrefix ( const std::string &  user_agent_prefix)

Set the string to prepend to the user agent.

Definition at line 124 of file channel_arguments.cc.

◆ Swap()

void grpc::ChannelArguments::Swap ( ChannelArguments other)

Definition at line 82 of file channel_arguments.cc.

Friends And Related Function Documentation

◆ grpc::SecureChannelCredentials

friend class grpc::SecureChannelCredentials
friend

Definition at line 123 of file grpcpp/support/channel_arguments.h.

◆ grpc::testing::ChannelArgumentsTest

Definition at line 124 of file grpcpp/support/channel_arguments.h.

Member Data Documentation

◆ args_

std::vector<grpc_arg> grpc::ChannelArguments::args_
private

Definition at line 140 of file grpcpp/support/channel_arguments.h.

◆ strings_

std::list<std::string> grpc::ChannelArguments::strings_
private

Definition at line 141 of file grpcpp/support/channel_arguments.h.


The documentation for this class was generated from the following files:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:30