eoObject Class Reference

Defines a name (className#), used when loading or saving a state. More...

#include <eoObject.h>

Inheritance diagram for eoObject:
EO< F > EO< EOT::Fitness > EO< Fit > EO< fitnessT > EO< FitT > EO< FType > EO< PyFitness > eoDistribution< EOT > eoFactory< EOClass > eoFactory< eoOpSelector< eoClass > > eoFactory< eoSelect< EOT > > eoFactory< EOT > eoLogger eoParallel eoParser eoPop< EOT > eoPop< POT > eoPop< PyEO > eoRng

List of all members.

Public Member Functions

virtual ~eoObject ()
 Virtual dtor. They are needed in virtual class hierarchies.
virtual std::string className () const =0
 Return the class id.

Detailed Description

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.

See also:
eoPersistent eoPrintable, eoState

Definition at line 56 of file eoObject.h.

Member Function Documentation

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 >.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends