System documentation of the GNU Image-Finding Tool

Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members

CQPerl.h

00001 /* -*- mode: c++ -*- 
00002 */
00003 /* 
00004 
00005     GIFT, a flexible content based image retrieval system.
00006     Copyright (C) 1998, 1999, 2000, 2001, 2002, CUI University of Geneva
00007 
00008     This program is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program; if not, write to the Free Software
00020     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 
00022 */
00023 // -*- mode: c++ -*-
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

Need for discussion? Want to contribute? Contact
help-gift@gnu.org Generated using Doxygen