System documentation of the GNU Image-Finding Tool

CAlgorithmCollection.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 #ifndef _CALGORITHMCOLLECTION
27 #define _CALGORITHMCOLLECTION
28 #include "libMRML/include/uses-declarations.h"
29 #include <string>
30 #include <map>
31 #include "libMRML/include/CAlgorithm.h"
32 #ifdef LINK_DYNAMICALLY
33 #include "libMRML/include/CStaticQueryFactory.h"
34 #else
35 #include "libMRML/include/CDynamicQueryFactory.h"
36 #endif
37 #include "libMRML/include/CXMLElement.h" // for toXMLElement
38 
40 
41 
59 protected:
65 protected:
66  typedef map<string,CAlgorithm*> CContent;
67 
70  CContent mContent;
72  CContent::const_iterator begin()const;
74  CContent::const_iterator end()const;
75 public:
76  //----------------------------------------
81  //----------------------------------------
84  void startAlgorithmConstruction(CAlgorithm* inAlgorithm);
86  CAlgorithmCollection(string inConfigFileName);
91  void addAlgorithm(CAlgorithm* inAlgorithm);
95  CAlgorithm& getAlgorithmByType(const string& inType)const;
99  bool containsAlgorithmByType(const string& inType)const;
106  CAlgorithm* makeAlgorithmByType(const string& inType)const;
107  //----------------------------------------
113  //----------------------------------------
117  //----------------------------------------
122  CXMLElement* getAlgorithmList(const CXMLElement& inGetAlgorithms)const;
123  //----------------------------------------
126  string toXML(bool inIsPrivate=false)const;
130  CXMLElement* toXMLElement()const;
132  CQuery* makeQuery(const string & inBaseType,
133  CAccessorAdminCollection & inAccessorAdminCollection,
134  CAlgorithm & inAlgorithm,
135  CStaticQueryFactory& inFactory);
136 
137 };
138 #endif
CAlgorithm & getAlgorithmByType(const string &inType) const
Algorithm for TYPE => permits configuring probably only the pointered version is interesting.
CContent::const_iterator end() const
for being able to read all the content
The algorithm collection is kind of a factory for CQuery structures:
Definition: CAlgorithmCollection.h:58
bool containsAlgorithmByType(const string &inType) const
Algorithm for TYPE => permits configuring probably only the pointered version is interesting.
This class captures the structure of an XML element.
Definition: CXMLElement.h:51
CXMLElement * getAlgorithmList(const CXMLElement &inGetAlgorithms) const
For handshaking: This makes you a list of all algorithms which work with a given query paradigm...
map< string, CAlgorithm * > CContent
The content of an algorithm collection is a map between algorihm type and a pointer to the correspond...
Definition: CAlgorithmCollection.h:66
CXMLElement * toXMLElement() const
for get-algorithms: the output is an CXMLElement, containing an algorithm-list element.
CContent::const_iterator begin() const
for being able to read all the content
CAlgorithm * getDefaultAlgorithm() const
A default algorithm for the default session This algorithm will be given by the ONE ALGORITHM which h...
An algorithm is a CXMLElement which is linked to a CSessionManager together they are able to build CQ...
Definition: CAlgorithm.h:43
~CAlgorithmCollection()
Destructor destroys all members of CContent.
The Query manager for Queries on inverted Files.
Definition: CQuery.h:73
A factory for base types of algorithms.
Definition: CStaticQueryFactory.h:38
This is in fact a collection of collections.
Definition: CAccessorAdminCollection.h:39
CAlgorithm * mAlgorithmInConstruction
as the name sais
Definition: CAlgorithmCollection.h:61
string toXML(bool inIsPrivate=false) const
for shandshake and for state output
void addAlgorithm(CAlgorithm *inAlgorithm)
adding a completely built algorithm XML document tree
CQuery * makeQuery(const string &inBaseType, CAccessorAdminCollection &inAccessorAdminCollection, CAlgorithm &inAlgorithm, CStaticQueryFactory &inFactory)
handed through to the CStaticQueryFactory
CAlgorithmCollection(string inConfigFileName)
Constructor.
CAlgorithm * makeDefaultAlgorithm() const
creates a copy of what you&#39;d get with the above function get...
CAlgorithm * getAlgorithmInConstruction()
returns a pointer to the algorithm in construction
CAlgorithm * makeAlgorithmByType(const string &inType) const
Creates a new algorithm for agiven type by cloning what you would get with getAlgorithm.

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