Asterisk - The Open Source Telephony Project
18.5.0
|
RBTree functions implementing astobj2 containers. More...
#include "asterisk.h"
#include "asterisk/_private.h"
#include "asterisk/astobj2.h"
#include "asterisk/utils.h"
#include "astobj2_private.h"
#include "astobj2_container_private.h"
Go to the source code of this file.
Data Structures | |
struct | ao2_container_rbtree |
struct | rbtree_node |
struct | rbtree_traversal_state |
struct | rbtree_traversal_state_check |
Enumerations | |
enum | empty_node_direction { GO_LEFT, GO_RIGHT } |
enum | equal_node_bias { BIAS_FIRST, BIAS_EQUAL, BIAS_LAST } |
Variables | |
static const struct ao2_container_methods | v_table_rbtree |
RBTree functions implementing astobj2 containers.
Definition in file astobj2_rbtree.c.
enum empty_node_direction |
Enumerator | |
---|---|
GO_LEFT | |
GO_RIGHT |
Definition at line 105 of file astobj2_rbtree.c.
enum equal_node_bias |
Enumerator | |
---|---|
BIAS_FIRST | Bias search toward first matching node in the container. |
BIAS_EQUAL | Bias search toward any matching node. |
BIAS_LAST | Bias search toward last matching node in the container. |
Definition at line 96 of file astobj2_rbtree.c.
struct ao2_container* __ao2_container_alloc_rbtree | ( | unsigned int | ao2_options, |
unsigned int | container_options, | ||
ao2_sort_fn * | sort_fn, | ||
ao2_callback_fn * | cmp_fn, | ||
const char * | tag, | ||
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
Definition at line 2040 of file astobj2_rbtree.c.
References __ao2_alloc(), __LOG_ERROR, ast_log, container_destruct(), NULL, and rb_ao2_container_init().
Referenced by rb_ao2_alloc_empty_clone().
|
static |
Definition at line 558 of file astobj2_rbtree.c.
References __ao2_container_alloc_rbtree(), __is_ao2_object, ao2_options_get(), and NULL.
|
static |
Initialize a rbtree container.
self | Container to initialize. |
options | Container behaviour options (See enum ao2_container_opts) |
sort_fn | Pointer to a sort function. |
cmp_fn | Pointer to a compare function used by ao2_find. |
Definition at line 2021 of file astobj2_rbtree.c.
References ast_atomic_fetchadd_int(), ao2_container::cmp_fn, NULL, options, ao2_container::sort_fn, and v_table_rbtree.
Referenced by __ao2_container_alloc_rbtree().
|
static |
Definition at line 1680 of file astobj2_rbtree.c.
References ao2_container_count(), ARRAY_LEN, ast_assert, ast_log, rbtree_node::common, FORMAT, FORMAT2, rbtree_node::is_red, rbtree_node::left, LOG_ERROR, NULL, ao2_container_node::obj, OBJ_SEARCH_OBJECT, rbtree_node::parent, rb_node_most_left(), rb_node_next(), rb_node_pre(), and rbtree_node::right.
|
static |
Definition at line 1471 of file astobj2_rbtree.c.
References AO2_CONTAINER_ALLOC_OPT_DUPS_ALLOW, AO2_CONTAINER_ALLOC_OPT_DUPS_MASK, AO2_CONTAINER_ALLOC_OPT_DUPS_OBJ_REJECT, AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT, AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE, ao2_ref, rbtree_traversal_state::arg, BIAS_EQUAL, BIAS_FIRST, BIAS_LAST, rbtree_node::common, rbtree_traversal_state::flags, NULL, ao2_container_node::obj, OBJ_MULTIPLE, OBJ_NODATA, OBJ_ORDER_ASCENDING, OBJ_ORDER_DESCENDING, OBJ_ORDER_MASK, OBJ_ORDER_POST, OBJ_ORDER_PRE, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, OBJ_SEARCH_PARTIAL_KEY, OBJ_UNLINK, rb_find_initial(), rb_node_most_left(), rb_node_most_right(), rb_node_next_full(), rb_node_post(), rb_node_pre(), rb_node_prev_full(), rbtree_node::right, and rbtree_traversal_state::sort_fn.
|
static |
Definition at line 1270 of file astobj2_rbtree.c.
References ao2_ref, rbtree_traversal_state::arg, rbtree_node::common, rbtree_traversal_state::flags, NULL, ao2_container_node::obj, OBJ_ORDER_ASCENDING, OBJ_ORDER_DESCENDING, OBJ_ORDER_MASK, OBJ_ORDER_POST, OBJ_ORDER_PRE, OBJ_SEARCH_MASK, rb_node_next(), rb_node_post(), rb_node_pre(), rb_node_prev(), and rbtree_traversal_state::sort_fn.
|
static |
Definition at line 1022 of file astobj2_rbtree.c.
References AO2_CONTAINER_ALLOC_OPT_DUPS_ALLOW, AO2_CONTAINER_ALLOC_OPT_DUPS_MASK, AO2_CONTAINER_ALLOC_OPT_DUPS_OBJ_REJECT, AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT, AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE, AO2_CONTAINER_ALLOC_OPT_INSERT_BEGIN, AO2_CONTAINER_INSERT_NODE_INSERTED, AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED, AO2_CONTAINER_INSERT_NODE_REJECTED, ao2_ref, ast_assert, BIAS_EQUAL, BIAS_FIRST, BIAS_LAST, rbtree_node::common, GO_LEFT, rbtree_node::is_red, rbtree_node::left, ao2_container_node::obj, OBJ_SEARCH_OBJECT, options, rbtree_node::parent, rb_find_empty_direction(), rb_insert_fixup(), rb_node_most_left(), rb_node_most_right(), rb_node_next_full(), rb_node_prev_full(), rbtree_node::right, and SWAP.
|
static |
Definition at line 1635 of file astobj2_rbtree.c.
References AO2_ITERATOR_DESCENDING, rbtree_node::common, NULL, ao2_container_node::obj, rb_node_most_left(), rb_node_most_right(), rb_node_next_full(), and rb_node_prev_full().
|
static |
Definition at line 904 of file astobj2_rbtree.c.
References __ao2_ref(), AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_NO_REF_DEBUG, ao2_alloc_options, rbtree_node::common, ao2_container_node::my_container, NULL, ao2_container_node::obj, and rb_ao2_node_destructor().
|
static |
Definition at line 838 of file astobj2_rbtree.c.
References __adjust_lock(), __container_unlink_node, ao2_container_check(), AO2_LOCK_REQ_WRLOCK, AO2_UNLINK_NODE_UNLINK_OBJECT, AST_DEVMODE, ast_log, ao2_container_rbtree::common, rbtree_node::common, ao2_container::destroying, is_ao2_object, ao2_container_node::is_linked, LOG_ERROR, ao2_container_node::my_container, ao2_container_node::obj, OBJ_NOLOCK, and rb_delete_node().
Referenced by rb_ao2_new_node().
|
static |
Definition at line 584 of file astobj2_rbtree.c.
References AO2_DEVMODE_STAT, ast_assert, rbtree_node::is_red, rbtree_node::left, NULL, rbtree_node::parent, rb_rotate_left(), rb_rotate_right(), and rbtree_node::right.
Referenced by rb_delete_node().
|
static |
Definition at line 720 of file astobj2_rbtree.c.
References AO2_DEVMODE_STAT, ast_assert, rbtree_node::is_red, rbtree_node::left, NULL, rbtree_node::parent, rb_delete_fixup(), rb_node_most_left(), rbtree_node::right, and SWAP.
Referenced by rb_ao2_node_destructor().
|
static |
Definition at line 355 of file astobj2_rbtree.c.
References BIAS_FIRST, BIAS_LAST, rbtree_node::common, GO_LEFT, GO_RIGHT, rbtree_node::left, ao2_container_node::obj, rbtree_node::parent, rb_node_most_left(), rb_node_most_right(), and rbtree_node::right.
Referenced by rb_ao2_insert_node(), and rb_find_initial().
|
static |
Definition at line 1353 of file astobj2_rbtree.c.
References BIAS_EQUAL, BIAS_FIRST, BIAS_LAST, rbtree_node::common, GO_LEFT, rbtree_node::left, NULL, ao2_container_node::obj, OBJ_SEARCH_MASK, rb_find_empty_direction(), rb_node_next_full(), rb_node_prev_full(), and rbtree_node::right.
Referenced by rb_ao2_find_first().
|
static |
Definition at line 933 of file astobj2_rbtree.c.
References AO2_DEVMODE_STAT, ast_assert, rbtree_node::is_red, rbtree_node::left, NULL, rbtree_node::parent, rb_rotate_left(), rb_rotate_right(), and rbtree_node::right.
Referenced by rb_ao2_insert_node().
|
static |
Definition at line 137 of file astobj2_rbtree.c.
References rbtree_node::left.
Referenced by rb_ao2_destroy(), rb_ao2_find_first(), rb_ao2_insert_node(), rb_ao2_iterator_next(), rb_delete_node(), rb_find_empty_direction(), rb_node_next(), and rb_node_post().
|
static |
Definition at line 155 of file astobj2_rbtree.c.
References rbtree_node::right.
Referenced by rb_ao2_find_first(), rb_ao2_insert_node(), rb_ao2_iterator_next(), rb_find_empty_direction(), and rb_node_prev().
|
static |
Definition at line 174 of file astobj2_rbtree.c.
References rbtree_node::left, NULL, rbtree_node::parent, rb_node_most_left(), and rbtree_node::right.
Referenced by rb_ao2_destroy(), rb_ao2_find_next(), and rb_node_next_full().
|
static |
Definition at line 309 of file astobj2_rbtree.c.
References rbtree_node::common, ao2_container_node::obj, and rb_node_next().
Referenced by rb_ao2_find_first(), rb_ao2_insert_node(), rb_ao2_iterator_next(), and rb_find_initial().
|
static |
Definition at line 264 of file astobj2_rbtree.c.
References rbtree_node::left, NULL, rbtree_node::parent, rb_node_most_left(), and rbtree_node::right.
Referenced by rb_ao2_find_first(), and rb_ao2_find_next().
|
static |
Definition at line 228 of file astobj2_rbtree.c.
References rbtree_node::left, NULL, rbtree_node::parent, and rbtree_node::right.
Referenced by rb_ao2_destroy(), rb_ao2_find_first(), and rb_ao2_find_next().
|
static |
Definition at line 201 of file astobj2_rbtree.c.
References rbtree_node::left, NULL, rbtree_node::parent, rb_node_most_right(), and rbtree_node::right.
Referenced by rb_ao2_find_next(), and rb_node_prev_full().
|
static |
Definition at line 329 of file astobj2_rbtree.c.
References rbtree_node::common, ao2_container_node::obj, and rb_node_prev().
Referenced by rb_ao2_find_first(), rb_ao2_insert_node(), rb_ao2_iterator_next(), and rb_find_initial().
|
static |
< Node's right child.
Definition at line 459 of file astobj2_rbtree.c.
References rbtree_node::left, rbtree_node::parent, and rbtree_node::right.
Referenced by rb_delete_fixup(), and rb_insert_fixup().
|
static |
< Node's left child.
Definition at line 514 of file astobj2_rbtree.c.
References rbtree_node::left, rbtree_node::parent, and rbtree_node::right.
Referenced by rb_delete_fixup(), and rb_insert_fixup().
|
static |
rbtree container virtual method table.
Definition at line 1996 of file astobj2_rbtree.c.
Referenced by rb_ao2_container_init().