Home | History | Annotate | Download | only in ADT

Lines Matching refs:Root

71   TreeTy* Root;
74 /// Constructs a map from a pointer to a tree root. In general one
78 explicit ImmutableMap(const TreeTy* R) : Root(const_cast<TreeTy*>(R)) {
79 if (Root) { Root->retain(); }
82 ImmutableMap(const ImmutableMap &X) : Root(X.Root) {
83 if (Root) { Root->retain(); }
87 if (Root != X.Root) {
88 if (X.Root) { X.Root->retain(); }
89 if (Root) { Root->release(); }
90 Root = X.Root;
96 if (Root) { Root->release(); }
112 TreeTy *T = F.add(Old.Root, std::pair<key_type,data_type>(K,D));
117 TreeTy *T = F.remove(Old.Root,K);
131 return Root ? Root->contains(K) : false;
135 return Root && RHS.Root ? Root->isEqual(*RHS.Root) : Root == RHS.Root;
139 return Root && RHS.Root ? Root->isNotEqual(*RHS.Root) : Root != RHS.Root;
143 if (Root) { Root->retain(); }
144 return Root;
147 TreeTy *getRootWithoutRetain() const { return Root; }
150 if (Root) Root->retain();
154 if (Root) Root->release();
157 bool isEmpty() const { return !Root; }
181 if (Root) {
183 Root->foreach(CB);
189 if (Root) {
191 Root->foreach(CB);
199 void verify() const { if (Root) Root->verify(); }
215 iterator begin() const { return iterator(Root); }
219 if (Root) {
220 TreeTy* T = Root->find(K);
231 return Root ? &(Root->getMaxElement()->getValue()) : nullptr;
238 unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
241 ID.AddPointer(M.Root);
264 TreeTy *Root;
268 /// Constructs a map from a pointer to a tree root. In general one
273 : Root(const_cast<TreeTy *>(R)), Factory(F) {
274 if (Root) {
275 Root->retain();
281 : Root(X.getRootWithoutRetain()),
283 if (Root) { Root->retain(); }
286 ImmutableMapRef(const ImmutableMapRef &X) : Root(X.Root), Factory(X.Factory) {
287 if (Root) {
288 Root->retain();
293 if (Root != X.Root) {
294 if (X.Root)
295 X.Root->retain();
297 if (Root)
298 Root->release();
300 Root = X.Root;
307 if (Root)
308 Root->release();
316 if (Root) Root->retain();
320 if (Root) Root->release();
324 TreeTy *NewT = Factory->add(Root, std::pair<key_type, data_type>(K, D));
329 TreeTy *NewT = Factory->remove(Root, K);
334 return Root ? Root->contains(K) : false;
338 return ImmutableMap<KeyT, ValT>(Factory->getCanonicalTree(Root));
342 return Root && RHS.Root ? Root->isEqual(*RHS.Root) : Root == RHS.Root;
346 return Root && RHS.Root ? Root->isNotEqual(*RHS.Root) : Root != RHS.Root;
349 bool isEmpty() const { return !Root; }
356 if (Root)
357 Root->verify();
374 iterator begin() const { return iterator(Root); }
378 if (Root) {
379 TreeTy* T = Root->find(K);
390 return Root ? &(Root->getMaxElement()->getValue()) : 0;
397 unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
400 ID.AddPointer(M.Root);