00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _CALGORITHM
00028 #define _CALGORITHM
00029 #include "libMRML/include/uses-declarations.h"
00030 #include "libMRML/include/CXMLElement.h"
00031 #include "libMRML/include/CSelfDestroyPointer.h"
00032 #include <map>
00033
00034 class CQuery;
00035 class CAlgorithmCollection;
00043 class CAlgorithm:public CXMLElement{
00044 protected:
00045 public:
00049 virtual void addChild(const string&,
00050 const char* const* const inAttributeList=0);
00054 virtual void addChild(CXMLElement* inChild);
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00077 bool configure(CAlgorithmCollection& inBaseConfiguration);
00090 void mergeAttributes(const CAlgorithm& inAlgorithm);
00103 void mergeChildLists(const CAlgorithm& inAlgorithm);
00106 string getCollectionID()const;
00109 double getWeight()const;
00112 string getAlgorithmName()const;
00115 pair<bool,string> getType()const;
00119 pair<bool,string> getInheritsFrom()const;
00122 string getBaseType()const;
00125 string getID()const;
00127 string toOldMRML()const;
00131 void setDefault(CAlgorithm& inDefault);
00133 CAlgorithm* clone()const;
00135 CAlgorithm(const char* ,
00136 const char* const* const inAttributeList=0);
00138 CAlgorithm(const string& ,
00139 const list< pair<string,string> >& inList);
00141 CAlgorithm(const CXMLElement& inAlgorithm);
00143 CAlgorithm(const CAlgorithm& inAlgorithm);
00144 };
00145
00146
00147
00148
00149
00150 class CSortByID_CA:public binary_function<const CAlgorithm&,const CAlgorithm&,bool>{
00151 public:
00152 bool operator()(const CAlgorithm& l,
00153 const CAlgorithm& t)const;
00154 };
00155
00156
00157
00158 class CSortByBase_CA:public binary_function<const CAlgorithm&,const CAlgorithm&,bool>{
00159 public:
00160 bool operator()(const CAlgorithm& l,
00161 const CAlgorithm& t)const;
00162 };
00163
00164 #endif