GRPC Core  18.0.0
Data Structures | Typedefs | Functions
channel_args.h File Reference
#include <grpc/support/port_platform.h>
#include <string>
#include <grpc/grpc.h>
#include "src/core/lib/surface/channel_stack_type.h"

Go to the source code of this file.

Data Structures

struct  grpc_integer_options
 

Typedefs

typedef struct grpc_integer_options grpc_integer_options
 
typedef grpc_channel_args *(* grpc_channel_args_client_channel_creation_mutator) (const char *target, grpc_channel_args *old_args, grpc_channel_stack_type type)
 

Functions

grpc_channel_argsgrpc_channel_args_copy (const grpc_channel_args *src)
 Copy the arguments in src into a new instance. More...
 
grpc_channel_argsgrpc_channel_args_normalize (const grpc_channel_args *src)
 Copy the arguments in src into a new instance, stably sorting keys. More...
 
grpc_channel_argsgrpc_channel_args_copy_and_add (const grpc_channel_args *src, const grpc_arg *to_add, size_t num_to_add)
 Copy the arguments in src and append to_add. More...
 
grpc_channel_argsgrpc_channel_args_copy_and_remove (const grpc_channel_args *src, const char **to_remove, size_t num_to_remove)
 Copies the arguments in src except for those whose keys are in to_remove. More...
 
grpc_channel_argsgrpc_channel_args_copy_and_add_and_remove (const grpc_channel_args *src, const char **to_remove, size_t num_to_remove, const grpc_arg *to_add, size_t num_to_add)
 Copies the arguments from src except for those whose keys are in to_remove and appends the arguments in to_add. More...
 
grpc_channel_argsgrpc_channel_args_union (const grpc_channel_args *a, const grpc_channel_args *b)
 Perform the union of a and b, prioritizing a entries. More...
 
void grpc_channel_args_destroy (grpc_channel_args *a)
 Destroy arguments created by grpc_channel_args_copy. More...
 
void grpc_channel_args_destroy (const grpc_channel_args *a)
 
int grpc_channel_args_compare (const grpc_channel_args *a, const grpc_channel_args *b)
 
const grpc_arggrpc_channel_args_find (const grpc_channel_args *args, const char *name)
 Returns the value of argument name from args, or NULL if not found. More...
 
bool grpc_channel_args_want_minimal_stack (const grpc_channel_args *args)
 
int grpc_channel_arg_get_integer (const grpc_arg *arg, const grpc_integer_options options)
 Returns the value of arg, subject to the constraints in options. More...
 
int grpc_channel_args_find_integer (const grpc_channel_args *args, const char *name, const grpc_integer_options options)
 Similar to the above, but needs to find the arg from args by the name first. More...
 
char * grpc_channel_arg_get_string (const grpc_arg *arg)
 Returns the value of arg if arg is of type GRPC_ARG_STRING. More...
 
char * grpc_channel_args_find_string (const grpc_channel_args *args, const char *name)
 Similar to the above, but needs to find the arg from args by the name first. More...
 
bool grpc_channel_arg_get_bool (const grpc_arg *arg, bool default_value)
 If arg is of type GRPC_ARG_INTEGER, returns true if it's non-zero. More...
 
bool grpc_channel_args_find_bool (const grpc_channel_args *args, const char *name, bool default_value)
 Similar to the above, but needs to find the arg from args by the name first. More...
 
template<typename T >
T * grpc_channel_args_find_pointer (const grpc_channel_args *args, const char *name)
 
grpc_arg grpc_channel_arg_string_create (char *name, char *value)
 
grpc_arg grpc_channel_arg_integer_create (char *name, int value)
 
grpc_arg grpc_channel_arg_pointer_create (char *name, void *value, const grpc_arg_pointer_vtable *vtable)
 
std::string grpc_channel_args_string (const grpc_channel_args *args)
 
void grpc_channel_args_set_client_channel_creation_mutator (grpc_channel_args_client_channel_creation_mutator cb)
 
grpc_channel_args_client_channel_creation_mutator grpc_channel_args_get_client_channel_creation_mutator ()
 

Typedef Documentation

◆ grpc_channel_args_client_channel_creation_mutator

typedef grpc_channel_args*(* grpc_channel_args_client_channel_creation_mutator) (const char *target, grpc_channel_args *old_args, grpc_channel_stack_type type)

◆ grpc_integer_options

Function Documentation

◆ grpc_channel_arg_get_bool()

bool grpc_channel_arg_get_bool ( const grpc_arg arg,
bool  default_value 
)

If arg is of type GRPC_ARG_INTEGER, returns true if it's non-zero.

