System documentation of the GNU Image-Finding Tool

CQMultiple Class Reference

This is going to be one of our main building blocks. More...

#include <CQMultiple.h>

Inheritance diagram for CQMultiple:

CQuery CMagic List of all members.

Public Member Functions

 CQMultiple ()
 default constructor
 ~CQMultiple ()
 we need to unregister the accessors used
 CQMultiple (CAccessorAdminCollection &inAccessorAdminCollection, CAlgorithm &inAlgorithm)
 In fact, what we are doing here is to get ourselves an accessor ACURL2FTS to do a proper fastQuery.
virtual CIDRelevanceLevelPairList * fastQuery (const CXMLElement &inQuery, int inNumberOfInterestingImages, double inDifferenceToBest)
 calls fastQuery for every child, merges the results
virtual CXMLElementquery (const CXMLElement &inQuery)
 calls query for every child, merges the results by URLs
virtual bool setAlgorithm (CAlgorithm &inAlgorithm)
 set the Algorithm.

Static Public Member Functions

static void * doFastQueryThread (void *)
 This function processes is in the inner loop of fastQuery.
static void * doQueryThread (void *)
 This function processes is in the inner loop of query.

Protected Member Functions

void init ()
 Initializer, used by both construcors.

Protected Attributes

bool mUsesResultURLs
 do we merge result URLs or result IDs?

Detailed Description

This is going to be one of our main building blocks.

It is a structure which contains a couple of CQuery structures, hands a query through to them, and then unifies the result. In fact this is the center of all this query tree business.

Probably we will put another layer into the class tree: The CQTreeNode, but let's first start.

Important: The basic assumption here is, that all children operate on the same collections. If this is not the case we have to be more careful, and most of all: we have to operate using URLs.

[in the following I am talking about things I WANT to do, so the two modes stuff is not yet implemented]

CQMultiple has two minor modes:

Merge-by-ID or Merge-by-URL

In the first case, we need information on how to translate image IDs to image URLs. We dispatche a fastQuery() to each child node, and then we merge the results (by imageID). The resulting list of ID-relevancelevel pairs is translated back to URLs using an URL2FTS accessor.

Please note that I am aware that this needs refactoring: we should have an ULRToID accessor superclass, which provides the necessary translation services, without being fixed on a given data representation.

In the second case, we do not need any additional information: we dispatch a query() (as opposed to fastQuery()) to the child nodes, and then we merge the results. This means we have to merge plenty of XML.

Author:
: Wolfgang Müller


Member Function Documentation

static void* CQMultiple::doFastQueryThread void *   )  [static]
 

This function processes is in the inner loop of fastQuery.

If multithreading is possible on the system on which GIFT was compiled, then this function will run in a thread, and fastQuery will wait for it

static void* CQMultiple::doQueryThread void *   )  [static]
 

This function processes is in the inner loop of query.

If multithreading is possible on the system on which GIFT was compiled, then this function will run in a thread, and fastQuery will wait for it

virtual bool CQMultiple::setAlgorithm CAlgorithm inAlgorithm  )  [virtual]
 

set the Algorithm.

same scheme as in setCollection

Reimplemented from CQuery.


The documentation for this class was generated from the following file:
Need for discussion? Want to contribute? Contact
help-gift@gnu.org Generated using Doxygen