LLVM API Documentation
#include <ImmutableSet.h>
Public Types | |
typedef ImutInfo::key_type_ref | key_type_ref |
typedef ImutInfo::value_type | value_type |
typedef ImutInfo::value_type_ref | value_type_ref |
typedef ImutAVLFactory< ImutInfo > | Factory |
typedef ImutAVLTreeInOrderIterator < ImutInfo > | iterator |
Public Member Functions | |
ImutAVLTree * | getLeft () const |
ImutAVLTree * | getRight () const |
unsigned | getHeight () const |
const value_type & | getValue () const |
getValue - Returns the data value associated with the tree node. More... | |
ImutAVLTree * | find (key_type_ref K) |
ImutAVLTree * | getMaxElement () |
unsigned | size () const |
iterator | begin () const |
iterator | end () const |
bool | isElementEqual (value_type_ref V) const |
bool | isElementEqual (const ImutAVLTree *RHS) const |
bool | isEqual (const ImutAVLTree &RHS) const |
bool | isNotEqual (const ImutAVLTree &RHS) const |
bool | contains (key_type_ref K) |
template<typename Callback > | |
void | foreach (Callback &C) |
unsigned | validateTree () const |
void | retain () |
void | release () |
void | destroy () |
Friends | |
class | ImutAVLFactory< ImutInfo > |
class | ImutIntervalAVLFactory< ImutInfo > |
class | ImutAVLTreeGenericIterator< ImutInfo > |
Definition at line 38 of file ImmutableSet.h.
typedef ImutAVLFactory<ImutInfo> llvm::ImutAVLTree< ImutInfo >::Factory |
Definition at line 44 of file ImmutableSet.h.
typedef ImutAVLTreeInOrderIterator<ImutInfo> llvm::ImutAVLTree< ImutInfo >::iterator |
Definition at line 50 of file ImmutableSet.h.
typedef ImutInfo::key_type_ref llvm::ImutAVLTree< ImutInfo >::key_type_ref |
Definition at line 40 of file ImmutableSet.h.
typedef ImutInfo::value_type llvm::ImutAVLTree< ImutInfo >::value_type |
Definition at line 41 of file ImmutableSet.h.
typedef ImutInfo::value_type_ref llvm::ImutAVLTree< ImutInfo >::value_type_ref |
Definition at line 42 of file ImmutableSet.h.
|
inline |
begin - Returns an iterator that iterates over the nodes of the tree in an inorder traversal. The returned iterator thus refers to the the tree node with the minimum data element.
Definition at line 110 of file ImmutableSet.h.
Referenced by llvm::ImutAVLFactory< ImutInfo >::compareTreeWithSection(), and llvm::ImutAVLTree< ImutInfo >::isEqual().
|
inline |
contains - Returns true if this tree contains a subtree (node) that has an data element that matches the specified key. Complexity is logarithmic in the size of the tree.
Definition at line 168 of file ImmutableSet.h.
References llvm::ImutAVLTree< ImutInfo >::find().
Referenced by llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::contains(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::contains(), llvm::ImmutableSet< ValT, ValInfo >::contains(), and llvm::ImmutableSetRef< ValT, ValInfo >::contains().
|
inline |
Definition at line 337 of file ImmutableSet.h.
References llvm::ImutAVLFactory< ImutInfo >::maskCacheIndex(), llvm::next(), and llvm::ImutAVLTree< ImutInfo >::release().
Referenced by llvm::ImutAVLFactory< ImutInfo >::getCanonicalTree(), llvm::ImutAVLFactory< ImutInfo >::recoverNodes(), and llvm::ImutAVLTree< ImutInfo >::release().
|
inline |
end - Returns an iterator for the tree that denotes the end of an inorder traversal.
Definition at line 114 of file ImmutableSet.h.
Referenced by llvm::ImutAVLFactory< ImutInfo >::compareTreeWithSection(), and llvm::ImutAVLTree< ImutInfo >::isEqual().
|
inline |
find - Finds the subtree associated with the specified key value. This method returns NULL if no matching subtree is found.
Definition at line 73 of file ImmutableSet.h.
References llvm::ImutAVLTree< ImutInfo >::getLeft(), llvm::ImutAVLTree< ImutInfo >::getRight(), and llvm::ImutAVLTree< ImutInfo >::getValue().
Referenced by llvm::ImutAVLTree< ImutInfo >::contains(), llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::lookup(), and llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::lookup().
|
inline |
foreach - A member template the accepts invokes operator() on a functor object (specifed by Callback) for every node/subtree in the tree. Nodes are visited using an inorder traversal.
Definition at line 174 of file ImmutableSet.h.
References llvm::CallingConv::C, llvm::ImutAVLTree< ImutInfo >::getLeft(), and llvm::ImutAVLTree< ImutInfo >::getRight().
Referenced by llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::foreach(), and llvm::ImmutableSet< ValT, ValInfo >::foreach().
|
inline |
getHeight - Returns the height of the tree. A tree with no subtrees has a height of 1.
Definition at line 66 of file ImmutableSet.h.
Referenced by llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::getHeight(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::getHeight(), llvm::ImutAVLFactory< ImutInfo >::getHeight(), llvm::ImmutableSet< ValT, ValInfo >::getHeight(), llvm::ImmutableSetRef< ValT, ValInfo >::getHeight(), and llvm::ImutAVLTree< ImutInfo >::validateTree().
|
inline |
Return a pointer to the left subtree. This value is NULL if there is no left subtree.
Definition at line 58 of file ImmutableSet.h.
Referenced by llvm::ImutAVLTree< ImutInfo >::find(), llvm::ImutAVLTree< ImutInfo >::foreach(), llvm::ImutAVLFactory< ImutInfo >::getLeft(), llvm::ImutAVLTreeGenericIterator< ImutInfo >::operator++(), llvm::ImutAVLTreeGenericIterator< ImutInfo >::operator--(), llvm::ImutAVLTree< ImutInfo >::size(), and llvm::ImutAVLTree< ImutInfo >::validateTree().
|
inline |
getMaxElement - Find the subtree associated with the highest ranged key value.
Definition at line 89 of file ImmutableSet.h.
References llvm::ImutAVLTree< ImutInfo >::getRight(), and T.
Referenced by llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::getMaxElement(), and llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::getMaxElement().
|
inline |
Return a pointer to the right subtree. This value is NULL if there is no right subtree.
Definition at line 62 of file ImmutableSet.h.
Referenced by llvm::ImutAVLTree< ImutInfo >::find(), llvm::ImutAVLTree< ImutInfo >::foreach(), llvm::ImutAVLTree< ImutInfo >::getMaxElement(), llvm::ImutAVLFactory< ImutInfo >::getRight(), llvm::ImutAVLTreeGenericIterator< ImutInfo >::operator++(), llvm::ImutAVLTreeGenericIterator< ImutInfo >::operator--(), llvm::ImutAVLTree< ImutInfo >::size(), and llvm::ImutAVLTree< ImutInfo >::validateTree().
|
inline |
getValue - Returns the data value associated with the tree node.
Definition at line 69 of file ImmutableSet.h.
Referenced by llvm::ImutAVLTree< ImutInfo >::find(), llvm::ImmutableMap< KeyT, ValT, ValInfo >::iterator::getData(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::iterator::getData(), llvm::ImmutableMap< KeyT, ValT, ValInfo >::iterator::getKey(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::iterator::getKey(), llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::getMaxElement(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::getMaxElement(), llvm::ImutAVLTree< ImutInfo >::isElementEqual(), llvm::ImmutableIntervalMap< ValT >::Factory::lookup(), llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::lookup(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::lookup(), llvm::ImmutableMap< KeyT, ValT, ValInfo >::iterator::operator*(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::iterator::operator*(), llvm::ImmutableSet< ValT, ValInfo >::iterator::operator*(), llvm::ImmutableSetRef< ValT, ValInfo >::iterator::operator*(), llvm::ImmutableMap< KeyT, ValT, ValInfo >::iterator::operator->(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::iterator::operator->(), and llvm::ImutAVLTree< ImutInfo >::validateTree().
|
inline |
Definition at line 116 of file ImmutableSet.h.
References llvm::ImutAVLTree< ImutInfo >::getValue().
Referenced by llvm::ImutAVLFactory< ImutInfo >::compareTreeWithSection(), llvm::ImutAVLTree< ImutInfo >::isElementEqual(), and llvm::ImutAVLTree< ImutInfo >::isEqual().
|
inline |
Definition at line 130 of file ImmutableSet.h.
References llvm::ImutAVLTree< ImutInfo >::getValue(), and llvm::ImutAVLTree< ImutInfo >::isElementEqual().
|
inline |
isEqual - Compares two trees for structural equality and returns true if they are equal. This worst case performance of this operation is
Definition at line 137 of file ImmutableSet.h.
References llvm::ImutAVLTree< ImutInfo >::begin(), llvm::ImutAVLTree< ImutInfo >::end(), llvm::ImutAVLTree< ImutInfo >::isElementEqual(), and llvm::ImutAVLTreeInOrderIterator< ImutInfo >::skipSubTree().
Referenced by llvm::ImutAVLTree< ImutInfo >::isNotEqual(), llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::operator==(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::operator==(), llvm::ImmutableSet< ValT, ValInfo >::operator==(), and llvm::ImmutableSetRef< ValT, ValInfo >::operator==().
|
inline |
isNotEqual - Compares two trees for structural inequality. Performance is the same is isEqual.
Definition at line 163 of file ImmutableSet.h.
References llvm::ImutAVLTree< ImutInfo >::isEqual().
Referenced by llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::operator!=(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::operator!=(), llvm::ImmutableSet< ValT, ValInfo >::operator!=(), and llvm::ImmutableSetRef< ValT, ValInfo >::operator!=().
|
inline |
Definition at line 332 of file ImmutableSet.h.
References llvm::ImutAVLTree< ImutInfo >::destroy().
Referenced by llvm::ImutAVLTree< ImutInfo >::destroy(), llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::manualRelease(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::manualRelease(), llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::operator=(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::operator=(), llvm::ImmutableSet< ValT, ValInfo >::operator=(), llvm::ImmutableSetRef< ValT, ValInfo >::operator=(), llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::~ImmutableMap(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::~ImmutableMapRef(), llvm::ImmutableSet< ValT, ValInfo >::~ImmutableSet(), and llvm::ImmutableSetRef< ValT, ValInfo >::~ImmutableSetRef().
|
inline |
Definition at line 331 of file ImmutableSet.h.
Referenced by llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::getRoot(), llvm::ImmutableSet< ValT, ValInfo >::getRoot(), llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::ImmutableMap(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::ImmutableMapRef(), llvm::ImmutableSet< ValT, ValInfo >::ImmutableSet(), llvm::ImmutableSetRef< ValT, ValInfo >::ImmutableSetRef(), llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::manualRetain(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::manualRetain(), llvm::ImmutableMap< Interval, ValT, ImutIntervalInfo< ValT > >::operator=(), llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::operator=(), llvm::ImmutableSet< ValT, ValInfo >::operator=(), and llvm::ImmutableSetRef< ValT, ValInfo >::operator=().
|
inline |
size - Returns the number of nodes in the tree, which includes both leaves and non-leaf nodes.
Definition at line 98 of file ImmutableSet.h.
References llvm::ImutAVLTree< ImutInfo >::getLeft(), and llvm::ImutAVLTree< ImutInfo >::getRight().
|
inline |
validateTree - A utility method that checks that the balancing and ordering invariants of the tree are satisifed. It is a recursive method that returns the height of the tree, which is then consumed by the enclosing validateTree call. External callers should ignore the return value. An invalid tree will cause an assertion to fire in a debug build.
Definition at line 190 of file ImmutableSet.h.
References llvm::ImutAVLTree< ImutInfo >::getHeight(), llvm::ImutAVLTree< ImutInfo >::getLeft(), llvm::ImutAVLTree< ImutInfo >::getRight(), llvm::ImutAVLTree< ImutInfo >::getValue(), and llvm::ImutAVLTree< ImutInfo >::validateTree().
Referenced by llvm::ImutAVLTree< ImutInfo >::validateTree(), llvm::ImmutableSet< ValT, ValInfo >::validateTree(), and llvm::ImmutableSetRef< ValT, ValInfo >::validateTree().
|
friend |
Definition at line 45 of file ImmutableSet.h.
|
friend |
Definition at line 48 of file ImmutableSet.h.
|
friend |
Definition at line 46 of file ImmutableSet.h.