00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#ifndef _CQPERL
00025
#define _CQPERL
00026
#include "libGIFTQuPerl/include/uses-declarations.h"
00027
#ifdef __GIFT_WITH_PERL__
00028
00029
#ifdef bool
00030
#undef bool
00031
#define _bool char
00032
#endif
00033
00034
#include <EXTERN.h>
00035
#include <perl.h>
00036
#undef list // perl lists
00037
00038
#include <list>
00039
#include "libMRML/include/CQuery.h"
00040
00041
00046
class CQPerl:
public CQuery{
00047
protected:
00051 string mPackage;
00056 SV* mPerlQueryProcessor;
00059 string qualifyFunctionName(
const char* inName);
00061
static PerlInterpreter* mPerl;
00062
00069
CXMLElement* callPerl(
const CXMLElement* inElement,
00070 string inFunction);
00074
void callConstruct();
00075
00076
public:
00082 CQPerl(
CAccessorAdminCollection& inAccessorAdminCollection,
00083
CAlgorithm& inAlgorithm);
00089 CQPerl();
00095 ~CQPerl();
00101
virtual CXMLElement*
query(
const CXMLElement& inQuery);
00102
00109
virtual CIDRelevanceLevelPairList*
fastQuery(
const CXMLElement& inQuery,
00110
int inNumberOfInterestingImages,
00111
double inDifferenceToBest);
00112
00118
virtual CXMLElement*
getRandomImages(
int inNumberOfInterestingImages)
const;
00124
virtual CIDRelevanceLevelPairList*
getRandomIDs(
int inNumberOfInterestingImages)
const;
00130
virtual list<TID>*
getAllIDs()const;
00136 virtual list<
CAccessorElement>* getAllAccessorElements()const;
00137
00143
bool setAlgorithm(
CAlgorithm& inAlgorithm);
00144
00145
00152
void init();
00153 };
00154
00155
00156 #endif
00157
00158 #endif