>> ObjInst->Process((*MovementInACirle)(1.33, 2.342, 1.23));
this is just invoking the callback function directly. the Process function should take the address of callback function, and the three doubles as arguments (unless they're generated internally, of course). if 'Process' is non-virtual, you can simply template it so that it can take both functions and objects as arguments.
Code:
class ParticleManage
{
public:
template <typename Function>
void
Process(Function callback, double a, double b, double c)
{
// do stuff
callback(a, b, c);
}
};
void
MovementInACircle(double a, double b, double c)
{
cout << "MovementInACircle(" << a << "," << b << "," << c << ")" << endl;
}
struct MovementInASquare
{
void
operator () (double a, double b, double c) const
{
cout << "MovementInASquare(" << a << "," << b << "," << c << ")" << endl;
}
};
int
main()
{
ParticleManage pm;
pm.Process(MovementInACircle, 0.0, 1.0, 2.0);
pm.Process(MovementInASquare(), 3.0, 4.0, 5.0);
}
if you plan to 'store' the callback you might either stick with functions or else use some sort of functor object (boost::function would do, I believe).