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.cc | |
parent | e8e213b3c9ce0580045ea6e7e86b00ab41d4c58b (diff) |
Added CSGTextCache for experimenting with cache-tree organization
Diffstat (limited to 'test-code/CSGTextCache.cc')
-rw-r--r-- | test-code/CSGTextCache.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test-code/CSGTextCache.cc b/test-code/CSGTextCache.cc new file mode 100644 index 0000000..4234c63 --- /dev/null +++ b/test-code/CSGTextCache.cc @@ -0,0 +1,27 @@ +#include "CSGTextCache.h" + +bool CSGTextCache::contains(const AbstractNode &node) const +{ + return this->cache.contains(this->tree.getString(node)); +} + +// We cannot return a reference since the [] operator returns a temporary value +string CSGTextCache::operator[](const AbstractNode &node) const +{ + return this->cache[this->tree.getString(node)]; +} + +void CSGTextCache::insert(const class AbstractNode &node, const string & value) +{ + this->cache.insert(this->tree.getString(node), value); +} + +void CSGTextCache::remove(const class AbstractNode &node) +{ + this->cache.remove(this->tree.getString(node)); +} + +void CSGTextCache::clear() +{ + this->cache.clear(); +} |