Returns default_value if arg is of other types.

◆ grpc_channel_arg_get_integer()

int grpc_channel_arg_get_integer ( const grpc_arg arg,
const grpc_integer_options  options 
)

Returns the value of arg, subject to the constraints in options.

◆ grpc_channel_arg_get_string()

char* grpc_channel_arg_get_string ( const grpc_arg arg)

Returns the value of arg if arg is of type GRPC_ARG_STRING.

Otherwise, emits a warning log, and returns nullptr. If arg is nullptr, returns nullptr, and does not emit a warning.

◆ grpc_channel_arg_integer_create()

grpc_arg grpc_channel_arg_integer_create ( char *  name,
int  value 
)

◆ grpc_channel_arg_pointer_create()

grpc_arg grpc_channel_arg_pointer_create ( char *  name,
void *  value,
const grpc_arg_pointer_vtable vtable 
)

◆ grpc_channel_arg_string_create()

grpc_arg grpc_channel_arg_string_create ( char *  name,
char *  value 
)

◆ grpc_channel_args_compare()

int grpc_channel_args_compare ( const grpc_channel_args a,
const grpc_channel_args b 
)

◆ grpc_channel_args_copy()

grpc_channel_args* grpc_channel_args_copy ( const grpc_channel_args src)

Copy the arguments in src into a new instance.

◆ grpc_channel_args_copy_and_add()

grpc_channel_args* grpc_channel_args_copy_and_add ( const grpc_channel_args src,
const grpc_arg to_add,
size_t  num_to_add 
)

Copy the arguments in src and append to_add.

If to_add is NULL, it is equivalent to calling grpc_channel_args_copy.

◆ grpc_channel_args_copy_and_add_and_remove()

grpc_channel_args* grpc_channel_args_copy_and_add_and_remove ( const grpc_channel_args src,
const char **  to_remove,
size_t  num_to_remove,
const grpc_arg to_add,
size_t  num_to_add 
)

Copies the arguments from src except for those whose keys are in to_remove and appends the arguments in to_add.

◆ grpc_channel_args_copy_and_remove()

grpc_channel_args* grpc_channel_args_copy_and_remove ( const grpc_channel_args src,
const char **  to_remove,
size_t  num_to_remove 
)

Copies the arguments in src except for those whose keys are in to_remove.

◆ grpc_channel_args_destroy() [1/2]

void grpc_channel_args_destroy ( const grpc_channel_args a)
inline

◆ grpc_channel_args_destroy() [2/2]

void grpc_channel_args_destroy ( grpc_channel_args a)

Destroy arguments created by grpc_channel_args_copy.

◆ grpc_channel_args_find()

const grpc_arg* grpc_channel_args_find ( const grpc_channel_args args,
const char *  name 
)

Returns the value of argument name from args, or NULL if not found.

◆ grpc_channel_args_find_bool()

bool grpc_channel_args_find_bool ( const grpc_channel_args args,
const char *  name,
bool  default_value 
)

Similar to the above, but needs to find the arg from args by the name first.

◆ grpc_channel_args_find_integer()

int grpc_channel_args_find_integer ( const grpc_channel_args args,
const char *  name,
const grpc_integer_options  options 
)

Similar to the above, but needs to find the arg from args by the name first.

◆ grpc_channel_args_find_pointer()

template<typename T >
T* grpc_channel_args_find_pointer ( const grpc_channel_args args,
const char *  name 
)

◆ grpc_channel_args_find_string()

char* grpc_channel_args_find_string ( const grpc_channel_args args,
const char *  name 
)

Similar to the above, but needs to find the arg from args by the name first.

◆ grpc_channel_args_get_client_channel_creation_mutator()

grpc_channel_args_client_channel_creation_mutator grpc_channel_args_get_client_channel_creation_mutator ( )

◆ grpc_channel_args_normalize()

grpc_channel_args* grpc_channel_args_normalize ( const grpc_channel_args src)

Copy the arguments in src into a new instance, stably sorting keys.

◆ grpc_channel_args_set_client_channel_creation_mutator()

void grpc_channel_args_set_client_channel_creation_mutator ( grpc_channel_args_client_channel_creation_mutator  cb)

◆ grpc_channel_args_string()

std::string grpc_channel_args_string ( const grpc_channel_args args)

◆ grpc_channel_args_union()

grpc_channel_args* grpc_channel_args_union ( const grpc_channel_args a,
const grpc_channel_args b 
)

Perform the union of a and b, prioritizing a entries.

◆ grpc_channel_args_want_minimal_stack()

bool grpc_channel_args_want_minimal_stack ( const grpc_channel_args args)