EvolvingObjects
|
Defines a name (className#), used when loading or saving a state. More...
#include <eoObject.h>
Public Member Functions | |
virtual | ~eoObject () |
Virtual dtor. They are needed in virtual class hierarchies. | |
virtual std::string | className () const =0 |
Return the class id. |
Defines a name (className#), used when loading or saving a state.
It is recommended that you only derive from eoObject in concrete classes. Some parts of EO do not implement this yet, but that will change in the future. eoObject, together with eoPersistent and eoPrintable provide a simple persistence framework that is only needed when the classes have state that changes at runtime.
Definition at line 56 of file eoObject.h.
virtual std::string eoObject::className | ( | ) | const [pure virtual] |
Return the class id.
This should be redefined in each class. Only "leaf" classes can be non-virtual.
Maarten: removed the default implementation as this proved to be too error-prone: I found several classes that had a typo in className (like classname), which would print eoObject instead of their own. Having it pure will force the implementor to provide a name.
Implemented in eoPop< EOT >, eoPop< PyEO >, eoPop< POT >, eoRng, eoLogger, eoParser, PO< F >, PO< FitT >, EO< F >, EO< EOT::Fitness >, EO< FitT >, EO< fitnessT >, EO< Fit >, EO< FType >, EO< PyFitness >, eoParseTree< FType, Node >, eoOpSelMason< eoClass >, eoPBILDistrib< EOT >, eoBit< FitT >, eoString< fitnessT >, eoFactory< EOClass >, eoFactory< eoOpSelector< eoClass > >, eoFactory< EOT >, eoFactory< eoSelect< EOT > >, eoInt< FitT >, eoReal< FitT >, eoEsFull< Fit >, eoEsSimple< Fit >, eoParallel, eoEsStdev< Fit >, eoBitParticle< FitT >, and eoRealParticle< FitT >.