Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
303de0ae
Commit
303de0ae
authored
7 years ago
by
yang-g
Browse files
Options
Downloads
Patches
Plain Diff
update comments
parent
1a489070
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/grpc/support/avl.h
+18
-13
18 additions, 13 deletions
include/grpc/support/avl.h
with
18 additions
and
13 deletions
include/grpc/support/avl.h
+
18
−
13
View file @
303de0ae
...
@@ -58,29 +58,34 @@ typedef struct gpr_avl {
...
@@ -58,29 +58,34 @@ typedef struct gpr_avl {
gpr_avl_node
*
root
;
gpr_avl_node
*
root
;
}
gpr_avl
;
}
gpr_avl
;
/**
c
reate an immutable AVL tree */
/**
C
reate an immutable AVL tree
.
*/
GPRAPI
gpr_avl
gpr_avl_create
(
const
gpr_avl_vtable
*
vtable
);
GPRAPI
gpr_avl
gpr_avl_create
(
const
gpr_avl_vtable
*
vtable
);
/** add a reference to an existing tree - returns
/** Add a reference to an existing tree - returns
the tree as a convenience */
the tree as a convenience. The optional user_data will be passed to vtable
functions. */
GPRAPI
gpr_avl
gpr_avl_ref
(
gpr_avl
avl
,
void
*
user_data
);
GPRAPI
gpr_avl
gpr_avl_ref
(
gpr_avl
avl
,
void
*
user_data
);
/** remove a reference to a tree - destroying it if there
/** Remove a reference to a tree - destroying it if there
are no references left */
are no references left. The optional user_data will be passed to vtable
functions. */
GPRAPI
void
gpr_avl_unref
(
gpr_avl
avl
,
void
*
user_data
);
GPRAPI
void
gpr_avl_unref
(
gpr_avl
avl
,
void
*
user_data
);
/**
r
eturn a new tree with (key, value) added to avl.
/**
R
eturn a new tree with (key, value) added to avl.
implicitly unrefs avl to allow easy chaining.
implicitly unrefs avl to allow easy chaining.
if key exists in avl, the new tree's key entry updated
if key exists in avl, the new tree's key entry updated
(i.e. a duplicate is not created) */
(i.e. a duplicate is not created). The optional user_data will be passed to
vtable functions. */
GPRAPI
gpr_avl
gpr_avl_add
(
gpr_avl
avl
,
void
*
key
,
void
*
value
,
GPRAPI
gpr_avl
gpr_avl_add
(
gpr_avl
avl
,
void
*
key
,
void
*
value
,
void
*
user_data
);
void
*
user_data
);
/** return a new tree with key deleted
/** Return a new tree with key deleted
implicitly unrefs avl to allow easy chaining. */
implicitly unrefs avl to allow easy chaining. The optional user_data will be
passed to vtable functions. */
GPRAPI
gpr_avl
gpr_avl_remove
(
gpr_avl
avl
,
void
*
key
,
void
*
user_data
);
GPRAPI
gpr_avl
gpr_avl_remove
(
gpr_avl
avl
,
void
*
key
,
void
*
user_data
);
/** lookup key, and return the associated value.
/** Lookup key, and return the associated value.
does not mutate avl.
Does not mutate avl.
returns NULL if key is not found. */
Returns NULL if key is not found. The optional user_data will be passed to
vtable functions.*/
GPRAPI
void
*
gpr_avl_get
(
gpr_avl
avl
,
void
*
key
,
void
*
user_data
);
GPRAPI
void
*
gpr_avl_get
(
gpr_avl
avl
,
void
*
key
,
void
*
user_data
);
/** Return 1 if avl contains key, 0 otherwise; if it has the key, sets *value to
/** Return 1 if avl contains key, 0 otherwise; if it has the key, sets *value to
its value*/
its value
. THe optional user_data will be passed to vtable functions.
*/
GPRAPI
int
gpr_avl_maybe_get
(
gpr_avl
avl
,
void
*
key
,
void
**
value
,
GPRAPI
int
gpr_avl_maybe_get
(
gpr_avl
avl
,
void
*
key
,
void
**
value
,
void
*
user_data
);
void
*
user_data
);
/** Return 1 if avl is empty, 0 otherwise */
/** Return 1 if avl is empty, 0 otherwise */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment