#ifndef eoFuncPtrStat_h #define eoFuncPtrStat_h #include #include template class eoFuncPtrStat : public eoStat { public : typedef T (*func_t)(const eoPop&); eoFuncPtrStat(func_t f, std::string _description = "func_ptr") : eoStat(T(), _description), func(f) {} using eoStat::value; void operator()(const eoPop& pop) { value() = func(pop); } private: func_t func; }; template eoFuncPtrStat& makeFuncPtrStat( T (*func)(const eoPop&), eoFunctorStore& store, std::string description = "func") { return store.storeFunctor( new eoFuncPtrStat( func, description) ); } #endif