I had an idea for something the other day, but it now appears that it
will not work.  Nevertheless, I thought that I might as well post the
question on the off-chance this is possible.  What I want to do is have
a parent class with a bunch of non-pure virtual methods.  There will be
one method for each of standard signals (SIGINT,SIGHUP,SIGUSR1,...).  I
then want an initialization method (not the constructor) to check which
of these methods have been overridden.  For those methods, my parent
class will declare that method as the signal handler.  This would allow
the child class to simply override the appropriate method and
everything would be appropriately set-up.

My thought was that I would just check the address of the member method
against the value of &TheParentClass::TheVirtualMethod.  But that does
not work because there is apparently no way to access the address of a
virtual method.  I thought about checking the vtable, but I haven't
found any way of accessing the vtable that is in the least bit safe.
If anyone has any ideas, please let me know.  I think this would be a
very cool feature if possible.

_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to