Page 20 out of 26 total pages


QbQueryClass


QbQueryClass is derived from the QbBaseClass and is an abstract class that defines the Evaluate method. The input to the Evaluate method is the query string, which is a simple text based query language consisting of text strings that define a content-based query. The query string is built using the QbBuildQueryString method defined in QbQueryS.hpp.

QbBuildQueryString arguments include the number of results requested, catalog name, optional restriction lists, number of features, feature class names, and a parameter class and generic data pointer for each feature. It returns the query string in a QbDatum object. Use the MakeQueryByExampleObject and MakeQueryByTextObject methods to make a valid QbGenericDataClass object for this call.

The QbQueryServerClass derived class has several private methods to decode the query string, optimize, prepare, and execute the query. Using the query string allows you to separate the functionality of client and server, when they are in different process spaces or on different platforms. If they are co-located, you can define an overloaded version of the Evaluate method that takes several class pointers to fulfill the same functionality.

This chapter describes the following methods:

QbQueryClass method

This is the constructor for the class.

Syntax

QbQueryClass( void )

Parameters

None

~QbQueryClass method

This is the destructor for the class.

Syntax

virtual ~QbQueryClass( void )

Parameters

None

Evaluate method

This method has an overloaded abstract interface for defining a QBIC query.

Syntax

virtual const QbKeyDatabaseClass * Evaluate( const char *query )

virtual const QbKeyDatabaseClass * Evaluate( const int 
numberOfResults, QbCatalogClass *cat, QbKeyDatabaseClass *res, 
QbKeyDatabaseClass *parts, int numOfFeatures, QbGenericDataClass 
**data, QbFeatureClass **feat, QbParameterClass **parm )

Parameters

Input

Output

A pointer to a QbKeyDatabaseClass object that maintains a ranked list of key and distance pairs for QBIC query results. You can build the query string using the QbBuildQueryString method defined in QbQueryS.hpp. It builds a QbDatumClass object from which you can retrieve the string using its Get method.

GetReturnCode method

This method retrieves the return code for the Evaluate method.

Syntax

virtual int GetReturnCode( void )

Parameters

Input

None

Output

An integer value: 0 indicates success; -1 indicates failure




Page 20 out of 26 total pages


xzhu@almaden.ibm.com or tedl@almaden.ibm.com
Copyright © 1998, IBM Corporation. All rights reserved.