ENH: Add remove watch

This commit is contained in:
Andy Cedilnik 2003-08-07 16:26:07 -04:00
parent 81b5c3b34d
commit ffaaedc7c6
2 changed files with 15 additions and 0 deletions

View File

@ -44,6 +44,20 @@ void cmVariableWatch::AddWatch(const std::string& variable,
vp->push_back(p); 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 void cmVariableWatch::VariableAccessed(const std::string& variable, int access_type) const
{ {
cmVariableWatch::StringToVectorOfPairs::const_iterator mit = m_WatchMap.find(variable); cmVariableWatch::StringToVectorOfPairs::const_iterator mit = m_WatchMap.find(variable);

View File

@ -36,6 +36,7 @@ public:
* Add watch to the variable * Add watch to the variable
*/ */
void AddWatch(const std::string& variable, WatchMethod method, void* client_data=0); 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 * This method is called when variable is accessed