22 #ifndef _RTEMS_SCORE_RBTREEIMPL_H 23 #define _RTEMS_SCORE_RBTREEIMPL_H 106 return (the_node && the_node->
color == RBT_RED);
126 return the_node == left_child ? parent->
child[ RBT_RIGHT ] : left_child;
133 return compare_result == 0;
140 return compare_result > 0;
147 return compare_result < 0;
193 grandchild = child->
child[ dir ];
194 the_node->
child[ opp_dir ] = grandchild;
196 if ( grandchild != NULL )
197 grandchild->
parent = the_node;
199 child->
child[ dir ] = the_node;
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(const RBTree_Node *the_node)
Is this node red.
Definition: rbtreeimpl.h:102
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 void _RBTree_Rotate(RBTree_Node *the_node, RBTree_Direction dir)
Rotates the node in the specified direction.
Definition: rbtreeimpl.h:180
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(RBTree_Direction the_dir)
Get the direction opposite to the_dir.
Definition: rbtreeimpl.h:72
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
Constants and Structures Associated with the Red-Black Tree Handler.
RTEMS_INLINE_ROUTINE RBTree_Node * _RBTree_Sibling(const RBTree_Node *the_node, const RBTree_Node *parent)
Returns the sibling of the node.
Definition: rbtreeimpl.h:119
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 RBTree_Direction _RBTree_Direction(const RBTree_Node *the_node, const RBTree_Node *parent)
Returns the direction of the node.
Definition: rbtreeimpl.h:86
RBTree_Direction
This type indicates the direction.
Definition: rbtree.h:87
bool(* RBTree_Visitor)(const RBTree_Node *node, RBTree_Direction dir, void *visitor_arg)
Red-black tree visitor.
Definition: rbtreeimpl.h:48
void _RBTree_Iterate(const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg)
Red-black tree iteration.
Definition: rbtreeiterate.c:29
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
This is used to manage each element (node) which is placed on a RBT.
Definition: rbtree.h:75