From db9f63f61a4cf3d6f0c7455746325c7936be8ee4 Mon Sep 17 00:00:00 2001 From: LPTK Date: Wed, 17 Jul 2013 16:55:13 +0200 Subject: [PATCH] Added an eoUpdater that simply calls a function with no arguments --- eo/src/utils/eoUpdater.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/eo/src/utils/eoUpdater.h b/eo/src/utils/eoUpdater.h index 072b9a9bb..70c714bca 100644 --- a/eo/src/utils/eoUpdater.h +++ b/eo/src/utils/eoUpdater.h @@ -50,6 +50,32 @@ public: eoUpdater& addTo(eoCheckPoint& 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