blob: 1e6373d3746c130525132e37bf563e4c74427dbc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include <string>
#include <boost/unordered_map.hpp>
class ModuleCache
{
public:
static ModuleCache *instance() { if (!inst) inst = new ModuleCache; return inst; }
class Module *evaluate(const std::string &filename);
size_t size() { return this->entries.size(); }
void clear();
private:
ModuleCache() {}
~ModuleCache() {}
static ModuleCache *inst;
struct cache_entry {
class Module *module;
std::string cache_id;
};
boost::unordered_map<std::string, cache_entry> entries;
};
|