00001 #ifndef HEURISTIC_FACTORY_H 00002 #define HEURISTIC_FACTORY_H 00003 00004 //-------------------------------------------------------------------- 00005 // 00006 // This file is part of PEACE. 00007 // 00008 // PEACE is free software: you can redistribute it and/or modify it 00009 // under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation, either version 3 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // PEACE is distributed in the hope that it will be useful, but 00014 // WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 // General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with PEACE. If not, see <http://www.gnu.org/licenses/>. 00020 // 00021 // Miami University makes no representations or warranties about the 00022 // suitability of the software, either express or implied, including 00023 // but not limited to the implied warranties of merchantability, 00024 // fitness for a particular purpose, or non-infringement. Miami 00025 // University shall not be liable for any damages suffered by licensee 00026 // as a result of using, result of using, modifying or distributing 00027 // this software or its derivatives. 00028 // 00029 // By using or copying this Software, Licensee agrees to abide by the 00030 // intellectual property laws, and all other applicable laws of the 00031 // U.S., and the terms of GNU General Public License (version 3). 00032 // 00033 // Authors: Dhananjai M. Rao raodm@muohio.edu 00034 // 00035 //--------------------------------------------------------------------- 00036 00037 #include <iostream> 00038 00039 // For declaration to make compiler happy. 00040 class Heuristic; 00041 00042 class HeuristicFactory { 00043 public: 00044 /** Method to instantiate a suitable heuristic. 00045 00046 This method must be used to instantiate a suitable heuristic 00047 instance. This method uses the name (parameter) to 00048 suitably instantiate a heuristic. If the name is not 00049 valid, then this method returns NULL. 00050 00051 \param[in] name The name of the heuristic to be instantiated. 00052 00053 \param[in] refESTidx The reference EST index value to be used 00054 when instantiating a heuristic. Index values start from 0 00055 (zero). If this value is negative then this method returns 00056 NULL. 00057 00058 \param[in] outputFileName The target file to which the 00059 analysis report is to be written (if any). Note that this 00060 parameter may be ignored if this heuristic is used to generate 00061 clusters. If the value of outputFileName is "" (empty string) 00062 then the outputs are streamed to standard out. 00063 */ 00064 static Heuristic* create(const char* name, const int refESTidx, 00065 const std::string& outputFileName); 00066 00067 /** Method to display the list of heuristics available. 00068 00069 This method is typically used to display the list of 00070 heuristics currently available. This method is typically used 00071 in the main() method when displaying usage information. 00072 00073 \param[out] os The output stream to which the list of heuristic 00074 names must be written. 00075 */ 00076 static void displayList(std::ostream& os); 00077 00078 protected: 00079 // Currently this class has no protected members. 00080 00081 private: 00082 /** The default constructor. 00083 00084 The default constructor has is private in order to ensure that 00085 this class is never instantiated. Instead, the static methods 00086 in this class must be directly used to instantiate a heuristic. 00087 */ 00088 HeuristicFactory() {} 00089 00090 /** The destructor. 00091 00092 The destructor is private to ensure that objects of this class 00093 are never deleted. 00094 */ 00095 ~HeuristicFactory() {} 00096 }; 00097 00098 #endif