I have a callback with this signature (I'm using Live555):
typedef void(RTSPClient::responseHandler)(RTSPClient*, ...); //... = other parameters
Then in my code I have created a subclass of RTSPClient following the library rules:
class MyRTSPClient: public RTSPClient {
...
//callback
void continueAfterDESCRIBE(RTSPClient *client, ...); //same signature of typedef
...
};
Now comes the problem.
In my code I have to invoke the following method:
unsigned RTSPClient::sendDescribeCommand(responseHandler, ...); //response handler is the typedef
If I create an object:
MyRTSPClient *client = MyRTSPClient::createNew(...); //is library requirement such creation
how can I pass the function object to sendDescribeCommand
as callback?
Of course if I declare continueAfterDESCRIBE
as static member I haven't any problem, but I want an object because I have many threads and if I use a static callback called from them many problems of synchronization will be raised.
So I'm struggling (as a newbie in C++) how to find out the correct signature to pass an obj->method
as a callback.