diff options
author | Marius Kintel <marius@kintel.net> | 2012-02-04 00:43:53 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-02-15 00:32:37 (GMT) |
commit | b9d218e13760f21be5aa94c15631d63b29439e18 (patch) | |
tree | f01d1e16766b5af06939aa531e84b40bcf6f2f31 /src/ModuleCache.h | |
parent | 44ff85399011ea1bd3eb812ce97d312ccc4f32eb (diff) |
Initial implementation of ModuleCache and dependency tracking of used modules
Diffstat (limited to 'src/ModuleCache.h')
-rw-r--r-- | src/ModuleCache.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ModuleCache.h b/src/ModuleCache.h new file mode 100644 index 0000000..57ff2e7 --- /dev/null +++ b/src/ModuleCache.h @@ -0,0 +1,22 @@ +#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); + void clear(); + +private: + ModuleCache() {} + ~ModuleCache() {} + + static ModuleCache *inst; + + struct cache_entry { + class Module *module; + std::string cache_id, msg; + }; + boost::unordered_map<std::string, cache_entry> entries; +}; |