EvolvingObjects
|
00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- 00002 00003 // (c) Marc Schoenauer, Maarten Keijzer and GeNeura Team, 2000 00004 /* 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 Contact: todos@geneura.ugr.es, http://geneura.ugr.es 00020 Marc.Schoenauer@polytechnique.fr 00021 mak@dhi.dk 00022 */ 00023 00024 #ifndef _eoMonitor_h 00025 #define _eoMonitor_h 00026 00027 00028 #include <vector> 00029 #include <iostream> 00030 #include <eoFunctor.h> 00031 00046 class eoParam; 00047 template <class EOT> class eoCheckPoint; 00048 00058 class eoMonitor : public eoF<eoMonitor&> 00059 { 00060 public : 00061 00062 virtual void lastCall() {} 00063 00068 virtual void add(const eoParam& _param) { vec.push_back(&_param); } 00069 00070 virtual std::string className(void) const { return "eoMonitor"; } 00071 00072 template <class EOT> 00073 eoMonitor& addTo(eoCheckPoint<EOT>& cp) { cp.add(*this); return *this; } 00074 00075 protected : 00076 typedef std::vector<const eoParam*>::iterator iterator; 00077 std::vector<const eoParam*> vec; 00078 }; 00079 00080 #endif