model_server/api/src/QueryTree.cxx
//
// Convenience routine to sniff out all of the queries that
// are enabled, and live in active portions of the tree:
//
Convenience routine to sniff out all of the queries that
are enabled, and live in active portions of the tree.
Convenience routine to sniff out all of the queries that are enabled and live in active portions of the tree .
int QTree::FindActiveQueries(QTreePtrArr &items, int depth) const
{
  int n = 0;
  if (depth != 0) {
    if (treecode == QUERY) {
      if (((QueryNode *)this)->enabled) {
        QTree *t = (QTree *)this;
        items.append(&t);
        ++n;
      }
    }
    bool descend = true;
    if (treecode == FOLDER) {
      if (!((FolderNode *)this)->enabled)
        descend = false;
    }
    if (descend) {
      QTree *cur = (QTree *)firstChild;
      while (cur != NULL) {
        n += cur->FindActiveQueries(items, depth - 1);
        cur = (QTree *)cur->nextSibling;
      }
    }
  }
  return n;
}
int QTree :: FindActiveQueries ( QTreePtrArr & items , int depth ) const { int n = 0 ; if ( depth != 0 ) { if ( treecode == QUERY ) { if ( ( ( QueryNode * ) this ) -> enabled ) { QTree * t = ( QTree * ) this ; items . append ( & t ) ; ++ n ; } } bool descend = true ; if ( treecode == FOLDER ) { if ( ! ( ( FolderNode * ) this ) -> enabled ) descend = false ; } if ( descend ) { QTree * cur = ( QTree * ) firstChild ; while ( cur != NULL ) { n += cur -> FindActiveQueries ( items , depth - 1 ) ; cur = ( QTree * ) cur -> nextSibling ; } } } return n ; }
Convenience routine to sniff out all of the queries that
are enabled, and live in active portions of the tree:
Convenience routine to sniff out all of the queries that are enabled and live in active portions of the tree :