diff options
author | Marius Kintel <marius@kintel.net> | 2012-01-06 18:10:33 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-01-09 23:01:50 (GMT) |
commit | fe3362faf825016606a8bcd60669c16965b0599c (patch) | |
tree | 1cfccc34acf462d9faefdfb8662c48cde878cbf9 /src/CGALCache.h | |
parent | c4695872392a6d1415752934be55c81de57de87e (diff) |
Started on cache size management: Let cache sizes be read from Preferences, measure cache sizes in bytes
Diffstat (limited to 'src/CGALCache.h')
-rw-r--r-- | src/CGALCache.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/CGALCache.h b/src/CGALCache.h index 87e3343..063fef5 100644 --- a/src/CGALCache.h +++ b/src/CGALCache.h @@ -8,14 +8,16 @@ class CGALCache { public: - CGALCache(size_t limit = 100000) : cache(limit) {} + CGALCache(size_t limit = 100*1024*1024) : cache(limit) {} static CGALCache *instance() { if (!inst) inst = new CGALCache; return inst; } bool contains(const std::string &id) const { return this->cache.contains(id); } const class CGAL_Nef_polyhedron &get(const std::string &id) const { return *this->cache[id]; } void insert(const std::string &id, const CGAL_Nef_polyhedron &N); - void clear() { cache.clear(); } + size_t maxSize() const; + void setMaxSize(size_t limit); + void clear(); void print(); private: |