D
Daniel Koch
Great people,
I've a doubt about POSIX C functions when I'm using with C++.
I need to handle a signal, the signal() from signal.h needs a
callback. This callback need to perform an action inside class.
How can I define this callback as my instance method?
I think the wrong way is to define a pointer to class instance (this)
as global, then I can call public methods of class from this callback
(the callback defined by signal() haven't a void pointer to pass an
instance pointer).
What's the right way to do this?
Thank you,
Daniel Koch
I've a doubt about POSIX C functions when I'm using with C++.
I need to handle a signal, the signal() from signal.h needs a
callback. This callback need to perform an action inside class.
How can I define this callback as my instance method?
I think the wrong way is to define a pointer to class instance (this)
as global, then I can call public methods of class from this callback
(the callback defined by signal() haven't a void pointer to pass an
instance pointer).
What's the right way to do this?
Thank you,
Daniel Koch