X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcache.h;h=f3a2c13cb003216b92cd500c5096aa2ed4d14829;hb=aa053d637e8259755af7d2e4b510a242f4d29c7b;hp=98739575e25d45a998fdbce2f17e77c7a50faefd;hpb=f76c063eb9b792088e034ffb4c2f173b843e8c57;p=builder.git diff --git a/source/cache.h b/source/cache.h index 9873957..f3a2c13 100644 --- a/source/cache.h +++ b/source/cache.h @@ -1,6 +1,9 @@ #ifndef CACHE_H_ #define CACHE_H_ +#include +#include +#include #include class SourcePackage; @@ -17,16 +20,15 @@ unprintable characters or nuls. class Cache { public: - typedef std::list ValueList; + using Values = std::vector; private: - typedef std::pair Key; - typedef std::map DataMap; + using Key = std::pair; SourcePackage &package; Msp::FS::Path filename; - DataMap data; + std::map data; Msp::Time::TimeStamp mtime; - bool changed; + mutable bool changed; public: Cache(SourcePackage &p); @@ -38,14 +40,14 @@ public: void append_value(const Target *, const std::string &, const std::string &); /// Sets a key to a list of values, replacing any existing values. - void set_values(const Target *, const std::string &, const ValueList &); + void set_values(const Target *, const std::string &, const Values &); /** Returns the first value from a key. The key must exist and be non-empty. */ const std::string &get_value(const Target *, const std::string &); /// Returns the values from a key. The key must exist. - const ValueList &get_values(const Target *, const std::string &); + const Values &get_values(const Target *, const std::string &); /// Indicates whether a key exists. bool has_key(const Target *, const std::string &);