EvolvingObjects
|
00001 /* 00002 This library is free software; you can redistribute it and/or 00003 modify it under the terms of the GNU Lesser General Public 00004 License as published by the Free Software Foundation; either 00005 version 2 of the License, or (at your option) any later version. 00006 00007 This library is distributed in the hope that it will be useful, 00008 but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00010 Lesser General Public License for more details. 00011 00012 You should have received a copy of the GNU Lesser General Public 00013 License along with this library; if not, write to the Free Software 00014 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00015 00016 (c) Thales group 2011 00017 00018 Author: johann.dreo@thalesgroup.com 00019 */ 00020 00021 #ifndef _eoGenCounter_h 00022 #define _eoGenCounter_h 00023 00024 #include <string> 00025 #include <utils/eoStat.h> 00026 00032 class eoGenCounter : public eoUpdater, public eoValueParam<unsigned int> 00033 { 00034 public: 00035 eoGenCounter( unsigned int start = 0, std::string label = "Gen" ) : eoValueParam<unsigned int>(start, label), _nb(start) {} 00036 00037 virtual void operator()() 00038 { 00039 value() = _nb++; 00040 } 00041 00042 private: 00043 unsigned int _nb; 00044 }; 00045 00046 #endif