virtual void printQuery(const Query& query,
                            const Query* falseQuery = 0,
                            const std::vector<const Array*>* objects = 0) {

        const ref<Expr>* evalExprsBegin = 0;
        const ref<Expr>* evalExprsEnd = 0;

        if (0 != falseQuery) {
            evalExprsBegin = &query.expr;
            evalExprsEnd = &query.expr + 1;
        }

        const Array* const *evalArraysBegin = 0;
        const Array* const *evalArraysEnd = 0;

        if ((0 != objects) && (false == objects->empty())) {
            evalArraysBegin = &((*objects)[0]);
            evalArraysEnd = &((*objects)[0]) + objects->size();
        }

        const Query* q = (0 == falseQuery) ? &query : falseQuery;

        printer->printQuery(logBuffer, q->constraints, q->expr,
                            evalExprsBegin, evalExprsEnd,
                            evalArraysBegin, evalArraysEnd);
    }
Esempio n. 2
0
 void startQuery(const Query& query, const char *typeName,
                 const ref<Expr> *evalExprsBegin = 0,
                 const ref<Expr> *evalExprsEnd = 0,
                 const Array * const* evalArraysBegin = 0,
                 const Array * const* evalArraysEnd = 0) {
   Statistic *S = theStatisticManager->getStatisticByName("Instructions");
   uint64_t instructions = S ? S->getValue() : 0;
   os << "# Query " << queryCount++ << " -- "
      << "Type: " << typeName << ", "
      << "Instructions: " << instructions << "\n";
   printer->printQuery(os, query.constraints, query.expr,
                       evalExprsBegin, evalExprsEnd,
                       evalArraysBegin, evalArraysEnd);
   
   startTime = getWallTime();
 }