| 342 | } |
| 343 | |
| 344 | void Node::getPathRecursively(Path& targetPath) |
| 345 | { |
| 346 | INodePtr parent = getParent(); |
| 347 | |
| 348 | assert(parent.get() != this); // avoid loopbacks |
| 349 | |
| 350 | if (parent != NULL) { |
| 351 | std::dynamic_pointer_cast<Node>(parent)->getPathRecursively(targetPath); |
| 352 | } |
| 353 | |
| 354 | // After passing the call to the parent, add self |
| 355 | targetPath.push(shared_from_this()); |
| 356 | } |
| 357 | |
| 358 | Path Node::getPath() |
| 359 | { |