Well, what do you know, major commit.

Changed the signature of eoMon, eoBin and eoQuadOp to return a bool,
without invalidating fitness. Added a set of invalidators to take over
that job (see for instance eoSGA and eoSGATransform how this can transparantly used)

Derived eoState from eoFunctorStore (for convenience, from a design perspective this may sound wrong)

Added a wrap_op function that does the wrapping for you (see eoOpContainer how this made this functor
exceedingly less hairy). Checked all the tests removed the eoGeneric*Op family (not needed anymore)
and of course changed all the operators to reflect the change (and found a few that didn't
invalidate the fitness, thus really pointing out the advantage of the current approach)
This commit is contained in:
maartenkeijzer 2001-02-14 10:35:26 +00:00
commit 3a9b5a0e7e
30 changed files with 651 additions and 564 deletions

View file

@ -38,11 +38,20 @@ class eoObject;
class eoPersistent;
/**
* eoState can be used to register derivants of eoPersistent. It will
* then in turn implement the persistence framework through members load
* and save, that will call readFrom and printOn for the registrated objects.
eoState can be used to register derivants of eoPersistent. It will
then in turn implement the persistence framework through members load
and save, that will call readFrom and printOn for the registrated objects.
It is derived from eoFunctorStore, so that it also serves as a place where
all those nifty eo functors can be stored. This is useful in the case you
want to use one of the make_* functions. These functions generally take as their
last argument an eoFunctorStore (or a state) which is used to hold all dynamically
generated data. Note however, that unlike with eoPersistent derived classes, eoFunctorBase
derived classes are not saved or loaded. To govern the creation of functors,
command-line parameters (which can be stored) are needed.
*/
class eoState
class eoState : public eoFunctorStore
{
public :
@ -68,12 +77,6 @@ public :
return static_cast<T&>(*ownedObjects.back());
}
void storeFunctor(eoFunctorBase* _functor)
{
// add it to the functorStore, fo
functorStore.add(_functor);
}
/**
* Loading error thrown when nothing seems to work.
*/
@ -123,9 +126,6 @@ private :
std::vector<ObjectMap::iterator> creationOrder;
std::vector<eoPersistent*> ownedObjects;
// And a functor store to boot
eoFunctorStore functorStore;
// private copy and assignment as eoState is supposed to be unique
eoState(const eoState&);
eoState& operator=(const eoState&);