19 #ifndef GRPC_SUPPORT_AVL_H
20 #define GRPC_SUPPORT_AVL_H
47 void* (*copy_key)(
void* key,
void* user_data);
54 void* (*copy_value)(
void* value,
void* user_data);
vtable for the AVL tree The optional user_data is propagated from the top level gpr_avl_XXX API...
Definition: avl.h:43
struct gpr_avl_node * right
Definition: avl.h:34
void(* destroy_key)(void *key, void *user_data)
destroy a key
Definition: avl.h:45
Definition: sync_generic.h:34
GPRAPI int gpr_avl_is_empty(gpr_avl avl)
Return 1 if avl is empty, 0 otherwise.
GPRAPI gpr_avl gpr_avl_ref(gpr_avl avl, void *user_data)
Add a reference to an existing tree - returns the tree as a convenience.
GPRAPI gpr_avl gpr_avl_remove(gpr_avl avl, void *key, void *user_data)
Return a new tree with key deleted implicitly unrefs avl to allow easy chaining.
"pointer" to an AVL tree - this is a reference counted object - use gpr_avl_ref to add a reference...
Definition: avl.h:60
GPRAPI gpr_avl gpr_avl_add(gpr_avl avl, void *key, void *value, void *user_data)
Return a new tree with (key, value) added to avl.
long(* compare_keys)(void *key1, void *key2, void *user_data)
compare key1, key2; return <0 if key1 < key2, >0 if key1 > key2, 0 if key1 == key2 ...
Definition: avl.h:50
void * value
Definition: avl.h:32
GPRAPI void gpr_avl_unref(gpr_avl avl, void *user_data)
Remove a reference to a tree - destroying it if there are no references left.
GPRAPI gpr_avl gpr_avl_create(const gpr_avl_vtable *vtable)
Create an immutable AVL tree.
struct gpr_avl gpr_avl
"pointer" to an AVL tree - this is a reference counted object - use gpr_avl_ref to add a reference...
struct gpr_avl_vtable gpr_avl_vtable
vtable for the AVL tree The optional user_data is propagated from the top level gpr_avl_XXX API...
gpr_refcount refs
Definition: avl.h:30
gpr_avl_node * root
Definition: avl.h:62
long height
Definition: avl.h:35
GPRAPI int gpr_avl_maybe_get(gpr_avl avl, void *key, void **value, void *user_data)
Return 1 if avl contains key, 0 otherwise; if it has the key, sets *value to its value.
void(* destroy_value)(void *value, void *user_data)
destroy a value
Definition: avl.h:52
const gpr_avl_vtable * vtable
Definition: avl.h:61
struct gpr_avl_node gpr_avl_node
internal node of an AVL tree
void * key
Definition: avl.h:31
internal node of an AVL tree
Definition: avl.h:29
struct gpr_avl_node * left
Definition: avl.h:33
GPRAPI void * gpr_avl_get(gpr_avl avl, void *key, void *user_data)
Lookup key, and return the associated value.