00001 /* 00002 * Copyright (C) 2008 Kamil Dudka <xdudka00@stud.fit.vutbr.cz> 00003 * 00004 * This file is part of fss (Fast SAT Solver). 00005 * 00006 * fss is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation, either version 3 of the License, or 00009 * any later version. 00010 * 00011 * fss is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with fss. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #ifndef SATSOLVEROBSERVER_H 00021 #define SATSOLVEROBSERVER_H 00022 00032 #include <iostream> 00033 #include "SatSolver.h" 00034 00035 namespace FastSatSolver { 00036 00041 class TimedStop: public IObserver { 00042 public: 00047 TimedStop(AbstractProcessWatched *process, long msec); 00048 virtual ~TimedStop(); 00049 virtual void notify(); 00050 private: 00051 struct Private; 00052 Private *d; 00053 }; 00054 00059 class ProgressWatch: public IObserver { 00060 public: 00066 ProgressWatch( 00067 AbstractProcess *process, 00068 int stepsTotal, 00069 std::ostream &streamTo); 00070 00071 virtual ~ProgressWatch(); 00072 virtual void notify(); 00073 private: 00074 struct Private; 00075 Private *d; 00076 }; 00077 00083 class SolutionsCountStop: public IObserver { 00084 public: 00089 SolutionsCountStop(AbstractSatSolver *solver, int minCountOfSolutions); 00090 virtual ~SolutionsCountStop(); 00091 virtual void notify(); 00092 private: 00093 struct Private; 00094 Private *d; 00095 }; 00096 00101 class FitnessWatch: public IObserver { 00102 public: 00107 FitnessWatch(AbstractSatSolver *solver, std::ostream &streamTo); 00108 virtual ~FitnessWatch(); 00109 virtual void notify(); 00110 void reset(); 00111 private: 00112 struct Private; 00113 Private *d; 00114 }; 00115 00120 class ResultsWatch: public IObserver { 00121 public: 00126 ResultsWatch(AbstractSatSolver *solver, std::ostream &streamTo); 00127 virtual ~ResultsWatch(); 00128 virtual void notify(); 00129 private: 00130 struct Private; 00131 Private *d; 00132 }; 00133 00134 } // namespace FastSatSolver 00135 00136 #endif // SATSOLVEROBSERVER_H