This is going to be one of our main building blocks. More...
#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. | |
![]() | |
CQuery () | |
default constructor | |
virtual | ~CQuery () |
destructor | |
CQuery (CAccessorAdminCollection &inAccessorAdminCollection, CAlgorithm &inAlgorithm) | |
this constructor takes all the information ANY CQuery needs to configure itself. | |
void | addChild (CQuery *inChild, double inWeight=1) |
adding a child to this. | |
virtual CXMLElement * | getRandomImages (int inNumberOfInterestingImages) const |
get some random images (handed through to accessor) | |
virtual CIDRelevanceLevelPairList * | getRandomIDs (int inNumberOfInterestingImages) const |
get some random images (handed through to accessor) | |
virtual list< TID > * | getAllIDs () const |
get the IDs of all images (handed through to accessor) | |
virtual list< CAccessorElement > * | getAllAccessorElements () const |
get the IDs of all images (handed through to accessor) | |
const CAlgorithm & | getAlgorithm () const |
get the Algorithm. | |
virtual void | finishInit () |
it might be necessary to wait until all the children are added before ending the initialisation phase. | |
![]() | |
void | check () const |
This function checks the magic number of this and asserts to zero, if something is wrong, if things are ok, this function keeps quiet. | |
void | checkNPrint () const |
as check(), but it also prints a small message to cout, saying that the check worked. | |
CMagic () | |
sets the magic number to 42 | |
~CMagic () | |
sets the magic number to another value (36) |
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? | |
![]() | |
CAccessor * | mAccessor |
needed to translate URLs to IDs this is a pointer, only because we cannot change references it does not imply any destruction responsability | |
CAccessorAdmin * | mAccessorAdmin |
This is where the the Accessor comes from. | |
CAccessorAdminCollection * | mAccessorAdminCollection |
Where to get CAccessorAdmins from. | |
CAlgorithm * | mAlgorithm |
the structure containing everything we know about the algorithm used do not destroy this | |
lCChildren | mChildren |
The children of this. |
Additional Inherited Members | |
![]() | |
typedef list< lCChild > | lCChildren |
type for children of this |
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.
: Wolfgang Müller
CQMultiple::CQMultiple | ( | ) |
default constructor
CQMultiple::~CQMultiple | ( | ) |
we need to unregister the accessors used
|
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 |
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 |
calls fastQuery for every child, merges the results
Implements CQuery.
|
protectedvirtual |
Do we merge the results by their URL or by their image ID?
Implements CQuery.
|
virtual |
calls query for every child, merges the results by URLs
Reimplemented from CQuery.
|
virtual |