summaryrefslogtreecommitdiff
path: root/Source/cmDepends.h
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-03-27 15:50:17 +0100
committerSebastian Holtermann <sebholt@xwmw.org>2019-03-27 18:12:43 +0100
commit87341d8328c7b3a1d50cfd534ff4cb44334a2561 (patch)
tree83479c41db2da0c4282565927d60150f5e5ac727 /Source/cmDepends.h
parent5a15c9e7cb63fb5b884271a1184607a8fa87d442 (diff)
downloadcmake-87341d8328c7b3a1d50cfd534ff4cb44334a2561.tar.gz
cmDepends: Define DependencyMap instead of DependencyVector
In `cmDepends` use `typedef std::map<std::string, std::vector<std::string>> DependencyMap` instead of defining a `class DependencyVector : public std::vector<std::string>` and using it in `std::map<std::string, DependencyVector>`. Since `std::map<std::string, std::vector<std::string>>` is used in various other places, we now reuse all of it's auto generated methods. This doesn't happen when we use `DependencyVector` in a `std::map`, because it is a different class than `std::vector<std::string>`.
Diffstat (limited to 'Source/cmDepends.h')
-rw-r--r--Source/cmDepends.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/cmDepends.h b/Source/cmDepends.h
index d9d5c67188..b7475f0aef 100644
--- a/Source/cmDepends.h
+++ b/Source/cmDepends.h
@@ -24,6 +24,9 @@ class cmLocalGenerator;
class cmDepends
{
public:
+ typedef std::map<std::string, std::vector<std::string>> DependencyMap;
+
+public:
/** Instances need to know the build directory name and the relative
path from the build directory to the target file. */
cmDepends(cmLocalGenerator* lg = nullptr, std::string targetDir = "");
@@ -55,17 +58,13 @@ public:
/** Write dependencies for the target file. */
bool Write(std::ostream& makeDepends, std::ostream& internalDepends);
- class DependencyVector : public std::vector<std::string>
- {
- };
-
/** Check dependencies for the target file. Returns true if
dependencies are okay and false if they must be generated. If
they must be generated Clear has already been called to wipe out
the old dependencies.
Dependencies which are still valid will be stored in validDeps. */
bool Check(const std::string& makeFile, const std::string& internalFile,
- std::map<std::string, DependencyVector>& validDeps);
+ DependencyMap& validDeps);
/** Clear dependencies for the target file so they will be regenerated. */
void Clear(const std::string& file);
@@ -84,9 +83,9 @@ protected:
// Check dependencies for the target file in the given stream.
// Return false if dependencies must be regenerated and true
// otherwise.
- virtual bool CheckDependencies(
- std::istream& internalDepends, const std::string& internalDependsFileName,
- std::map<std::string, DependencyVector>& validDeps);
+ virtual bool CheckDependencies(std::istream& internalDepends,
+ const std::string& internalDependsFileName,
+ DependencyMap& validDeps);
// Finalize the dependency information for the target.
virtual bool Finalize(std::ostream& makeDepends,