System documentation of the GNU Image-Finding Tool

Public Member Functions
CAlgorithm Class Reference

An algorithm is a CXMLElement which is linked to a CSessionManager together they are able to build CQuery trees. More...

#include <CAlgorithm.h>

Inheritance diagram for CAlgorithm:
CXMLElement CMagic CNoDelete

List of all members.

Public Member Functions

virtual void addChild (const string &, const char *const *const inAttributeList=0)
 Same as in CXMLElement, but making a CAlgorithm instead.
virtual void addChild (CXMLElement *inChild)
 Same as in CXMLElement, but making a CAlgorithm instead.
bool configure (CAlgorithmCollection &inBaseConfiguration)
 reading an attribute for strings
void mergeAttributes (const CAlgorithm &inAlgorithm)
 merging the attributes of two algorithms.
void mergeChildLists (const CAlgorithm &inAlgorithm)
 merging the child lists of two algorithms.
string getCollectionID () const
 get the name of the collection to be treated by this algorithm
double getWeight () const
 get the name of the algorithm
string getAlgorithmName () const
 get the name of the algorithm
pair< bool, string > getType () const
 get the type of the algorithm
pair< bool, string > getInheritsFrom () const
 The father inside the configuration.
string getBaseType () const
 get the basetype of the algorithm
string getID () const
 get the id of the algorithm
string toOldMRML () const
 puts out a flat algorithm tag with just ID and name
void setDefault (CAlgorithm &inDefault)
 set the default we do not take any destroy responsability
CAlgorithmclone () const
 clone this
 CAlgorithm (const char *, const char *const *const inAttributeList=0)
 hand things through to the CXMLElement constructor
 CAlgorithm (const string &, const list< pair< string, string > > &inList)
 hand things through to the CXMLElement constructor
 CAlgorithm (const CXMLElement &inAlgorithm)
 construct CAlgorithm from XML Element
 CAlgorithm (const CAlgorithm &inAlgorithm)
 copy constructor
- Public Member Functions inherited from CXMLElement
CXMLElementgetFather () const
 read the father of this
void addAttribute (const string &inAttribute, long inValue)
 adding an attribute for integers using the function for strings
void addAttribute (const string &inAttribute, double inValue)
 adding an attribute for doubles using using the function for strings
void addAttribute (const string &inAttribute, const string &inValue)
 adding an attribute
pair< bool, bool > boolReadAttribute (const string &inAttribute) const
 reading an attribute for booleans using stringReadAttribute it supports several pairs: yes/no true/false y/n
pair< bool, long > longReadAttribute (const string &inAttribute) const
 reading an attribute for integers using stringReadAttribute
pair< bool, double > doubleReadAttribute (const string &inAttribute) const
 reading an attribute for doubles using stringReadAttribute
virtual pair< bool, string > stringReadAttribute (const string &inAttribute) const
 reading an attribute for strings
CXMLElementclone (bool inDeep=true) const
 clone this element with all its content
void toXML (string &outString, const int=0) const
 Convert this into an XML string.
void traverse (CXMLElementVisitor &inoutVisitor) const
 Visit the subtree using a visitor.
void traverse (CXMLElementVisitor &inoutVisitor)
 Visit the subtree using a visitor (non-const version)
list< CXMLElement * >
::const_iterator 
child_list_begin () const
 For interoperating with the STL.
list< CXMLElement * >
::const_iterator 
child_list_end () const
 For interoperating with the STL.
list< CXMLElement * >::iterator child_list_begin ()
 For interoperating with the STL.
list< CXMLElement * >::iterator child_list_end ()
 For interoperating with the STL.
void moveUp ()
 make the father of the current node the new current node.
bool isSubtreeFinished () const
 A subtree is finished if the current child is identical with itself.
 CXMLElement (const string &, const char *const *const inAttributeList=0)
 Constructing this from a list which is built from what we get from expat.
virtual ~CXMLElement ()
 delete this by first deleting the children
 CXMLElement (const int inType, const string &)
 Constructing a text node from what expat gives us.
 CXMLElement (const string &inString, const list< pair< string, string > > &inList)
 Constructing this from more c++-like structures.
 CXMLElement (const string &inString, const CAttributeList &inList)
 Constructing this from more c++-like structures.
 CXMLElement (const CXMLElement &in)
 Make this a deep copy of the input.
list< pair< string, string > > * createNamedValueList () const
 For doing flat configuration, we need to find out all attributes which are visible in this algorithm.
string getText () const
 get the text of this
string getName () const
 get the name of this
int getTypeOfNode () const
 get the name of this
int getNumberOfAttributes () const
 get the number of attributes in this
void check () const
 checks consistency of attributes
- Public Member Functions inherited from CMagic
void checkNPrint () const
 as check(), but it also prints a small message to cout, saying that the check worked.
 CMagic ()
 sets the magic number to 42
 ~CMagic ()
 sets the magic number to another value (36)
- Public Member Functions inherited from CNoDelete
INLINE void activate ()
 activate this.
INLINE void deActivate ()
 activate this.
INLINE CNoDelete ()
 activate this.
INLINE ~CNoDelete ()
 activate this.

Additional Inherited Members

- Public Types inherited from CXMLElement
typedef list< CXMLElement * > lCChildren
 a typedef for simple convenience
- Static Public Attributes inherited from CXMLElement
static int const cTextNode
 This constant is destined to be a value of mTypeOfNode.
static int const cElementNode
 This constant is destined to be a value of mTypeOfNode.
- Protected Member Functions inherited from CXMLElement
void setFather (CXMLElement *)
 change the father of this
- Protected Attributes inherited from CXMLElement
CXMLElementmFather
 the father of this
CXMLElementmCurrentChild
 The child-grandchild-etc.
lCChildren mChildren
 a list containing the children of this element
CAttributeList mAttributes
 the content: attributes
string mName
 the name of this element
string mText
 The text/CData contained in this element FIXME: look at zero characters.
const int mTypeOfNode
 The kind of this node: Stroustrup would kill me for that, but I think doing some inheritance here is not really what I want, so I do some if-ing.
- Protected Attributes inherited from CNoDelete
bool mIsActivated
 is this activated

Detailed Description

An algorithm is a CXMLElement which is linked to a CSessionManager together they are able to build CQuery trees.

: Wolfgang Müller


Member Function Documentation

bool CAlgorithm::configure ( CAlgorithmCollection inBaseConfiguration)

reading an attribute for strings

here we extend the inheritance mechanism. We do not only look at parents, but also at the default values provided by the configuration.

this is virtual in order to plug in other methods of inheritance

See also:
: CXMLElement.h::stringReadAttribute In the long run, we would like to get of build query tree in this class and move it elsewhere.

The first step of this separation is the configure function, which does nothing else but putting the inherited values and the default values into the attribute list of this. After that no inheritance is necessary, and we can get at all the attributes using CXMLElement::createNamedValueList;

void CAlgorithm::mergeAttributes ( const CAlgorithm inAlgorithm)

merging the attributes of two algorithms.

This is useful:

  1. for the initial configuration
  2. for changing the configuration.

At present this merges attribute lists givig priority to the values in *this.

FIXME: slow way of merging

void CAlgorithm::mergeChildLists ( const CAlgorithm inAlgorithm)

merging the child lists of two algorithms.

This is useful:

  1. for the initial configuration
  2. for changing the configuration.

At present this merges attribute lists givig priority to the values in *this.

FIXME: slow way of merging


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