Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages | Search for

# eoEvalFuncPtr.h

    00001
    00026 //-----------------------------------------------------------------------------
    00027
    00028 #ifndef EOEVALFUNCPTR_H
    00029 #define EOEVALFUNCPTR_H
    00030
    00031 #include <eoEvalFunc.h>
    00032
    00038 #ifdef _MSC_VER
    00039 template< class EOT, class FitT = EOT::Fitness, class FunctionArg = const EOT& >
    00040 #else
    00041 template< class EOT, class FitT = typename EOT::Fitness, class FunctionArg = const EOT& >
    00042 #endif
    00043 struct eoEvalFuncPtr: public eoEvalFunc<EOT> {
    00044
    00051   eoEvalFuncPtr( FitT (* _eval)( FunctionArg ) )
    00052     : eoEvalFunc<EOT>(), evalFunc( _eval ) {};
    00053
    00055   virtual void operator() ( EOT & _eo )
    00056   {
    00057     if (_eo.invalid())
    00058         _eo.fitness((*evalFunc)( _eo ));
    00059   };
    00060
    00061   private:
    00062     FitT (* evalFunc )( FunctionArg );
    00063 };
    00064
    00065 #endif
    00066