eoGenContinue and eoSteadyFitContinue now inherits from a common class eoCountContinue, which contains a overridable method reset.

This commit is contained in:
Benjamin Bouvier 2012-07-26 15:12:54 +02:00
commit a14526e01a
3 changed files with 60 additions and 23 deletions

View file

@ -67,4 +67,43 @@ public:
}
};
/**
* Termination condition with a count condition (totalGenerations). This continuator contains
* a count of cycles, which can be retrieved or set.
*
* @ingroup Continuators
* @ingroup Core
*/
template< class EOT >
class eoCountContinue : public eoContinue< EOT >
{
public:
eoCountContinue( ) :
thisGenerationPlaceholder( 0 ),
thisGeneration( thisGenerationPlaceholder )
{
// empty
}
eoCountContinue( unsigned long& currentGen ) :
thisGenerationPlaceholder( 0 ),
thisGeneration( currentGen )
{
// empty
}
virtual std::string className( void ) const { return "eoCountContinue"; }
virtual void reset( )
{
thisGeneration = 0;
}
protected:
unsigned long thisGenerationPlaceholder;
unsigned long& thisGeneration;
};
#endif