System documentation of the GNU Image-Finding Tool

CAcHierarchy.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 _CACHIERARCHY
27 #define _CACHIERARCHY
28 #include "libGIFTAcHierarchy/include/uses-declarations.h"
29 #include <list>
30 #include <map>
31 #include "libMRML/include/CAccessorImplementation.h"
32 
33 class CXMLElement;
34 #include "libMRML/include/CIDRelevanceLevelPairList.h"
35 #include "libMRML/include/CMutex.h" // multithreading
53 protected:
57  bool isOK;
69  typedef list<TID> CPath;
74  typedef list<TID> CChildren;
78  CPath mNodeStack;
83  typedef map<CPath,CChildren> CGraph;
89  CGraph mEdges;
96  void init(string inFileName);
101  void addEdge(const CPath& inFather,
102  TID inSon);
103 
104 public:
117  CAcHierarchy(const CXMLElement& inConfiguration);
123  CIDRelevanceLevelPairList* getChildren(const CPath& inID)const;
127  void addElement(TID inID,
128  string inLocation,
129  string inThumbnail);
135  void push(TID inNode);
142  void popNodeAndRegisterEdge();
146  operator bool()const;
147 };
148 
149 #endif
CMutex mMutexHierarchy
mutual exclude for multithreading
Definition: CAcHierarchy.h:55
CPath mNodeStack
A stack of the nodes visited when building the hierarchy.
Definition: CAcHierarchy.h:78
CGraph mEdges
Edges: The edges from father to son.
Definition: CAcHierarchy.h:89
Definition: CIDRelevanceLevelPairList.h:52
void addElement(TID inID, string inLocation, string inThumbnail)
Adds an element to the collection.
void popNodeAndRegisterEdge()
pops the node and registers the edge from new top to old top and back
This class captures the structure of an XML element.
Definition: CXMLElement.h:51
bool isOK
is this well constructed ?
Definition: CAcHierarchy.h:57
map< CPath, CChildren > CGraph
The graph is represented as a map from path to children.
Definition: CAcHierarchy.h:83
list< TID > CChildren
This class is there for mnemonic reasons only.
Definition: CAcHierarchy.h:74
A very simple accessor for hierarchies of images Stored in an XML file.
Definition: CAcHierarchy.h:52
void init(string inFileName)
called immediately by the constructor, this function does the main construction work.
list< TID > CPath
In fact, because images can arise multiple times in the hierarchy, it is necessary to store the full ...
Definition: CAcHierarchy.h:69
CIDRelevanceLevelPairList * getChildren(const CPath &inID) const
Gets a list of all children of an element.
This class offers an abstraction from the locking method used.
Definition: CMutex.h:40
CAccessorImplementation - a base class for everything accessing a GIFT database.
Definition: CAccessorImplementation.h:92
CAcHierarchy(const CXMLElement &inConfiguration)
constructor opens a hierarchy file and reads it.
void push(TID inNode)
pushes the node onto the stack
void addEdge(const CPath &inFather, TID inSon)
adds an edge from father to son and an edge from son to father

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