Changed the general operator interface to be consistent with the rest

of EO, updated some documentation.
This commit is contained in:
mac 2000-04-09 09:41:29 +00:00
commit ed45375451
17 changed files with 230 additions and 52 deletions

View file

@ -36,14 +36,17 @@
new individuals into the (intermediate) population.
*/
template <class EOT>
class eoInserter : public eoObject
class eoInserter
{
public :
virtual ~eoInserter() {}
struct eoInserterException{};
virtual void insert(const EOT&) = 0; // can throw an eoInserterException
/**
insert argument somewhere (quite likely a population)
*/
virtual eoInserter<EOT>& operator()(const EOT&) = 0; // can throw an eoInserterException
};
/**
@ -58,7 +61,7 @@ class eoPopInserter : public eoInserter<EOT>
eoPopInserter(void) : eoInserter<EOT>(), thePop(0) {}
/// Binds the population to this class. This is an initialization routine used by breeders
eoInserter<EOT>& operator()(eoPop<EOT>& _pop)
eoInserter<EOT>& bind(eoPop<EOT>& _pop)
{
thePop = &_pop;
return *this;