Exemplo n.º 1
0
bool internal_is_watching(const T& item)
{
  for (std::vector<Watch*>::const_iterator
       itr = watch_vector().begin(); itr != watch_vector().end(); ++itr) {
    if ((*itr)->type() == typeid(T) &&
        (*itr)->match(&item)) {
      return true;
    }
  }
  return false;
}
Exemplo n.º 2
0
bool internal_is_watching(const T& item)
{
  bool found_type_match = false;
  for (std::vector<Watch*>::const_iterator
       itr = watch_vector().begin(); itr != watch_vector().end(); ++itr) {
    if ((*itr)->type() == typeid(T)) {
      found_type_match = true;
      if ((*itr)->match(&item)) {
        return true;
      }
    }
  }

  // If we aren't watching any particular item of a type, then we are
  // watching *all* items of that type
  return !found_type_match;
}
Exemplo n.º 3
0
 WatchClass(const T& watch_item) : m_watch_item(watch_item),
                                   m_type_info(&typeid(T)) {
   watch_vector().push_back(this);
 }