Finalized Checkpointing, see t-eoCheckpointing for a test

This commit is contained in:
mac 2000-03-31 10:02:18 +00:00
commit 9bcf9d95f8
12 changed files with 558 additions and 11 deletions

View file

@ -0,0 +1,36 @@
#ifdef _MSC_VER
#pragma warning(disable:4786)
#endif
#include <strstream>
#include <utils/eoState.h>
#include <utils/eoUpdater.h>
using namespace std;
void eoTimedStateSaver::operator()(void)
{
time_t now = time(0);
if (now >= last_time + interval)
{
last_time = now;
ostrstream os;
os << prefix << (now - first_time) << '.' << extension << ends;
state.save(os.str());
}
}
void eoCountedStateSaver::operator()(void)
{
if (++counter % interval == 0)
{
ostrstream os;
os << prefix << counter << '.' << extension << ends;
state.save(os.str());
}
};