| 44 | } |
| 45 | |
| 46 | void cmVariableWatch::RemoveWatch(std::string const& variable, |
| 47 | WatchMethod method, void* client_data /*=0*/) |
| 48 | { |
| 49 | if (!this->WatchMap.count(variable)) { |
| 50 | return; |
| 51 | } |
| 52 | cmVariableWatch::VectorOfPairs* vp = &this->WatchMap[variable]; |
| 53 | cmVariableWatch::VectorOfPairs::iterator it; |
| 54 | for (it = vp->begin(); it != vp->end(); ++it) { |
| 55 | if ((*it)->Method == method && |
| 56 | // If client_data is NULL, we want to disconnect all watches against |
| 57 | // the given method; otherwise match ClientData as well. |
| 58 | (!client_data || (client_data == (*it)->ClientData))) { |
| 59 | vp->erase(it); |
| 60 | return; |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | bool cmVariableWatch::VariableAccessed(std::string const& variable, |
| 66 | int access_type, char const* newValue, |