summaryrefslogtreecommitdiff
path: root/tests/CSGTextCache.h
blob: 62f26ce80ca19e771a648f4e13cc15e25b9ae1ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef CSGTEXTCACHE_H_
#define CSGTEXTCACHE_H_

#include "Tree.h"
#include <string>
#include <boost/unordered_map.hpp>

using std::string;

class CSGTextCache
{
public:
	CSGTextCache(const Tree &tree) : tree(tree) {}
	~CSGTextCache() {}

	bool contains(const AbstractNode &node) const;
  string operator[](const AbstractNode &node) const;
  void insert(const class AbstractNode &node, const string & value);
  void remove(const class AbstractNode &node);
	void clear();

private:
	boost::unordered_map<string, string> cache;
	const Tree &tree;
};

#endif
contact: Jan Huwald // Impressum