00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _EOTIMECONTINUE_H
00014 #define _EOTIMECONTINUE_H
00015
00016 #include <eoContinue.h>
00017
00021 template < class EOT >
00022 class eoTimeContinue: public eoContinue<EOT>
00023 {
00024 public:
00025
00030 eoTimeContinue(time_t _max): max(_max)
00031 {
00032 start = time(NULL);
00033 }
00034
00035
00040 virtual bool operator() (const eoPop < EOT > & _pop)
00041 {
00042 time_t elapsed = (time_t) difftime(time(NULL), start);
00043 if (elapsed >= max)
00044 {
00045 std::cout << "STOP in eoTimeContinue: Reached maximum time [" << elapsed << "/" << max << "]" << std::endl;
00046 return false;
00047 }
00048 return true;
00049 }
00050
00051
00055 virtual std::string className(void) const
00056 {
00057 return "eoTimeContinue";
00058 }
00059
00060
00061 private:
00062
00064 time_t max;
00066 time_t start;
00067
00068 };
00069
00070 #endif