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:
You can see coding examples in Appendix C, "Sample Code" on page 185. Other programs are located in the qbic/QbicApi
directory.
This is the constructor for the class.
QbQueryClass( void )
This is the destructor for the class.
virtual ~QbQueryClass( void )
This method has an overloaded abstract interface for defining a QBIC query.
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 )
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.
This method retrieves the return code for the Evaluate method.
virtual int GetReturnCode( void )
An integer value: 0 indicates success; -1 indicates failure