Lines Matching full:root
74 IntrusiveRefCntPtr<TreeTy> Root;
77 /// Constructs a map from a pointer to a tree root. In general one
81 explicit ImmutableMap(const TreeTy *R) : Root(const_cast<TreeTy *>(R)) {} in ImmutableMap()
100 TreeTy *T = F.add(Old.Root.get(), std::pair<key_type, data_type>(K, D)); in add()
105 TreeTy *T = F.remove(Old.Root.get(), K); in remove()
115 return Root ? Root->contains(K) : false; in contains()
119 return Root && RHS.Root ? Root->isEqual(*RHS.Root.get()) : Root == RHS.Root;
123 return Root && RHS.Root ? Root->isNotEqual(*RHS.Root.get())
124 : Root != RHS.Root;
128 if (Root) { Root->retain(); } in getRoot()
129 return Root.get(); in getRoot()
132 TreeTy *getRootWithoutRetain() const { return Root.get(); } in getRootWithoutRetain()
135 if (Root) Root->retain(); in manualRetain()
139 if (Root) Root->release(); in manualRelease()
142 bool isEmpty() const { return !Root; } in isEmpty()
149 void verify() const { if (Root) Root->verify(); } in verify()
166 iterator begin() const { return iterator(Root.get()); } in begin()
170 if (Root) { in lookup()
171 TreeTy* T = Root->find(K); in lookup()
182 return Root ? &(Root->getMaxElement()->getValue()) : nullptr; in getMaxElement()
189 unsigned getHeight() const { return Root ? Root->getHeight() : 0; } in getHeight()
192 ID.AddPointer(M.Root.get()); in Profile()
215 IntrusiveRefCntPtr<TreeTy> Root;
219 /// Constructs a map from a pointer to a tree root. In general one
224 : Root(const_cast<TreeTy *>(R)), Factory(F) {} in ImmutableMapRef()
228 : Root(X.getRootWithoutRetain()), Factory(F.getTreeFactory()) {} in ImmutableMapRef()
235 if (Root) Root->retain(); in manualRetain()
239 if (Root) Root->release(); in manualRelease()
244 Factory->add(Root.get(), std::pair<key_type, data_type>(K, D)); in add()
249 TreeTy *NewT = Factory->remove(Root.get(), K); in remove()
254 return Root ? Root->contains(K) : false; in contains()
258 return ImmutableMap<KeyT, ValT>(Factory->getCanonicalTree(Root.get())); in asImmutableMap()
262 return Root && RHS.Root ? Root->isEqual(*RHS.Root.get()) : Root == RHS.Root;
266 return Root && RHS.Root ? Root->isNotEqual(*RHS.Root.get())
267 : Root != RHS.Root;
270 bool isEmpty() const { return !Root; } in isEmpty()
277 if (Root) in verify()
278 Root->verify(); in verify()
296 iterator begin() const { return iterator(Root.get()); } in begin()
300 if (Root) { in lookup()
301 TreeTy* T = Root->find(K); in lookup()
312 return Root ? &(Root->getMaxElement()->getValue()) : nullptr; in getMaxElement()
319 unsigned getHeight() const { return Root ? Root->getHeight() : 0; } in getHeight()
322 ID.AddPointer(M.Root.get()); in Profile()