diff options
-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 |