Lines Matching refs:TreeTy
366 typedef ImutAVLTree<ImutInfo> TreeTy;
367 typedef typename TreeTy::value_type_ref value_type_ref;
368 typedef typename TreeTy::key_type_ref key_type_ref;
370 typedef DenseMap<unsigned, TreeTy*> CacheTy;
374 std::vector<TreeTy*> createdNodes;
375 std::vector<TreeTy*> freeNodes;
400 TreeTy* add(TreeTy* T, value_type_ref V) {
407 TreeTy* remove(TreeTy* T, key_type_ref V) {
414 TreeTy* getEmptyTree() const { return nullptr; }
425 bool isEmpty(TreeTy* T) const { return !T; }
426 unsigned getHeight(TreeTy* T) const { return T ? T->getHeight() : 0; }
427 TreeTy* getLeft(TreeTy* T) const { return T->getLeft(); }
428 TreeTy* getRight(TreeTy* T) const { return T->getRight(); }
429 value_type_ref getValue(TreeTy* T) const { return T->value; }
434 unsigned incrementHeight(TreeTy* L, TreeTy* R) const {
440 static bool compareTreeWithSection(TreeTy* T,
441 typename TreeTy::iterator& TI,
442 typename TreeTy::iterator& TE) {
443 typename TreeTy::iterator I = T->begin(), E = T->end();
461 TreeTy* createNode(TreeTy* L, value_type_ref V, TreeTy* R) {
463 TreeTy* T;
470 T = (TreeTy*) A.Allocate<TreeTy>();
472 new (T) TreeTy(this, L, R, V, incrementHeight(L,R));
477 TreeTy* createNode(TreeTy* newLeft, TreeTy* oldTree, TreeTy* newRight) {
483 TreeTy *N = createdNodes[i];
492 TreeTy* balanceTree(TreeTy* L, value_type_ref V, TreeTy* R) {
499 TreeTy *LL = getLeft(L);
500 TreeTy
507 TreeTy *LRL = getLeft(LR);
508 TreeTy *LRR = getRight(LR);
516 TreeTy *RL = getLeft(R);
517 TreeTy *RR = getRight(R);
524 TreeTy *RLL = getLeft(RL);
525 TreeTy *RLR = getRight(RL);
536 TreeTy* add_internal(value_type_ref V, TreeTy* T) {
556 TreeTy* remove_internal(key_type_ref K, TreeTy* T) {
575 TreeTy* combineTrees(TreeTy* L, TreeTy* R) {
580 TreeTy* OldNode;
581 TreeTy* newRight = removeMinBinding(R,OldNode);
585 TreeTy* removeMinBinding(TreeTy* T, TreeTy*& Noderemoved) {
597 void markImmutable(TreeTy* T) {
606 TreeTy *getCanonicalTree(TreeTy *TNew) {
616 TreeTy *&entry = Cache[maskCacheIndex(digest)];
620 for (TreeTy *T = entry ; T != nullptr; T = T->next) {
622 typename TreeTy::iterator TI = T->begin(), TE = T->end();
656 typedef ImutAVLTree<ImutInfo> TreeTy;
659 ImutAVLTreeGenericIterator(const TreeTy *Root) {
663 TreeTy &operator*() const {
665 return *reinterpret_cast<TreeTy *>(stack.back() & ~Flags);
667 TreeTy *operator->() const { return &*this; }
708 TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
712 if (TreeTy* L = Current->getLeft())
718 if (TreeTy* R = Current->getRight())
734 TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
742 if (TreeTy* L = Current->getLeft())
748 if (TreeTy* R = Current->getRight())
766 typedef ImutAVLTree<ImutInfo> TreeTy;
768 ImutAVLTreeInOrderIterator(const TreeTy* Root) : InternalItr(Root) {
783 TreeTy &operator*() const { return *InternalItr; }
784 TreeTy *operator->() const { return &*InternalItr; }
811 /// Generic iterator that wraps a T::TreeTy::iterator and exposes
816 ImutAVLValueIterator<T>, typename T::TreeTy::iterator,
818 typename T::TreeTy::iterator>::iterator_category,
821 explicit ImutAVLValueIterator(typename T::TreeTy *Tree)
962 typedef ImutAVLTree<ValInfo> TreeTy;
965 TreeTy *Root;
972 explicit ImmutableSet(TreeTy* R) : Root(R) {
991 typename TreeTy::Factory F;
1014 TreeTy *NewT = F.add(Old.Root, V);
1026 TreeTy *NewT = F.remove(Old.Root, V);
1032 typename TreeTy::Factory *getTreeFactory() const {
1033 return const_cast<typename TreeTy::Factory *>(&F);
1056 TreeTy *getRoot() {
1061 TreeTy *getRootWithoutRetain() const {
1112 typedef ImutAVLTree<ValInfo> TreeTy;
1113 typedef typename TreeTy::Factory FactoryTy;
1116 TreeTy *Root;
1124 explicit ImmutableSetRef(TreeTy* R, FactoryTy *F)
1169 TreeTy *getRootWithoutRetain() const {