1 #ifndef DEPENDENCYCACHE_H_
2 #define DEPENDENCYCACHE_H_
4 #include <msp/time/timestamp.h>
10 Stores dependencies to avoid expensive filesystem operations during DAG
11 building phase. The dependencies are stored in a map with target name as key
12 and a list of strings as value. The targets are free to store whatever they
18 typedef std::map<std::string, StringList> DepsMap;
20 SourcePackage &package;
22 Msp::Time::TimeStamp mtime;
26 DependencyCache(SourcePackage &p);
28 void set_deps(const std::string &tgt, const StringList &d);
29 bool has_deps(const std::string &tgt) const;
30 const StringList &get_deps(const std::string &tgt) const;
31 const Msp::Time::TimeStamp &get_mtime() const { return mtime; }
34 /** Saves the depencency cache. Does nothing if the cache is empty or
35 nothing has changed. */