summaryrefslogtreecommitdiff
path: root/src/CGALCache.h
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-01-06 18:10:33 (GMT)
committerMarius Kintel <marius@kintel.net>2012-01-09 23:01:50 (GMT)
commitfe3362faf825016606a8bcd60669c16965b0599c (patch)
tree1cfccc34acf462d9faefdfb8662c48cde878cbf9 /src/CGALCache.h
parentc4695872392a6d1415752934be55c81de57de87e (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.h6
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:
contact: Jan Huwald // Impressum