summaryrefslogtreecommitdiff
path: root/ace/RB_Tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'ace/RB_Tree.h')
-rw-r--r--ace/RB_Tree.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/ace/RB_Tree.h b/ace/RB_Tree.h
index 2450251da8e..22a2a4ef3d6 100644
--- a/ace/RB_Tree.h
+++ b/ace/RB_Tree.h
@@ -387,10 +387,20 @@ public:
/// @deprecated
void clear (void);
+ /// Recursively tests the invariant red-black properties at each
+ /// node of the tree. Returns 0 if invariant holds, else -1.
+ int test_invariant (void);
+
protected:
// = Protected methods. These should only be called with locks held.
+ /// Recursively tests the invariant red-black properties at each
+ /// node of the tree. Returns 0 if invariant holds, else -1.
+ int test_invariant_recurse (ACE_RB_Tree_Node<EXT_ID, INT_ID> * x,
+ int & expected_black_height,
+ int measured_black_height);
+
/// Method for right rotation of the tree about a given node.
void RB_rotate_right (ACE_RB_Tree_Node<EXT_ID, INT_ID> * x);
@@ -398,7 +408,8 @@ protected:
void RB_rotate_left (ACE_RB_Tree_Node<EXT_ID, INT_ID> * x);
/// Method for restoring Red-Black properties after deletion.
- void RB_delete_fixup (ACE_RB_Tree_Node<EXT_ID, INT_ID> * x);
+ void RB_delete_fixup (ACE_RB_Tree_Node<EXT_ID, INT_ID> * x,
+ ACE_RB_Tree_Node<EXT_ID, INT_ID> * parent);
/// Method to find the successor node of the given node in the tree.
ACE_RB_Tree_Node<EXT_ID, INT_ID> *
@@ -482,6 +493,14 @@ protected:
/// destroys it.
int remove_i (ACE_RB_Tree_Node<EXT_ID, INT_ID> *z);
+ /// Recursive function to dump the state of an object.
+ void dump_i (ACE_RB_Tree_Node<EXT_ID, INT_ID> *node) const;
+
+ /// Function to dump node contents. Does nothing in its
+ /// basic form, but template specialization can be used to
+ /// provide definitions for various EXT_ID and INT_ID types.
+ void dump_node_i (ACE_RB_Tree_Node<EXT_ID, INT_ID> &node) const;
+
private:
// = Private members.