System documentation of the GNU Image-Finding Tool

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CQMultiple Class Reference

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

#include <CQMultiple.h>

Inheritance diagram for CQMultiple:
CQuery CMagic

Public Member Functions

 CQMultiple ()
 default constructor More...
 
 ~CQMultiple ()
 we need to unregister the accessors used More...
 
 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 CIDRelevanceLevelPairListfastQuery (const CXMLElement &inQuery, int inNumberOfInterestingImages, double inDifferenceToBest)
 calls fastQuery for every child, merges the results More...
 
virtual CXMLElementquery (const CXMLElement &inQuery)
 calls query for every child, merges the results by URLs More...
 
virtual bool setAlgorithm (CAlgorithm &inAlgorithm)
 set the Algorithm. More...
 
- Public Member Functions inherited from CQuery
 CQuery ()
 default constructor More...
 
virtual ~CQuery ()
 destructor More...
 
 CQuery (CAccessorAdminCollection &inAccessorAdminCollection, CAlgorithm &inAlgorithm)
 this constructor takes all the information ANY CQuery needs to configure itself. More...
 
void addChild (CQuery *inChild, double inWeight=1)
 adding a child to this. More...
 
virtual CXMLElementgetRandomImages (int inNumberOfInterestingImages) const
 get some random images (handed through to accessor) More...
 
virtual CIDRelevanceLevelPairListgetRandomIDs (int inNumberOfInterestingImages) const
 get some random images (handed through to accessor) More...
 
virtual list< TID > * getAllIDs () const
 get the IDs of all images (handed through to accessor) More...
 
virtual list< CAccessorElement > * getAllAccessorElements () const
 get the IDs of all images (handed through to accessor) More...
 
const CAlgorithmgetAlgorithm () const
 get the Algorithm. More...
 
virtual void finishInit ()
 it might be necessary to wait until all the children are added before ending the initialisation phase. More...
 
- Public Member Functions inherited from CMagic
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. More...
 
static void * doQueryThread (void *)
 This function processes is in the inner loop of query. More...
 

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?
 
- Protected Attributes inherited from CQuery
CAccessormAccessor
 needed to translate URLs to IDs this is a pointer, only because we cannot change references it does not imply any destruction responsability
 
CAccessorAdminmAccessorAdmin
 This is where the the Accessor comes from. More...
 
CAccessorAdminCollectionmAccessorAdminCollection
 Where to get CAccessorAdmins from.
 
CAlgorithmmAlgorithm
 the structure containing everything we know about the algorithm used do not destroy this
 
lCChildren mChildren
 The children of this.
 

Additional Inherited Members

- Protected Types inherited from CQuery
typedef list< lCChildlCChildren
 type for children of this
 

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.

: Wolfgang Müller

Constructor & Destructor Documentation

§ CQMultiple()

CQMultiple::CQMultiple ( )

default constructor

§ ~CQMultiple()

CQMultiple::~CQMultiple ( )

we need to unregister the accessors used

Member Function Documentation

§ doFastQueryThread()

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

§ doQueryThread()

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

§ fastQuery()

virtual CIDRelevanceLevelPairList* CQMultiple::fastQuery ( const CXMLElement inQuery,
int  inNumberOfInterestingImages,
double  inDifferenceToBest 
)
virtual

calls fastQuery for every child, merges the results

Implements CQuery.

§ query()

virtual CXMLElement* CQMultiple::query ( const CXMLElement inQuery)
virtual

calls query for every child, merges the results by URLs

Reimplemented from CQuery.

§ setAlgorithm()

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