Added an eoUpdater that simply calls a function with no arguments
This commit is contained in:
parent
55ee0d88a1
commit
db9f63f61a
1 changed files with 26 additions and 0 deletions
|
|
@ -50,6 +50,32 @@ public:
|
||||||
eoUpdater& addTo(eoCheckPoint<EOT>& cp) { cp.add(*this); return *this; }
|
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
|
an eoUpdater that simply increments a counter
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue