xapian-core  1.4.22
Public Member Functions | Private Attributes | List of all members
QueryBuilder Class Reference

Random query builder. More...

+ Collaboration diagram for QueryBuilder:

Public Member Functions

 QueryBuilder (unsigned int maxtermsperfield_, unsigned int maxchildren_, unsigned int maxsteps_)
Xapian::Query make_query ()
 Build a random query. More...

Private Attributes

vector< QueryStepoptions
 The possible steps. More...
QueryBuilderEnv env
 The environment for the build steps. More...
unsigned int maxsteps
 Maximum number of steps to take when building a query. More...

Detailed Description

Random query builder.

Definition at line 153 of file soaktest_queries.cc.

Constructor & Destructor Documentation

◆ QueryBuilder()

QueryBuilder::QueryBuilder ( unsigned int  maxtermsperfield_,
unsigned int  maxchildren_,
unsigned int  maxsteps_ 

Member Function Documentation

◆ make_query()

Xapian::Query QueryBuilder::make_query ( )

Build a random query.

This performs a random number of steps, each of which modifies the QueryBuilderEnv by picking a random one of the options.

After the steps have been performed, the first item on the list in QueryBuilderEnv is popped and returned.

Definition at line 190 of file soaktest_queries.cc.

References QueryBuilderEnv::pop(), and randint().

Referenced by DEFINE_TESTCASE().

Member Data Documentation

◆ env

QueryBuilderEnv QueryBuilder::env

The environment for the build steps.

Definition at line 158 of file soaktest_queries.cc.

◆ maxsteps

unsigned int QueryBuilder::maxsteps

Maximum number of steps to take when building a query.

Definition at line 161 of file soaktest_queries.cc.

◆ options

vector<QueryStep> QueryBuilder::options

The possible steps.

Definition at line 155 of file soaktest_queries.cc.

The documentation for this class was generated from the following file: