Added an eoUpdater that simply calls a function with no arguments

This commit is contained in:
LPTK 2013-07-17 16:55:13 +02:00
commit db9f63f61a

View file

@ -50,6 +50,32 @@ public:
eoUpdater& addTo(eoCheckPoint<EOT>& cp) { cp.add(*this); return *this; }
};
/**
An eoUpdater that simply calls a function with no arguments
@ingroup Utilities
*/
class eoFunctionCaller : public eoUpdater
{
public :
/** Default Ctor - requires a pointer to the function to call */
eoFunctionCaller(void (*_fct)())
: fct(_fct)
{ }
/** Simply call the function */
virtual void operator()()
{
(*fct)();
}
virtual std::string className(void) const { return "eoFunctionCaller"; }
private:
void (*fct)();
};
/**
an eoUpdater that simply increments a counter