An algorithm is a CXMLElement which is linked to a CSessionManager together they are able to build CQuery trees. More...
#include <CAlgorithm.h>
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 More... | |
void | mergeAttributes (const CAlgorithm &inAlgorithm) |
merging the attributes of two algorithms. More... | |
void | mergeChildLists (const CAlgorithm &inAlgorithm) |
merging the child lists of two algorithms. More... | |
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 | |
CAlgorithm * | clone () 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 | |
![]() | |
CXMLElement * | getFather () 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 More... | |
CXMLElement * | clone (bool inDeep=true) const |
clone this element with all its content More... | |
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 | |
![]() | |
void | check () const |
This function checks the magic number of this and asserts to zero, if something is wrong, if things are ok, this function keeps quiet. | |
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) | |
![]() | |
INLINE void | activate () |
activate this. More... | |
INLINE void | deActivate () |
activate this. More... | |
INLINE | CNoDelete () |
activate this. More... | |
INLINE | ~CNoDelete () |
activate this. More... | |
Additional Inherited Members | |
![]() | |
typedef list< CXMLElement * > | lCChildren |
a typedef for simple convenience | |
![]() | |
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. | |
![]() | |
void | setFather (CXMLElement *) |
change the father of this | |
![]() | |
CXMLElement * | mFather |
the father of this | |
CXMLElement * | mCurrentChild |
The child-grandchild-etc. More... | |
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. | |
![]() | |
bool | mIsActivated |
is this activated | |
An algorithm is a CXMLElement which is linked to a CSessionManager together they are able to build CQuery trees.
: Wolfgang Müller
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
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:
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:
At present this merges attribute lists givig priority to the values in *this.
FIXME: slow way of merging