diff options
author | Marius Kintel <marius@kintel.net> | 2010-11-06 15:04:03 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2010-11-06 15:04:03 (GMT) |
commit | c1c5d8174d0a0949dcd27ee6c32e3d237b244c73 (patch) | |
tree | ab2a6a611ca19da9d163025a50c483333179e24f /src/Tree.cc | |
parent | eed6e69530486aa57a981940565ffc0013ef5bd7 (diff) |
doc and cosmetics
Diffstat (limited to 'src/Tree.cc')
-rw-r--r-- | src/Tree.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Tree.cc b/src/Tree.cc index 1561b4f..a451f24 100644 --- a/src/Tree.cc +++ b/src/Tree.cc @@ -3,6 +3,10 @@ #include <assert.h> +/*! + Returns the cached string representation of the subtree rootet by \a node. + If node is not cached, the cache will be rebuilt. +*/ const std::string &Tree::getString(const AbstractNode &node) const { assert(this->root_node); @@ -15,3 +19,12 @@ const std::string &Tree::getString(const AbstractNode &node) const } return this->nodecache[node]; } + +/*! + Sets a new root. Will clear the existing cache. + */ +void Tree::setRoot(const AbstractNode *root) +{ + this->root_node = root; + this->nodecache.clear(); +} |