36#ifndef _RTEMS_RBTREE_H
37#define _RTEMS_RBTREE_H
104#define RTEMS_RBTREE_INITIALIZER_EMPTY(name) \
105 RBTREE_INITIALIZER_EMPTY(name)
110#define RTEMS_RBTREE_DEFINE_EMPTY(name) \
111 RBTREE_DEFINE_EMPTY(name)
131 void *starting_address,
142static inline void rtems_rbtree_initialize_empty(
146 _RBTree_Initialize_empty( the_rbtree );
155static inline void rtems_rbtree_set_off_tree(
159 _RBTree_Set_off_tree( node );
168static inline bool rtems_rbtree_is_node_off_tree(
172 return _RBTree_Is_node_off_tree( node );
184 return _RBTree_Root( the_rbtree );
216 return _RBTree_Left( the_node );
228 return _RBTree_Right( the_node );
238 return _RBTree_Parent( the_node );
247static inline bool rtems_rbtree_is_empty(
251 return _RBTree_Is_empty( the_rbtree );
260static inline bool rtems_rbtree_is_min(
265 return rtems_rbtree_min( the_rbtree ) == the_node;
274static inline bool rtems_rbtree_is_max(
279 return rtems_rbtree_max( the_rbtree ) == the_node;
285static inline bool rtems_rbtree_is_root(
289 return _RBTree_Is_root( the_node );
292static inline bool rtems_rbtree_is_equal(
296 return compare_result == 0;
299static inline bool rtems_rbtree_is_greater(
303 return compare_result > 0;
306static inline bool rtems_rbtree_is_lesser(
310 return compare_result < 0;
357static inline void rtems_rbtree_extract(
383 if ( the_node !=
NULL ) {
384 rtems_rbtree_extract( the_rbtree, the_node );
408 if ( the_node !=
NULL ) {
409 rtems_rbtree_extract( the_rbtree, the_node );
426 return rtems_rbtree_min( the_rbtree );
440 return rtems_rbtree_max( the_rbtree );
460 RBTree_Control *the_rbtree,
RBTree_Control rtems_rbtree_control
Definition: rbtree.h:72
rtems_rbtree_compare_result(* rtems_rbtree_compare)(const RBTree_Node *first, const RBTree_Node *second)
Compares two red-black tree nodes.
Definition: rbtree.h:96
void rtems_rbtree_initialize(rtems_rbtree_control *the_rbtree, rtems_rbtree_compare compare, void *starting_address, size_t number_nodes, size_t node_size, bool is_unique)
Initialize a RBTree header.
Definition: rbtree.c:44
rtems_rbtree_node * rtems_rbtree_find(const rtems_rbtree_control *the_rbtree, const rtems_rbtree_node *the_node, rtems_rbtree_compare compare, bool is_unique)
Tries to find a node for the specified key in the tree.
Definition: rbtreefind.c:43
rtems_rbtree_node * rtems_rbtree_insert(RBTree_Control *the_rbtree, RBTree_Node *the_node, rtems_rbtree_compare compare, bool is_unique)
Inserts the node into the red-black tree.
Definition: sapirbtreeinsert.c:53
RBTree_Node rtems_rbtree_node
Definition: rbtree.h:65
long rtems_rbtree_compare_result
Integer type for compare results.
Definition: rbtree.h:81
RBTree_Node * _RBTree_Predecessor(const RBTree_Node *node)
Returns the predecessor of a node.
Definition: rbtreeprev.c:46
void _RBTree_Extract(RBTree_Control *the_rbtree, RBTree_Node *the_node)
Extracts (removes) the node from the red-black tree.
Definition: rbtreeextract.c:63
RBTree_Node * _RBTree_Maximum(const RBTree_Control *the_rbtree)
Returns the maximum node of the red-black tree.
Definition: rbtreemax.c:43
RBTree_Node * _RBTree_Successor(const RBTree_Node *node)
Returns the successor of a node.
Definition: rbtreenext.c:47
RBTree_Node * _RBTree_Minimum(const RBTree_Control *the_rbtree)
Returns the minimum node of the red-black tree.
Definition: rbtreemin.c:43
#define NULL
Requests a GPIO pin group configuration.
Definition: xil_types.h:54
This header file provides interfaces of the Red-Black Tree Handler which are used by the implementati...
Red-black tree node.
Definition: rbtree.h:73