Andy Cedilnik 22 лет назад
Родитель
Сommit
ffaaedc7c6
2 измененных файлов с 15 добавлено и 0 удалено
  1. 14 0
      Source/cmVariableWatch.cxx
  2. 1 0
      Source/cmVariableWatch.h

+ 14 - 0
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);

+ 1 - 0
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