CAlgorithm Class

# CAlgorithm Class Reference

[CADIHash.h Index] [CADIHash.h Hierarchy]

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

`#include <../libInvertedFile/include/CAlgorithm.h>`

Inherits: CXMLElement

## Public Members

- virtual void addChild (const string&, const char* const* const inAttributeList=0)
- virtual void addChild (CXMLElement* inChild)
- bool configure (CAlgorithmCollection& inBaseConfiguration)
- void mergeAttributes (const CAlgorithm& inAlgorithm)
- void mergeChildLists (const CAlgorithm& inAlgorithm)
- string getCollectionID ()
- double getWeight ()
- string getAlgorithmName ()
- pair<bool,string> getType ()
- string getBaseType ()
- string getID ()
- string toOldMRML ()
- void setDefault (CAlgorithm& inDefault)
- CAlgorithm* clone ()
- CAlgorithm (const char* , const char* const* const inAttributeList=0)
- CAlgorithm (const string& , const list< pair<string,string> >& inList)
- CAlgorithm (const CAlgorithm& inAlgorithm)

## Detailed Description

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

@Author: Wolfgang Müller

## 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)

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 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 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

## string getCollectionID()

get the name of the collection to be treated by this algorithm

## double getWeight()

get the name of the algorithm

## string getAlgorithmName()

get the name of the algorithm

## pair<bool,string> getType()

get the type of the algorithm

## string getBaseType()

get the basetype of the algorithm

## string getID()

get the id of the algorithm

## string toOldMRML()

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

## CAlgorithm* clone()

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 CAlgorithm& inAlgorithm)

copy constructor

| Kdoc