summaryrefslogtreecommitdiff
path: root/src/Tree.cc
blob: 1561b4fd6d5db6b5c53aa21e850103a2ded887fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "Tree.h"
#include "nodedumper.h"

#include <assert.h>

const std::string &Tree::getString(const AbstractNode &node) const
{
	assert(this->root_node);
	if (!this->nodecache.contains(node)) {
		NodeDumper dumper(this->nodecache, false);
		Traverser trav(dumper, *this->root_node, Traverser::PRE_AND_POSTFIX);
		trav.execute();
		assert(this->nodecache.contains(*this->root_node) &&
					 "NodeDumper failed to create a cache");
	}
	return this->nodecache[node];
}
contact: Jan Huwald // Impressum