diff options
author | Marius Kintel <marius@kintel.net> | 2013-05-28 20:29:53 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-05-28 20:29:53 (GMT) |
commit | 5722dd9e411ed52a0b840afc47b468c3ed1970c1 (patch) | |
tree | 7871561c0a2a83a6c86886442ebe3e7ddb36049c /src/module.h | |
parent | c0fa353e063c2075f6e1920f483bfa7142c4345e (diff) |
Minor refactoring, no longer automatically reloads if a dependency disappears
Diffstat (limited to 'src/module.h')
-rw-r--r-- | src/module.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/module.h b/src/module.h index 5dfb8c4..ad2a46c 100644 --- a/src/module.h +++ b/src/module.h @@ -77,12 +77,6 @@ public: LocalScope scope; }; -struct IncludeFile { - std::string filename; - bool valid; - time_t mtime; -}; - // FIXME: A FileModule doesn't have definition arguments, so we shouldn't really // inherit from a Module class FileModule : public Module @@ -94,15 +88,28 @@ public: void setModulePath(const std::string &path) { this->path = path; } const std::string &modulePath() const { return this->path; } void registerInclude(const std::string &localpath, const std::string &fullpath); + bool includesChanged() const; bool handleDependencies(); virtual AbstractNode *instantiate(const Context *ctx, const ModuleInstantiation *inst, const EvalContext *evalctx = NULL) const; + bool hasIncludes() const { return !this->includes.empty(); } + bool usesLibraries() const { return !this->usedlibs.empty(); } + + typedef boost::unordered_map<std::string, class FileModule*> ModuleContainer; ModuleContainer usedlibs; +private: + struct IncludeFile { + std::string filename; + bool valid; + time_t mtime; + }; + + bool include_modified(const IncludeFile &inc) const; + typedef boost::unordered_map<std::string, struct IncludeFile> IncludeContainer; IncludeContainer includes; - bool include_modified(struct IncludeFile inc); -private: + bool is_handling_dependencies; std::string path; }; |