#include <IBSTree.h>
Public Member Functions | |
| IBSTree () | |
| ~IBSTree () | |
| int | size () const |
| int | CountMarks () const |
| bool | empty () const |
| void | insert (ITYPE *) |
| void | remove (ITYPE *) |
| int | find (interval_type, set< ITYPE * > &) const |
| int | find (ITYPE *I, set< ITYPE * > &) const |
| void | successor (interval_type X, set< ITYPE * > &) const |
| ITYPE * | successor (interval_type X) const |
| void | clear () |
| void | PrintPreorder () |
Private Types | |
| typedef ITYPE::type | interval_type |
Private Member Functions | |
| void | leftRotate (IBSNode< ITYPE > *) |
| void | rightRotate (IBSNode< ITYPE > *) |
| void | deleteFixup (IBSNode< ITYPE > *) |
| void | removeInterval (IBSNode< ITYPE > *R, ITYPE *range) |
| IBSNode< ITYPE > * | addLeft (ITYPE *I, IBSNode< ITYPE > *R) |
| IBSNode< ITYPE > * | addRight (ITYPE *I, IBSNode< ITYPE > *R) |
| interval_type | rightUp (IBSNode< ITYPE > *R) |
| interval_type | leftUp (IBSNode< ITYPE > *R) |
| void | insertFixup (IBSNode< ITYPE > *x) |
| void | destroy (IBSNode< ITYPE > *) |
| void | findIntervals (interval_type X, IBSNode< ITYPE > *R, set< ITYPE * > &S) const |
| void | findIntervals (ITYPE *I, IBSNode< ITYPE > *R, set< ITYPE * > &S) const |
| void | PrintPreorder (IBSNode< ITYPE > *n) |
| int | height (IBSNode< ITYPE > *n) |
| int | CountMarks (IBSNode< ITYPE > *R) const |
| unsigned | MemUse () const |
Private Attributes | |
| IBSNode< ITYPE > * | nil |
| int | treeSize |
| IBSNode< ITYPE > * | root |
Definition at line 163 of file IBSTree.h.
typedef ITYPE::type Dyninst::IBSTree< ITYPE >::interval_type [private] |
| Dyninst::IBSTree< ITYPE >::IBSTree | ( | ) | [inline] |
public for debugging purposes
Definition at line 226 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::nil, and Dyninst::IBSTree< ITYPE >::root.
| Dyninst::IBSTree< ITYPE >::~IBSTree | ( | ) | [inline] |
Definition at line 233 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::destroy(), Dyninst::IBSTree< ITYPE >::nil, and Dyninst::IBSTree< ITYPE >::root.
| IBSNode< ITYPE > * Dyninst::IBSTree< ITYPE >::addLeft | ( | ITYPE * | I, | |
| IBSNode< ITYPE > * | R | |||
| ) | [inline, private] |
Insertion operations: insert the left or right endpoint of an interval into the tree (may or may not add a node
Definition at line 391 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::equal, Dyninst::IBSNode< ITYPE >::greater, Dyninst::IBSNode< ITYPE >::left, Dyninst::IBSTree< ITYPE >::nil, Dyninst::IBSNode< ITYPE >::parent, Dyninst::IBSNode< ITYPE >::right, Dyninst::IBSTree< ITYPE >::rightUp(), Dyninst::IBSTree< ITYPE >::root, Dyninst::IBSTree< ITYPE >::treeSize, and Dyninst::IBSNode< ITYPE >::value().
Referenced by Dyninst::IBSTree< ITYPE >::insert().
| IBSNode< ITYPE > * Dyninst::IBSTree< ITYPE >::addRight | ( | ITYPE * | I, | |
| IBSNode< ITYPE > * | R | |||
| ) | [inline, private] |
Definition at line 462 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::equal, Dyninst::IBSNode< ITYPE >::left, Dyninst::IBSTree< ITYPE >::leftUp(), Dyninst::IBSNode< ITYPE >::less, Dyninst::IBSTree< ITYPE >::nil, Dyninst::IBSNode< ITYPE >::parent, Dyninst::IBSNode< ITYPE >::right, Dyninst::IBSTree< ITYPE >::root, Dyninst::IBSTree< ITYPE >::treeSize, and Dyninst::IBSNode< ITYPE >::value().
Referenced by Dyninst::IBSTree< ITYPE >::insert().
| void Dyninst::IBSTree< ITYPE >::clear | ( | ) | [inline] |
Delete all entries in the tree
Definition at line 845 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::destroy(), Dyninst::IBSTree< ITYPE >::nil, Dyninst::IBSTree< ITYPE >::root, and Dyninst::IBSTree< ITYPE >::treeSize.
| int Dyninst::IBSTree< ITYPE >::CountMarks | ( | ) | const [inline] |
Definition at line 883 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::root.
Referenced by Dyninst::IBSTree< ITYPE >::CountMarks().
| int Dyninst::IBSTree< ITYPE >::CountMarks | ( | IBSNode< ITYPE > * | R | ) | const [inline, private] |
| void Dyninst::IBSTree< ITYPE >::deleteFixup | ( | IBSNode< ITYPE > * | ) | [private] |
Node deletion
| void Dyninst::IBSTree< ITYPE >::destroy | ( | IBSNode< ITYPE > * | n | ) | [inline, private] |
Finds the precessor of the node; this node will have its value copied to the target node of a deletion and will itself be deleted Find a node with the provided value (interval endpoint) Delete all nodes in the subtree rooted at the parameter
Definition at line 617 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::left, Dyninst::IBSTree< ITYPE >::nil, and Dyninst::IBSNode< ITYPE >::right.
Referenced by Dyninst::IBSTree< ITYPE >::clear(), and Dyninst::IBSTree< ITYPE >::~IBSTree().
| bool Dyninst::IBSTree< ITYPE >::empty | ( | ) | const [inline] |
Definition at line 241 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::nil, and Dyninst::IBSTree< ITYPE >::root.
| int Dyninst::IBSTree< ITYPE >::find | ( | ITYPE * | I, | |
| set< ITYPE * > & | out | |||
| ) | const [inline] |
Definition at line 780 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::findIntervals(), Dyninst::IBSTree< ITYPE >::root, and Dyninst::IBSTree< ITYPE >::size().
| int Dyninst::IBSTree< ITYPE >::find | ( | interval_type | X, | |
| set< ITYPE * > & | out | |||
| ) | const [inline] |
Find all intervals that overlap the provided point. Returns the number of intervals found
Definition at line 772 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::findIntervals(), Dyninst::IBSTree< ITYPE >::root, and Dyninst::IBSTree< ITYPE >::size().
| void Dyninst::IBSTree< ITYPE >::findIntervals | ( | ITYPE * | I, | |
| IBSNode< ITYPE > * | R, | |||
| set< ITYPE * > & | S | |||
| ) | const [inline, private] |
Definition at line 664 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::equal, Dyninst::IBSTree< ITYPE >::findIntervals(), Dyninst::IBSNode< ITYPE >::greater, Dyninst::IBSNode< ITYPE >::left, Dyninst::IBSNode< ITYPE >::less, Dyninst::IBSTree< ITYPE >::nil, Dyninst::IBSNode< ITYPE >::right, and Dyninst::IBSNode< ITYPE >::value().
| void Dyninst::IBSTree< ITYPE >::findIntervals | ( | interval_type | X, | |
| IBSNode< ITYPE > * | R, | |||
| set< ITYPE * > & | S | |||
| ) | const [inline, private] |
Definition at line 636 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::equal, Dyninst::IBSNode< ITYPE >::greater, Dyninst::IBSNode< ITYPE >::left, Dyninst::IBSNode< ITYPE >::less, Dyninst::IBSTree< ITYPE >::nil, Dyninst::IBSNode< ITYPE >::right, and Dyninst::IBSNode< ITYPE >::value().
Referenced by Dyninst::IBSTree< ITYPE >::find(), and Dyninst::IBSTree< ITYPE >::findIntervals().
| int Dyninst::IBSTree< ITYPE >::height | ( | IBSNode< ITYPE > * | n | ) | [inline, private] |
Definition at line 853 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::left, and Dyninst::IBSNode< ITYPE >::right.
Referenced by Dyninst::IBSTree< ITYPE >::PrintPreorder().
| void Dyninst::IBSTree< ITYPE >::insert | ( | ITYPE * | range | ) | [inline] |
Definition at line 729 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::addLeft(), Dyninst::IBSTree< ITYPE >::addRight(), Dyninst::IBSTree< ITYPE >::insertFixup(), and Dyninst::IBSTree< ITYPE >::root.
| void Dyninst::IBSTree< ITYPE >::insertFixup | ( | IBSNode< ITYPE > * | x | ) | [inline, private] |
Tree-balancing algorithm on insertion
Definition at line 572 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::color, Dyninst::IBSTree< ITYPE >::leftRotate(), Dyninst::IBSNode< ITYPE >::parent, Dyninst::IBSTree< ITYPE >::rightRotate(), Dyninst::IBSTree< ITYPE >::root, Dyninst::IBS::TREE_BLACK, and Dyninst::IBS::TREE_RED.
Referenced by Dyninst::IBSTree< ITYPE >::insert().
| void Dyninst::IBSTree< ITYPE >::leftRotate | ( | IBSNode< ITYPE > * | pivot | ) | [inline, private] |
RB-tree left rotation with modification to enforce IBS invariants
Definition at line 332 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::equal, Dyninst::IBSNode< ITYPE >::greater, Dyninst::IBSNode< ITYPE >::left, Dyninst::IBSNode< ITYPE >::less, Dyninst::IBSTree< ITYPE >::nil, Dyninst::IBSNode< ITYPE >::parent, Dyninst::IBSNode< ITYPE >::right, and Dyninst::IBSTree< ITYPE >::root.
Referenced by Dyninst::IBSTree< ITYPE >::insertFixup().
| ITYPE::type Dyninst::IBSTree< ITYPE >::leftUp | ( | IBSNode< ITYPE > * | R | ) | [inline, private] |
Symmetric to rightUp
Definition at line 559 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::parent.
Referenced by Dyninst::IBSTree< ITYPE >::addRight().
| unsigned Dyninst::IBSTree< ITYPE >::MemUse | ( | ) | const [private] |
| void Dyninst::IBSTree< ITYPE >::PrintPreorder | ( | ) | [inline] |
Definition at line 261 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::PrintPreorder(), and Dyninst::IBSTree< ITYPE >::root.
Referenced by Dyninst::IBSTree< ITYPE >::PrintPreorder().
| void Dyninst::IBSTree< ITYPE >::PrintPreorder | ( | IBSNode< ITYPE > * | n | ) | [inline, private] |
Definition at line 868 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::height(), Dyninst::IBSNode< ITYPE >::left, Dyninst::IBSTree< ITYPE >::nil, Dyninst::IBSTree< ITYPE >::PrintPreorder(), Dyninst::IBSNode< ITYPE >::right, Dyninst::IBSTree< ITYPE >::root, and Dyninst::IBSNode< ITYPE >::value().
| void Dyninst::IBSTree< ITYPE >::remove | ( | ITYPE * | range | ) | [inline] |
Definition at line 748 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::removeInterval(), and Dyninst::IBSTree< ITYPE >::root.
| void Dyninst::IBSTree< ITYPE >::removeInterval | ( | IBSNode< ITYPE > * | R, | |
| ITYPE * | range | |||
| ) | [inline, private] |
Definition at line 690 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::equal, Dyninst::IBSNode< ITYPE >::greater, Dyninst::IBSNode< ITYPE >::left, Dyninst::IBSNode< ITYPE >::less, Dyninst::IBSTree< ITYPE >::nil, Dyninst::IBSNode< ITYPE >::right, and Dyninst::IBSNode< ITYPE >::value().
Referenced by Dyninst::IBSTree< ITYPE >::remove().
| void Dyninst::IBSTree< ITYPE >::rightRotate | ( | IBSNode< ITYPE > * | pivot | ) | [inline, private] |
RB-tree right rotation with modification to enforce IBS invariants
Definition at line 265 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::equal, Dyninst::IBSNode< ITYPE >::greater, Dyninst::IBSNode< ITYPE >::left, Dyninst::IBSNode< ITYPE >::less, Dyninst::IBSTree< ITYPE >::nil, Dyninst::IBSNode< ITYPE >::parent, Dyninst::IBSNode< ITYPE >::right, and Dyninst::IBSTree< ITYPE >::root.
Referenced by Dyninst::IBSTree< ITYPE >::insertFixup().
| ITYPE::type Dyninst::IBSTree< ITYPE >::rightUp | ( | IBSNode< ITYPE > * | R | ) | [inline, private] |
Find the lowest valued ancestor of node R that has R in its left subtree -- used in addLeft to determine whether all of the values in R's right subtree are covered by an interval
Definition at line 545 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::parent.
Referenced by Dyninst::IBSTree< ITYPE >::addLeft().
| int Dyninst::IBSTree< ITYPE >::size | ( | ) | const [inline] |
Definition at line 238 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::treeSize.
Referenced by Dyninst::IBSTree< ITYPE >::find().
| ITYPE * Dyninst::IBSTree< ITYPE >::successor | ( | interval_type | X | ) | const [inline] |
Use only when no two intervals share the same lower bound
Definition at line 833 of file IBSTree.h.
References Dyninst::IBSTree< ITYPE >::successor().
| void Dyninst::IBSTree< ITYPE >::successor | ( | interval_type | X, | |
| set< ITYPE * > & | out | |||
| ) | const [inline] |
Finds the very next interval(s) with left endpoint = supremum(X)
Definition at line 788 of file IBSTree.h.
References Dyninst::IBSNode< ITYPE >::equal, Dyninst::IBSNode< ITYPE >::left, Dyninst::IBSTree< ITYPE >::nil, Dyninst::IBSNode< ITYPE >::right, Dyninst::IBSTree< ITYPE >::root, and Dyninst::IBSNode< ITYPE >::value().
Referenced by Dyninst::IBSTree< ITYPE >::successor().
IBSNode<ITYPE>* Dyninst::IBSTree< ITYPE >::nil [private] |
Definition at line 166 of file IBSTree.h.
Referenced by Dyninst::IBSTree< ITYPE >::addLeft(), Dyninst::IBSTree< ITYPE >::addRight(), Dyninst::IBSTree< ITYPE >::clear(), Dyninst::IBSTree< ITYPE >::CountMarks(), Dyninst::IBSTree< ITYPE >::destroy(), Dyninst::IBSTree< ITYPE >::empty(), Dyninst::IBSTree< ITYPE >::findIntervals(), Dyninst::IBSTree< ITYPE >::IBSTree(), Dyninst::IBSTree< ITYPE >::leftRotate(), Dyninst::IBSTree< ITYPE >::PrintPreorder(), Dyninst::IBSTree< ITYPE >::removeInterval(), Dyninst::IBSTree< ITYPE >::rightRotate(), Dyninst::IBSTree< ITYPE >::successor(), and Dyninst::IBSTree< ITYPE >::~IBSTree().
IBSNode<ITYPE>* Dyninst::IBSTree< ITYPE >::root [private] |
pointer to the tree root
Definition at line 172 of file IBSTree.h.
Referenced by Dyninst::IBSTree< ITYPE >::addLeft(), Dyninst::IBSTree< ITYPE >::addRight(), Dyninst::IBSTree< ITYPE >::clear(), Dyninst::IBSTree< ITYPE >::CountMarks(), Dyninst::IBSTree< ITYPE >::empty(), Dyninst::IBSTree< ITYPE >::find(), Dyninst::IBSTree< ITYPE >::IBSTree(), Dyninst::IBSTree< ITYPE >::insert(), Dyninst::IBSTree< ITYPE >::insertFixup(), Dyninst::IBSTree< ITYPE >::leftRotate(), Dyninst::IBSTree< ITYPE >::PrintPreorder(), Dyninst::IBSTree< ITYPE >::remove(), Dyninst::IBSTree< ITYPE >::rightRotate(), Dyninst::IBSTree< ITYPE >::successor(), and Dyninst::IBSTree< ITYPE >::~IBSTree().
int Dyninst::IBSTree< ITYPE >::treeSize [private] |
size of tree
Definition at line 169 of file IBSTree.h.
Referenced by Dyninst::IBSTree< ITYPE >::addLeft(), Dyninst::IBSTree< ITYPE >::addRight(), Dyninst::IBSTree< ITYPE >::clear(), and Dyninst::IBSTree< ITYPE >::size().
1.6.1