The Query manager for Queries on inverted Files. More...
#include <CQuery.h>
Classes | |
| class | lCChild |
| A child of this. More... | |
Public Member Functions | |
| 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 CXMLElement * | query (const CXMLElement &inQuery) |
| do a query More... | |
| virtual CIDRelevanceLevelPairList * | fastQuery (const CXMLElement &inQuery, int inNumberOfInterestingImages, double inDifferenceToBest)=0 |
| a query which returns ID/RelevanceLevel pairs instead of instead of URL/RelevanceLevel pairs More... | |
| virtual CXMLElement * | getRandomImages (int inNumberOfInterestingImages) const |
| get some random images (handed through to accessor) More... | |
| virtual CIDRelevanceLevelPairList * | getRandomIDs (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... | |
| virtual bool | setAlgorithm (CAlgorithm &inAlgorithm) |
| set the Algorithm. More... | |
| const CAlgorithm & | getAlgorithm () 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) | |
Protected Types | |
| typedef list< lCChild > | lCChildren |
| type for children of this | |
Protected Member Functions | |
| virtual void | init ()=0 |
| Initializer, used by both construcors. More... | |
Protected Attributes | |
| 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. More... | |
| 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. | |
The Query manager for Queries on inverted Files.
| CQuery::CQuery | ( | ) |
default constructor
|
virtual |
destructor
| CQuery::CQuery | ( | CAccessorAdminCollection & | inAccessorAdminCollection, |
| CAlgorithm & | inAlgorithm | ||
| ) |
| void CQuery::addChild | ( | CQuery * | inChild, |
| double | inWeight = 1 |
||
| ) |
adding a child to this.
We expect children to be nonzero and initialised when they are entered. this assumes no destruction responsabilities for the entered data.
|
pure virtual |
a query which returns ID/RelevanceLevel pairs instead of instead of URL/RelevanceLevel pairs
Implemented in CQInvertedFile, CQParallel, CQMultiple, and CQHierarchy.
|
virtual |
it might be necessary to wait until all the children are added before ending the initialisation phase.
This function is called by CAlgorithm.
Reimplemented in CQParallel, and CQInvertedFile.
| const CAlgorithm& CQuery::getAlgorithm | ( | ) | const |
get the Algorithm.
same scheme as in setCollection
|
virtual |
get the IDs of all images (handed through to accessor)
|
virtual |
get the IDs of all images (handed through to accessor)
Reimplemented in CQParallel.
|
virtual |
get some random images (handed through to accessor)
|
virtual |
get some random images (handed through to accessor)
Reimplemented in CQParallel.
|
protectedpure virtual |
Initializer, used by both construcors.
Implemented in CQInvertedFile, CQParallel, CQMultiple, and CQHierarchy.
|
virtual |
do a query
Reimplemented in CQMultiple.
|
virtual |
set the Algorithm.
set a new algorithm. Build a new query if necessary.
Reimplemented in CQParallel, CQInvertedFile, CQMultiple, and CQHierarchy.
|
protected |
This is where the the Accessor comes from.
Also the AccessorAdmin is not to be deleted by this.