X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdependencycache.h;h=4143195e66daf69ac5952990ec2d6b9668de9747;hb=632361796a7ddadf8a726526c937fab22281fb7b;hp=5cde40d919ce0d759a2ab1c862ad0818ce8d912f;hpb=8bc8db44c47cd2906c57dccbfb589e41eff7f694;p=builder.git diff --git a/source/dependencycache.h b/source/dependencycache.h index 5cde40d..4143195 100644 --- a/source/dependencycache.h +++ b/source/dependencycache.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of builder -Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef DEPENDENCYCACHE_H_ #define DEPENDENCYCACHE_H_ @@ -20,20 +13,25 @@ strings as value. The targets are free to store whatever they want here. */ class DependencyCache { -public: - DependencyCache(Package &p); - void set_deps(const std::string &tgt, const StringList &d); - const StringList &get_deps(const std::string &tgt) const; - const Msp::Time::TimeStamp &get_mtime() const { return mtime; } - void load(); - void save() const; private: typedef std::map DepsMap; - Package &package; + SourcePackage &package; DepsMap deps; Msp::Time::TimeStamp mtime; bool changed; + +public: + DependencyCache(SourcePackage &p); + void set_deps(const std::string &tgt, const StringList &d); + const StringList &get_deps(const std::string &tgt) const; + const Msp::Time::TimeStamp &get_mtime() const { return mtime; } + void load(); + + /** + Saves the depencency cache. Does nothing if the cache is empty or nothing + has changed. */ + void save() const; }; #endif