Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
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 2022 of file astobj2_rbtree.c.
References __ao2_alloc(), __LOG_ERROR, ast_log, container_destruct(), make_ari_stubs::file, NULL, and rb_ao2_container_init().
Referenced by rb_ao2_alloc_empty_clone().
|
static |
Definition at line 554 of file astobj2_rbtree.c.
References __ao2_container_alloc_rbtree(), __is_ao2_object, ao2_options_get(), ao2_container::cmp_fn, ao2_container_rbtree::common, make_ari_stubs::file, NULL, ao2_container::options, and ao2_container::sort_fn.
|
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 2003 of file astobj2_rbtree.c.
References ast_atomic_fetchadd_int(), ao2_container::cmp_fn, ao2_container_rbtree::common, NULL, ao2_container::options, options, ao2_container::sort_fn, ao2_container::v_table, and v_table_rbtree.
Referenced by __ao2_container_alloc_rbtree().
|
static |
Definition at line 1666 of file astobj2_rbtree.c.
References ast_assert, ast_log, LOG_ERROR, and ao2_container_rbtree::root.
|
static |
Definition at line 1459 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, BIAS_EQUAL, BIAS_FIRST, BIAS_LAST, ao2_container_rbtree::common, ao2_container::destroying, NULL, 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, ao2_container::options, 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(), ao2_container_rbtree::root, and ao2_container::sort_fn.
|
static |
Definition at line 1258 of file astobj2_rbtree.c.
References ao2_ref, NULL, 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(), and rb_node_prev().
|
static |
Definition at line 1010 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, ao2_container_rbtree::common, GO_LEFT, rbtree_node::left, ao2_container_node::obj, OBJ_SEARCH_OBJECT, ao2_container::options, options, 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, ao2_container_rbtree::root, ao2_container::sort_fn, and SWAP.
|
static |
Definition at line 1623 of file astobj2_rbtree.c.
References AO2_ITERATOR_DESCENDING, NULL, rb_node_most_left(), rb_node_most_right(), rb_node_next_full(), rb_node_prev_full(), and ao2_container_rbtree::root.
|
static |
Definition at line 894 of file astobj2_rbtree.c.
References __ao2_ref(), AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_NO_REF_DEBUG, ao2_alloc_options, make_ari_stubs::file, NULL, and rb_ao2_node_destructor().
|
static |
Definition at line 828 of file astobj2_rbtree.c.
References __adjust_lock(), __container_unlink_node, ao2_container_check(), AO2_LOCK_REQ_WRLOCK, AO2_UNLINK_NODE_UNLINK_OBJECT, ast_log, rbtree_node::common, ao2_container_rbtree::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 578 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(), rbtree_node::right, and ao2_container_rbtree::root.
Referenced by rb_delete_node().
|
static |
Definition at line 712 of file astobj2_rbtree.c.
References AO2_DEVMODE_STAT, ast_assert, ao2_container_rbtree::common, ao2_container::destroying, rbtree_node::is_red, rbtree_node::left, NULL, rbtree_node::parent, rb_delete_fixup(), rb_node_most_left(), rbtree_node::right, ao2_container_rbtree::root, 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 1341 of file astobj2_rbtree.c.
References BIAS_EQUAL, BIAS_FIRST, BIAS_LAST, rbtree_node::common, ao2_container_rbtree::common, GO_LEFT, NULL, ao2_container_node::obj, OBJ_SEARCH_MASK, rb_find_empty_direction(), rb_node_next_full(), rb_node_prev_full(), ao2_container_rbtree::root, and ao2_container::sort_fn.
Referenced by rb_ao2_find_first().
|
static |
Definition at line 921 of file astobj2_rbtree.c.
References AO2_DEVMODE_STAT, ast_assert, rbtree_node::is_red, rbtree_node::left, NULL, rb_rotate_left(), rb_rotate_right(), rbtree_node::right, and ao2_container_rbtree::root.
Referenced by rb_ao2_insert_node().
|
static |
Definition at line 137 of file astobj2_rbtree.c.
Referenced by 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.
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 NULL, and rb_node_most_left().
Referenced by rb_ao2_find_next(), and rb_node_next_full().
|
static |
Definition at line 309 of file astobj2_rbtree.c.
References 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 NULL, and rb_node_most_left().
Referenced by rb_ao2_find_first(), and rb_ao2_find_next().
|
static |
Definition at line 228 of file astobj2_rbtree.c.
References NULL.
Referenced by rb_ao2_find_first(), and rb_ao2_find_next().
|
static |
Definition at line 201 of file astobj2_rbtree.c.
References NULL, and rb_node_most_right().
Referenced by rb_ao2_find_next(), and rb_node_prev_full().
|
static |
Definition at line 329 of file astobj2_rbtree.c.
References 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 457 of file astobj2_rbtree.c.
References rbtree_node::left, rbtree_node::parent, and ao2_container_rbtree::root.
Referenced by rb_delete_fixup(), and rb_insert_fixup().
|
static |
< Node's left child.
Definition at line 510 of file astobj2_rbtree.c.
References rbtree_node::parent, rbtree_node::right, and ao2_container_rbtree::root.
Referenced by rb_delete_fixup(), and rb_insert_fixup().
|
static |
rbtree container virtual method table.
Definition at line 1978 of file astobj2_rbtree.c.
Referenced by rb_ao2_container_init().