System documentation of the GNU Image-Finding Tool

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

CAcHierarchy Class Reference

A very simple accessor for hierarchies of images Stored in an XML file. More...

#include <CAcHierarchy.h>

Inheritance diagram for CAcHierarchy:

CAccessorImplementation CAccessor List of all members.

Public Member Functions

 CAcHierarchy (const CXMLElement &inConfiguration)
 constructor opens a hierarchy file and reads it.

CIDRelevanceLevelPairList * getChildren (const CPath &inID) const
 Gets a list of all children of an element.

void addElement (TID inID, string inLocation, string inThumbnail)
 Adds an element to the collection.

void push (TID inNode)
 pushes the node onto the stack

void popNodeAndRegisterEdge ()
 pops the node and registers the edge from new top to old top and back

 operator bool () const
 has this been successfully read?


Protected Types

typedef list< TID > CPath
 In fact, because images can arise multiple times in the hierarchy, it is necessary to store the full path for each time the image arises in the tree.

typedef list< TID > CChildren
 This class is there for mnemonic reasons only.

typedef map< CPath, CChildrenCGraph
 The graph is represented as a map from path to children.


Protected Member Functions

void init (string inFileName)
 called immediately by the constructor, this function does the main construction work.

void addEdge (const CPath &inFather, TID inSon)
 adds an edge from father to son and an edge from son to father


Protected Attributes

CMutex mMutexHierarchy
 mutual exclude for multithreading

bool isOK
 is this well constructed ?

CPath mNodeStack
 A stack of the nodes visited when building the hierarchy.

CGraph mEdges
 Edges: The edges from father to son.


Detailed Description

A very simple accessor for hierarchies of images Stored in an XML file.

This was intended as the ultra simple example system for the browser benchmarking paper. It performed too bad in our benchmark to be taken seriously.

Currently I see the use of this as the base for systems, where the author knows how to generate a hierarchy of images, but the author fears the overhead needed for including his/her system into the gift.

Please note that IDs must start at 1 (ONE!!!).

Author:
Wolfgang Müller


Member Typedef Documentation

typedef list<TID> CAcHierarchy::CChildren [protected]
 

This class is there for mnemonic reasons only.

Evidently it has the same type as CPath, however it designates a list of children.

typedef map<CPath,CChildren> CAcHierarchy::CGraph [protected]
 

The graph is represented as a map from path to children.

See also:
CPath for an explanation

typedef list<TID> CAcHierarchy::CPath [protected]
 

In fact, because images can arise multiple times in the hierarchy, it is necessary to store the full path for each time the image arises in the tree.

We base this on the idea that in each selection, each image will arise at most once. As a consequence, lists of selected images must be sufficient to define the path from the hierarchy's root to a given node or leaf of the hierarchy.


Constructor & Destructor Documentation

CAcHierarchy::CAcHierarchy const CXMLElement inConfiguration  ) 
 

constructor opens a hierarchy file and reads it.

Like every accessor, this accessor takes a <collection /> MRML element as input (

See also:
CXMLElement for how to access the attributes of this element). Currently this accessor understands the following attributes:
cui-base-dir: the base directory containing the following file: cui-hierarchy-file-location: an xml file containing the hierarchy that you can browse using this accessor.


Member Function Documentation

CIDRelevanceLevelPairList* CAcHierarchy::getChildren const CPath inID  )  const
 

Gets a list of all children of an element.

As it was said before, an element of the hierarchy is well described by a path in the tree, from the root to this element.

void CAcHierarchy::init string  inFileName  )  [protected]
 

called immediately by the constructor, this function does the main construction work.

Starts the xml parser for reading the hierarchy file etc.


Member Data Documentation

CGraph CAcHierarchy::mEdges [protected]
 

Edges: The edges from father to son.

The edges from son to father are not needed, because it means simply popping from the path.


The documentation for this class was generated from the following file:
Need for discussion? Want to contribute? Contact
help-gift@gnu.org Generated using Doxygen