Lines Matching defs: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 NULL; }
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; }
431 unsigned incrementHeight(TreeTy* L, TreeTy* R) const {
437 static bool compareTreeWithSection(TreeTy* T,
438 typename TreeTy::iterator& TI,
439 typename TreeTy::iterator& TE) {
440 typename TreeTy::iterator I = T->begin(), E = T->end();
458 TreeTy* createNode(TreeTy* L, value_type_ref V, TreeTy* R) {
460 TreeTy* T;
468 T = (TreeTy*) A.Allocate<TreeTy>();
470 new (T) TreeTy(this, L, R, V, incrementHeight(L,R));
475 TreeTy* createNode(TreeTy* newLeft, TreeTy* oldTree, TreeTy* newRight) {
481 TreeTy *N = createdNodes[i];
490 TreeTy* balanceTree(TreeTy* L, value_type_ref V, TreeTy* R) {
497 TreeTy *LL = getLeft(L);
498 TreeTy *LR = getRight(L);
505 TreeTy
506 TreeTy *LRR = getRight(LR);
513 TreeTy *RL = getLeft(R);
514 TreeTy *RR = getRight(R);
521 TreeTy *RLL = getLeft(RL);
522 TreeTy *RLR = getRight(RL);
533 TreeTy* add_internal(value_type_ref V, TreeTy* T) {
553 TreeTy* remove_internal(key_type_ref K, TreeTy* T) {
572 TreeTy* combineTrees(TreeTy* L, TreeTy* R) {
577 TreeTy* OldNode;
578 TreeTy* newRight = removeMinBinding(R,OldNode);
582 TreeTy* removeMinBinding(TreeTy* T, TreeTy*& Noderemoved) {
594 void markImmutable(TreeTy* T) {
603 TreeTy *getCanonicalTree(TreeTy *TNew) {
613 TreeTy *&entry = Cache[digest];
617 for (TreeTy *T = entry ; T != 0; T = T->next) {
619 typename TreeTy::iterator TI = T->begin(), TE = T->end();
651 typedef ImutAVLTree<ImutInfo> TreeTy;
655 inline ImutAVLTreeGenericIterator(const TreeTy* Root) {
659 TreeTy* operator*() const {
661 return reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
706 TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
710 if (TreeTy* L = Current->getLeft())
716 if (TreeTy* R = Current->getRight())
732 TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
740 if (TreeTy* L = Current->getLeft())
746 if (TreeTy* R = Current->getRight())
762 typedef ImutAVLTree<ImutInfo> TreeTy;
765 ImutAVLTreeInOrderIterator(const TreeTy* Root) : InternalItr(Root) {
777 inline TreeTy* operator*() const { return *InternalItr; }
778 inline TreeTy* operator->() const { return *InternalItr; }
930 typedef ImutAVLTree<ValInfo> TreeTy;
933 TreeTy *Root;
940 explicit ImmutableSet(TreeTy* R) : Root(R) {
959 typename TreeTy::Factory F;
982 TreeTy *NewT = F.add(Old.Root, V);
994 TreeTy *NewT = F.remove(Old.Root, V);
1000 typename TreeTy::Factory *getTreeFactory() const {
1001 return const_cast<typename TreeTy::Factory *>(&F);
1024 TreeTy *getRoot() {
1029 TreeTy *getRootWithoutRetain() const {
1051 typename TreeTy::iterator itr;
1052 iterator(TreeTy* t) : itr(t) {}
1096 typedef ImutAVLTree<ValInfo> TreeTy;
1097 typedef typename TreeTy::Factory FactoryTy;
1100 TreeTy *Root;
1108 explicit ImmutableSetRef(TreeTy* R, FactoryTy *F)
1153 TreeTy *getRootWithoutRetain() const {
1177 typename TreeTy::iterator itr;
1178 iterator(TreeTy* t) : itr(t) {}