diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-08-07 20:26:07 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-08-07 20:26:07 (GMT) |
commit | ffaaedc7c6c9ae6e4d2fd3a3f4b6d576742831ae (patch) | |
tree | 49f6253ea90e0fbafcf954bf49a7dfde18458a33 /Source | |
parent | 81b5c3b34d9420c91c2269e33bb991e705cd8d4e (diff) | |
download | CMake-ffaaedc7c6c9ae6e4d2fd3a3f4b6d576742831ae.zip CMake-ffaaedc7c6c9ae6e4d2fd3a3f4b6d576742831ae.tar.gz CMake-ffaaedc7c6c9ae6e4d2fd3a3f4b6d576742831ae.tar.bz2 |
ENH: Add remove watch
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmVariableWatch.cxx | 14 | ||||
-rw-r--r-- | Source/cmVariableWatch.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx index 74548fb..2f5bd03 100644 --- a/Source/cmVariableWatch.cxx +++ b/Source/cmVariableWatch.cxx @@ -44,6 +44,20 @@ void cmVariableWatch::AddWatch(const std::string& variable, vp->push_back(p); } +void cmVariableWatch::RemoveWatch(const std::string& variable, WatchMethod method) +{ + cmVariableWatch::VectorOfPairs* vp = &m_WatchMap[variable]; + cmVariableWatch::VectorOfPairs::iterator it; + for ( it = vp->begin(); it != vp->end(); ++it ) + { + if ( it->m_Method == method ) + { + vp->erase(it); + return; + } + } +} + void cmVariableWatch::VariableAccessed(const std::string& variable, int access_type) const { cmVariableWatch::StringToVectorOfPairs::const_iterator mit = m_WatchMap.find(variable); diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index 9a978bd..4b01c7a 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -36,6 +36,7 @@ public: * Add watch to the variable */ void AddWatch(const std::string& variable, WatchMethod method, void* client_data=0); + void RemoveWatch(const std::string& variable, WatchMethod method); /** * This method is called when variable is accessed |