diff options
author | Marius Kintel <marius@kintel.net> | 2013-04-19 21:52:01 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-04-26 21:45:03 (GMT) |
commit | 9a297ecee57549a4eb3919bde4f7b41a548724de (patch) | |
tree | b1f523e93f528559e9ada2d38d76be7a0362f9d4 /src/ModuleCache.cc | |
parent | b4568a09df8be0f212ba1c4fd1660459900e3cf0 (diff) |
Refactoring: Split out FileModule from Module, Added LocalScope renamed some confusing 'evaluate' methods to 'instantiate', added FileContext (not yet used)
Diffstat (limited to 'src/ModuleCache.cc')
-rw-r--r-- | src/ModuleCache.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ModuleCache.cc b/src/ModuleCache.cc index 19a3f84..4944495 100644 --- a/src/ModuleCache.cc +++ b/src/ModuleCache.cc @@ -28,9 +28,9 @@ static bool is_modified(const std::string &filename, const time_t &mtime) return (st.st_mtime > mtime); } -Module *ModuleCache::evaluate(const std::string &filename) +FileModule *ModuleCache::evaluate(const std::string &filename) { - Module *lib_mod = NULL; + FileModule *lib_mod = NULL; // Create cache ID struct stat st; @@ -48,7 +48,7 @@ Module *ModuleCache::evaluate(const std::string &filename) #endif lib_mod = &(*this->entries[filename].module); - BOOST_FOREACH(const Module::IncludeContainer::value_type &item, lib_mod->includes) { + BOOST_FOREACH(const FileModule::IncludeContainer::value_type &item, lib_mod->includes) { if (is_modified(item.first, item.second)) { lib_mod = NULL; break; @@ -78,7 +78,7 @@ Module *ModuleCache::evaluate(const std::string &filename) print_messages_push(); - Module *oldmodule = NULL; + FileModule *oldmodule = NULL; cache_entry e = { NULL, cache_id }; if (this->entries.find(filename) != this->entries.end()) { oldmodule = this->entries[filename].module; @@ -86,7 +86,7 @@ Module *ModuleCache::evaluate(const std::string &filename) this->entries[filename] = e; std::string pathname = boosty::stringy(fs::path(filename).parent_path()); - lib_mod = dynamic_cast<Module*>(parse(textbuf.str().c_str(), pathname.c_str(), false)); + lib_mod = dynamic_cast<FileModule*>(parse(textbuf.str().c_str(), pathname.c_str(), false)); PRINTB_NOCACHE(" compiled module: %p", lib_mod); if (lib_mod) { |