00001 /* 00002 * Copyright (C) 2009 by Ulrich Friedrich Klank <klank@in.tum.de> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 3 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 00019 /************************************************************************ 00020 Algorithm.h - Copyright klank 00021 00022 00023 **************************************************************************/ 00024 00025 00026 00027 #ifndef ALGORITHM_H 00028 #define ALGORITHM_H 00029 00030 #include <string> 00031 #include <vector> 00032 #include "Sensor.h" 00033 #include "Signature.h" 00034 00035 namespace cop 00036 { 00037 00038 class Evaluable 00039 { 00040 public: 00050 virtual double CheckSignature(const Signature& object, const std::vector<Sensor*> &sensors) = 0; 00054 virtual void Show(Sensor* ){}; 00058 virtual std::string GetName(){return "Algorithm";} 00063 virtual XMLTag* Save() = 0; 00064 00065 AlgorithmID_t m_AlgIndex; 00066 }; 00067 00072 template<typename T> 00073 class Algorithm : public Evaluable 00074 { 00075 public: 00076 00077 // Constructors/Destructors 00078 // 00082 Algorithm ( ){} 00089 static Algorithm<T>* AlgFactory(XMLTag* tag); 00090 00094 virtual ~Algorithm( ){} 00105 virtual T Perform(std::vector<Sensor*> sensors, RelPose* pose, Signature& object, int &numOfObjects, double& qualityMeasure) = 0; 00106 }; 00107 } 00108 #endif // ALGORITHM_H