Provide virtual destructors as gcc-4 barks heavily otherwise
This commit is contained in:
parent
54a3b8d10e
commit
88a3a641c6
2 changed files with 14 additions and 5 deletions
|
|
@ -46,6 +46,9 @@ public :
|
||||||
current = dest.end();
|
current = dest.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @brief Virtual Constructor */
|
||||||
|
virtual ~eoPopulator() {};
|
||||||
|
|
||||||
struct OutOfIndividuals {};
|
struct OutOfIndividuals {};
|
||||||
|
|
||||||
/** a populator behaves like an iterator. Hence the operator*
|
/** a populator behaves like an iterator. Hence the operator*
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// eoUpdatable.h
|
// eoUpdatable.h
|
||||||
// (c) Maarten Keijzer, Marc Schoenauer and GeNeura Team, 2000
|
// (c) Maarten Keijzer, Marc Schoenauer and GeNeura Team, 2000
|
||||||
/*
|
/*
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation; either
|
||||||
|
|
@ -36,14 +36,20 @@
|
||||||
class eoUpdatable
|
class eoUpdatable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/** @brief Virtual destructor */
|
||||||
|
virtual ~eoUpdatable() {};
|
||||||
|
|
||||||
virtual void update() = 0;
|
virtual void update() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A base class to actually update an eoUpdatable object
|
A base class to actually update an eoUpdatable object
|
||||||
*/
|
*/
|
||||||
class eoDynUpdater : public eoUpdater
|
class eoDynUpdater : public eoUpdater
|
||||||
{public :
|
{public :
|
||||||
eoDynUpdater(eoUpdatable & _toUpdate) : toUpdate(_toUpdate) {};
|
eoDynUpdater(eoUpdatable & _toUpdate) : toUpdate(_toUpdate) {};
|
||||||
|
|
||||||
virtual void operator()()
|
virtual void operator()()
|
||||||
|
|
@ -61,14 +67,14 @@ private:
|
||||||
class eoTimedDynUpdate : public eoDynUpdater
|
class eoTimedDynUpdate : public eoDynUpdater
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
eoTimedDynUpdate(eoUpdatable & _toUpdate, time_t _interval) :
|
eoTimedDynUpdate(eoUpdatable & _toUpdate, time_t _interval) :
|
||||||
eoDynUpdater(_toUpdate),
|
eoDynUpdater(_toUpdate),
|
||||||
interval(_interval), last_time(time(0)), first_time(time(0)) {}
|
interval(_interval), last_time(time(0)), first_time(time(0)) {}
|
||||||
|
|
||||||
void operator()(void)
|
void operator()(void)
|
||||||
{
|
{
|
||||||
time_t now = time(0);
|
time_t now = time(0);
|
||||||
|
|
||||||
if (now >= last_time + interval)
|
if (now >= last_time + interval)
|
||||||
{
|
{
|
||||||
last_time = now;
|
last_time = now;
|
||||||
|
|
|
||||||
Reference in a new issue