diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-30 15:08:34 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-08-23 15:08:53 (GMT) |
commit | 25e04ddffeba6d4b1c9deab1ea42038c322cec83 (patch) | |
tree | f367cd16a65e3026a871d323048157f777c42453 /Source/cmDefinitions.h | |
parent | 4bbe261cd34818379d06b68d2e153a98cfccfcf5 (diff) | |
download | CMake-25e04ddffeba6d4b1c9deab1ea42038c322cec83.zip CMake-25e04ddffeba6d4b1c9deab1ea42038c322cec83.tar.gz CMake-25e04ddffeba6d4b1c9deab1ea42038c322cec83.tar.bz2 |
cmDefinitions: Implement in terms of cmLinkedTree.
Store the definitions in a cmLinkedTree in the cmMakefile. This can
be moved to cmState and then the tree will provide snapshotting
possibilities. It will also make the Closure copy created at
the start of each cmMakefile unnecesarry.
Diffstat (limited to 'Source/cmDefinitions.h')
-rw-r--r-- | Source/cmDefinitions.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 5fdcaab..411867c 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -13,6 +13,9 @@ #define cmDefinitions_h #include "cmStandardIncludes.h" + +#include "cmLinkedTree.h" + #if defined(CMAKE_BUILD_WITH_CMAKE) #ifdef CMake_HAVE_CXX11_UNORDERED_MAP #include <unordered_map> @@ -32,26 +35,26 @@ */ class cmDefinitions { - typedef std::list<cmDefinitions>::reverse_iterator StackIter; - typedef std::list<cmDefinitions>::const_reverse_iterator StackConstIter; + typedef cmLinkedTree<cmDefinitions>::iterator StackIter; public: static const char* Get(const std::string& key, StackIter begin, StackIter end); - static void Raise(const std::string& key, StackIter begin, StackIter end); + static void Raise(const std::string& key, + StackIter begin, StackIter end); static bool HasKey(const std::string& key, - StackConstIter begin, StackConstIter end); + StackIter begin, StackIter end); /** Set (or unset if null) a value associated with a key. */ void Set(const std::string& key, const char* value); std::vector<std::string> UnusedKeys() const; - static std::vector<std::string> ClosureKeys(StackConstIter begin, - StackConstIter end); + static std::vector<std::string> ClosureKeys(StackIter begin, + StackIter end); - static cmDefinitions MakeClosure(StackConstIter begin, StackConstIter end); + static cmDefinitions MakeClosure(StackIter begin, StackIter end); private: // String with existence boolean. |