#include <CQMultiple.h>
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 CXMLElement * | query (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 () |
Do we merge the results by their URL or by their image ID? | |
Protected Attributes | |
bool | mUsesResultURLs |
do we merge result URLs or result IDs? |
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.
: Wolfgang Müller
CQMultiple::CQMultiple | ( | ) |
default constructor
CQMultiple::~CQMultiple | ( | ) |
we need to unregister the accessors used
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 CIDRelevanceLevelPairList* CQMultiple::fastQuery | ( | const CXMLElement & | inQuery, | |
int | inNumberOfInterestingImages, | |||
double | inDifferenceToBest | |||
) | [virtual] |
virtual CXMLElement* CQMultiple::query | ( | const CXMLElement & | inQuery | ) | [virtual] |
virtual bool CQMultiple::setAlgorithm | ( | CAlgorithm & | inAlgorithm | ) | [virtual] |