diff options
author | Marius Kintel <marius@kintel.net> | 2010-04-12 04:57:02 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2010-10-31 00:42:35 (GMT) |
commit | 1caf80e561819832092e67bd15ceba5d6f9a02f8 (patch) | |
tree | ac144b7659840529155c762794508bea018b2be3 /test-code/CSGTextCache.h | |
parent | e8e213b3c9ce0580045ea6e7e86b00ab41d4c58b (diff) |
Added CSGTextCache for experimenting with cache-tree organization
Diffstat (limited to 'test-code/CSGTextCache.h')
-rw-r--r-- | test-code/CSGTextCache.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test-code/CSGTextCache.h b/test-code/CSGTextCache.h new file mode 100644 index 0000000..57a6972 --- /dev/null +++ b/test-code/CSGTextCache.h @@ -0,0 +1,27 @@ +#ifndef CSGTEXTCACHE_H_ +#define CSGTEXTCACHE_H_ + +#include "myqhash.h" +#include "Tree.h" +#include <string> + +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: + QHash<string, string> cache; + const Tree &tree; +}; + +#endif |