System documentation of the GNU Image-Finding Tool

CAcPerl.h
1 /* -*- mode: c++ -*-
2 */
3 /*
4 
5  GIFT, a flexible content based image retrieval system.
6  Copyright (C) 1998, 1999, 2000, 2001, 2002, CUI University of Geneva
7 
8  Copyright (C) 2003, 2004 Bayreuth University
9  2005 Bamberg University
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 
24 */
25 #include "../../gift-config.h"
26 #ifdef __GIFT_WITH_PERL__
27 // -*- mode: c++ -*-
28 #ifndef _CACPERL
29 #define _CACPERL
30 #include "libGIFTAcPerl/include/uses-declarations.h"
47 #include <string>
48 #include "libMRML/include/TID.h"
49 #include <iostream>
50 #include <fstream>
51 #include <list>
52 #include <map>
53 #ifdef HAS_HASH_MAP
54 #include <hash_map>
55 #else
56 #define hash_map map
57 #endif
58 #include "libMRML/include/CAccessor.h"
59 #include "libMRML/include/CSelfDestroyPointer.h"
60 
61 class CXMLElement;//constructor
62 
72 class CAcPerl:public CAccessor{
73  private:
78  CSelfDestroyPointer<CXMLElement> mCollectionElement;
79 
80 public:
81 
94  CAcPerl(const CXMLElement& inContentElement);
98  ~CAcPerl();
99 
105  virtual operator bool()const;
106 
113  CXMLElement* cloneCollectionElement()const;
117  string IDToURL(long int) const;
121  struct pair<bool,CAccessorElement> IDToAccessorElement(long int) const;
125  struct pair<bool,long int> URLToID(const string &) const;
129  void getAllIDs(list<TID> &) const;
133  void getAllAccessorElements(list<CAccessorElement> &) const;
137  void getRandomIDs(list<long int > &, unsigned int) const;
141  void getRandomAccessorElements(list<CAccessorElement > &, unsigned int) const;
145  int size() const;
146 
147 
148 };
149 
150 #endif
151 #endif
Quadruplet of Image-ID, image-URL, thumbnail-URL, feature file name and assorted sorting functions...
Definition: CAccessorElement.h:12
virtual void getRandomIDs(list< TID > &, list< TID >::size_type) const =0
get a given number of random AccessorElement&#39;s
virtual void getAllAccessorElements(list< CAccessorElement > &) const =0
List of triplets (ID,imageURL,thumbnailURL) of all the documents present in the inverted file...
This class captures the structure of an XML element.
Definition: CXMLElement.h:51
virtual void getAllIDs(list< TID > &) const =0
This is useful for making lists of which images are present in a database etc.
CAccessor - an abstract base class for everything accessing a GIFT database.
Definition: CAccessor.h:55
virtual string IDToURL(TID inID) const =0
Translate a DocumentID to a URL (for output)
virtual int size() const =0
The number of images in this accessor.
virtual void getRandomAccessorElements(list< CAccessorElement > &outResult, list< CAccessorElement >::size_type inSize) const =0
For drawing random sets.

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