System documentation of the GNU Image-Finding Tool

CAlgorithm.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 // -*- mode: c++ -*-
26 
27 #ifndef _CALGORITHM
28 #define _CALGORITHM
29 #include "libMRML/include/uses-declarations.h"
30 #include "libMRML/include/CXMLElement.h"
31 #include "libMRML/include/CSelfDestroyPointer.h"
32 #include <map>
33 
34 class CQuery;
43 class CAlgorithm:public CXMLElement{
44 protected:
45 public:
49  virtual void addChild(const string&,
50  const char* const* const inAttributeList=0);
54  virtual void addChild(CXMLElement* inChild);
55 
56  // /** reading an attribute for strings
57 
58  // here we extend the inheritance mechanism. We do not only look at
59  // parents, but also at the default values provided by the configuration.
60 
61  // this is virtual in order to plug in other methods of inheritance
62 
63  // @see: CXMLElement.h#stringReadAttribute
64  // */
65  // virtual pair<bool,string> stringReadAttribute(const string& inAttribute)const;
77  bool configure(CAlgorithmCollection& inBaseConfiguration);
90  void mergeAttributes(const CAlgorithm& inAlgorithm);
103  void mergeChildLists(const CAlgorithm& inAlgorithm);
106  string getCollectionID()const;
109  double getWeight()const;
112  string getAlgorithmName()const;
115  pair<bool,string> getType()const;
119  pair<bool,string> getInheritsFrom()const;
122  string getBaseType()const;
125  string getID()const;
127  string toOldMRML()const;
131  void setDefault(CAlgorithm& inDefault);
133  CAlgorithm* clone()const;
135  CAlgorithm(const char* ,
136  const char* const* const inAttributeList=0);
138  CAlgorithm(const string& ,
139  const list< pair<string,string> >& inList);
141  CAlgorithm(const CXMLElement& inAlgorithm);
143  CAlgorithm(const CAlgorithm& inAlgorithm);
144 };
145 
146 
147 //----------------------------------------
148 //probably obsolete
149 //----------------------------------------
150 class CSortByID_CA:public binary_function<const CAlgorithm&,const CAlgorithm&,bool>{
151 public:
152  bool operator()(const CAlgorithm& l,
153  const CAlgorithm& t)const;
154 };
155 //----------------------------------------
156 //probably obsolete
157 //----------------------------------------
158 class CSortByBase_CA:public binary_function<const CAlgorithm&,const CAlgorithm&,bool>{
159 public:
160  bool operator()(const CAlgorithm& l,
161  const CAlgorithm& t)const;
162 };
163 
164 #endif
string getID() const
get the id of the algorithm
Definition: CAlgorithm.h:158
The algorithm collection is kind of a factory for CQuery structures:
Definition: CAlgorithmCollection.h:58
string getAlgorithmName() const
get the name of the algorithm
This class captures the structure of an XML element.
Definition: CXMLElement.h:51
void setDefault(CAlgorithm &inDefault)
set the default we do not take any destroy responsability
CAlgorithm * clone() const
clone this
string getBaseType() const
get the basetype of the algorithm
double getWeight() const
get the name of the algorithm
An algorithm is a CXMLElement which is linked to a CSessionManager together they are able to build CQ...
Definition: CAlgorithm.h:43
Definition: CAlgorithm.h:150
The Query manager for Queries on inverted Files.
Definition: CQuery.h:73
bool configure(CAlgorithmCollection &inBaseConfiguration)
reading an attribute for strings
pair< bool, string > getType() const
get the type of the algorithm
string getCollectionID() const
get the name of the collection to be treated by this algorithm
void mergeAttributes(const CAlgorithm &inAlgorithm)
merging the attributes of two algorithms.
CAlgorithm(const char *, const char *const *const inAttributeList=0)
hand things through to the CXMLElement constructor
string toOldMRML() const
puts out a flat algorithm tag with just ID and name
void mergeChildLists(const CAlgorithm &inAlgorithm)
merging the child lists of two algorithms.
virtual void addChild(const string &, const char *const *const inAttributeList=0)
Same as in CXMLElement, but making a CAlgorithm instead.
pair< bool, string > getInheritsFrom() const
The father inside the configuration.

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