3 This file is part of builder
4 Copyright © 2007, 2009 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef DEPENDENCYCACHE_H_
9 #define DEPENDENCYCACHE_H_
11 #include <msp/time/timestamp.h>
17 Stores dependencies to avoid expensive operations during DAG building phase.
18 The dependencies are stored in a map with target name as key and a list of
19 strings as value. The targets are free to store whatever they want here.
24 typedef std::map<std::string, StringList> DepsMap;
26 SourcePackage &package;
28 Msp::Time::TimeStamp mtime;
32 DependencyCache(SourcePackage &p);
33 void set_deps(const std::string &tgt, const StringList &d);
34 const StringList &get_deps(const std::string &tgt) const;
35 const Msp::Time::TimeStamp &get_mtime() const { return mtime; }
39 Saves the depencency cache. Does nothing if the cache is empty or nothing