diff options
author | Kitware Robot <kwrobot@kitware.com> | 2016-05-16 14:34:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-16 20:05:19 (GMT) |
commit | d9fd2f5402eeaa345691313658e02b51038f570b (patch) | |
tree | dca71b9a7e267f4c6300da3eb770415381726785 /Source/cmVariableWatch.h | |
parent | 82df6deaafb36cbbfd450202bb20b320f637751a (diff) | |
download | CMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2 |
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
Diffstat (limited to 'Source/cmVariableWatch.h')
-rw-r--r-- | Source/cmVariableWatch.h | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index 2f082af..be8f72f 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -25,7 +25,8 @@ class cmVariableWatch { public: typedef void (*WatchMethod)(const std::string& variable, int access_type, - void* client_data, const char* newValue, const cmMakefile* mf); + void* client_data, const char* newValue, + const cmMakefile* mf); typedef void (*DeleteData)(void* client_data); cmVariableWatch(); @@ -35,28 +36,28 @@ public: * Add watch to the variable */ bool AddWatch(const std::string& variable, WatchMethod method, - void* client_data=0, DeleteData delete_data=0); + void* client_data = 0, DeleteData delete_data = 0); void RemoveWatch(const std::string& variable, WatchMethod method, - void* client_data=0); + void* client_data = 0); /** * This method is called when variable is accessed */ bool VariableAccessed(const std::string& variable, int access_type, - const char* newValue, const cmMakefile* mf) const; + const char* newValue, const cmMakefile* mf) const; /** * Different access types. */ enum - { + { VARIABLE_READ_ACCESS = 0, UNKNOWN_VARIABLE_READ_ACCESS, UNKNOWN_VARIABLE_DEFINED_ACCESS, VARIABLE_MODIFIED_ACCESS, VARIABLE_REMOVED_ACCESS, NO_ACCESS - }; + }; /** * Return the access as string @@ -67,23 +68,26 @@ protected: struct Pair { WatchMethod Method; - void* ClientData; - DeleteData DeleteDataCall; - Pair() : Method(0), ClientData(0), DeleteDataCall(0) {} + void* ClientData; + DeleteData DeleteDataCall; + Pair() + : Method(0) + , ClientData(0) + , DeleteDataCall(0) + { + } ~Pair() - { - if (this->DeleteDataCall && this->ClientData) - { + { + if (this->DeleteDataCall && this->ClientData) { this->DeleteDataCall(this->ClientData); - } } + } }; - typedef std::vector< Pair* > VectorOfPairs; - typedef std::map<std::string, VectorOfPairs > StringToVectorOfPairs; + typedef std::vector<Pair*> VectorOfPairs; + typedef std::map<std::string, VectorOfPairs> StringToVectorOfPairs; StringToVectorOfPairs WatchMap; }; - #endif |