18 #ifndef _RTEMS_SCORE_RBTREE_H 19 #define _RTEMS_SCORE_RBTREE_H 150 #define RBTREE_INITIALIZER_EMPTY( name ) \ 151 { NULL, NULL, { NULL, NULL } } 156 #define RBTREE_DEFINE_EMPTY( name ) \ 157 RBTree_Control name = RBTREE_INITIALIZER_EMPTY( name ) 162 #define RBTREE_NODE_INITIALIZER_EMPTY( name ) \ 163 { NULL, { NULL, NULL }, RBT_RED } 168 #define RBTREE_NODE_DEFINE_EMPTY( name ) \ 169 RBTree_Node name = RBTREE_NODE_INITIALIZER_EMPTY( name ) 189 void *starting_address,
299 return the_node->
parent == NULL;
318 return the_rbtree->
root;
332 return the_rbtree->
first[dir];
367 return the_node->
child[RBT_LEFT];
383 return the_node->
child[RBT_RIGHT];
401 return (the_rbtree->
root == NULL);
456 the_rbtree->
root = NULL;
457 the_rbtree->
first[RBT_LEFT] = NULL;
458 the_rbtree->
first[RBT_RIGHT] = NULL;
514 if ( the_node != NULL ) {
RTEMS_INLINE_ROUTINE bool _RBTree_Is_empty(const RBTree_Control *the_rbtree)
Is the RBTree empty.
Definition: rbtree.h:397
RBTree_Color
This enum type defines the colors available for the RBTree Nodes.
Definition: rbtree.h:55
RBTree_Node * _RBTree_Next(const RBTree_Node *node, RBTree_Direction dir)
Returns the in-order next node of a node.
Definition: rbtreenext.c:30
RBTree_Node * parent
This points to the node's parent.
Definition: rbtree.h:77
#define RTEMS_INLINE_ROUTINE
The following (in conjunction with compiler arguments) are used to choose between the use of static i...
Definition: basedefs.h:135
RTEMS_INLINE_ROUTINE RBTree_Node * _RBTree_Root(const RBTree_Control *the_rbtree)
Returns a pointer to root node of the red-black tree.
Definition: rbtree.h:314
RBTree_Node * root
This points to the root node of the RBT.
Definition: rbtree.h:142
RTEMS_INLINE_ROUTINE RBTree_Node * _RBTree_First(const RBTree_Control *the_rbtree, RBTree_Direction dir)
Return pointer to RBTree's first node.
Definition: rbtree.h:327
RBTree_Compare_result(* RBTree_Compare)(const RBTree_Node *first, const RBTree_Node *second)
Compares two red-black tree nodes.
Definition: rbtree.h:114
long RBTree_Compare_result
Integer type for compare results.
Definition: rbtree.h:99
RBTree_Color color
The color of the node.
Definition: rbtree.h:81
RTEMS_INLINE_ROUTINE RBTree_Node * _RBTree_Get(RBTree_Control *the_rbtree, RBTree_Direction dir)
Gets a node with an extremal key value from the red-black tree.
Definition: rbtree.h:507
RTEMS_INLINE_ROUTINE RBTree_Node * _RBTree_Predecessor(const RBTree_Node *node)
Returns the predecessor of a node.
Definition: rbtree.h:469
RBTree_Node * _RBTree_Insert(RBTree_Control *the_rbtree, RBTree_Node *the_node, RBTree_Compare compare, bool is_unique)
Inserts the node into the red-black tree.
Definition: rbtreeinsert.c:88
RTEMS_INLINE_ROUTINE RBTree_Node * _RBTree_Right(const RBTree_Node *the_node)
Return pointer to the right of this node.
Definition: rbtree.h:379
Information Required to Manipulate Physical Addresses.
RBTree_Node * first[2]
This points to the min and max nodes of this RBT.
Definition: rbtree.h:144
RTEMS_INLINE_ROUTINE RBTree_Node * _RBTree_Parent(const RBTree_Node *the_node)
Returns a pointer to the parent of this node.
Definition: rbtree.h:347
RTEMS_INLINE_ROUTINE bool _RBTree_Is_node_off_tree(const RBTree_Node *the_node)
Returns true, if this red-black tree node is off-tree, and false otherwise.
Definition: rbtree.h:295
RTEMS_INLINE_ROUTINE void _RBTree_Set_off_tree(RBTree_Node *the_node)
Sets a red-black tree node as off-tree.
Definition: rbtree.h:279
RBTree_Direction
This type indicates the direction.
Definition: rbtree.h:87
void _RBTree_Initialize(RBTree_Control *the_rbtree, RBTree_Compare compare, void *starting_address, size_t number_nodes, size_t node_size, bool is_unique)
Initialize a RBTree Header.
Definition: rbtree.c:25
RTEMS_INLINE_ROUTINE RBTree_Node * _RBTree_Successor(const RBTree_Node *node)
Returns the successor of a node.
Definition: rbtree.h:483
RTEMS_INLINE_ROUTINE RBTree_Node * _RBTree_Left(const RBTree_Node *the_node)
Return pointer to the left of this node.
Definition: rbtree.h:363
This is used to manage a RBT.
Definition: rbtree.h:138
RBTree_Node * child[2]
child[0] points to the left child, child[1] points to the right child
Definition: rbtree.h:79
RBTree_Node * permanent_null
This points to a NULL.
Definition: rbtree.h:140
RBTree_Node * _RBTree_Find(const RBTree_Control *the_rbtree, const RBTree_Node *the_node, RBTree_Compare compare, bool is_unique)
Tries to find a node for the specified key in the tree.
Definition: rbtreefind.c:22
void _RBTree_Extract(RBTree_Control *the_rbtree, RBTree_Node *the_node)
Extracts (removes) the node from the red-black tree.
Definition: rbtreeextract.c:95
RTEMS_INLINE_ROUTINE bool _RBTree_Is_root(const RBTree_Node *the_node)
Returns true if this node is the root node of a red-black tree, and false otherwise.
Definition: rbtree.h:439
This is used to manage each element (node) which is placed on a RBT.
Definition: rbtree.h:75
RTEMS_INLINE_ROUTINE void _RBTree_Initialize_empty(RBTree_Control *the_rbtree)
Initialize this RBTree as empty.
Definition: rbtree.h:451
RTEMS_INLINE_ROUTINE bool _RBTree_Is_first(const RBTree_Control *the_rbtree, const RBTree_Node *the_node, RBTree_Direction dir)
Is this the first node on the RBTree.
Definition: rbtree.h:415