Hi,
my problem is as follows:
I have a class X from which i plan to derrive unknown number of other classes Y1, Y2, Y3...(each will have only one instance) then there is another class Z unknown number of objects of which are declared in Ys but their addresses are saved in a link list declared in X so that X has access to all Z objects in corresponding Y. I want to pass a function pointer pointing to a method of Y as a parameter to Z object and then retrieve it from Z in X and call it there.
The goal is to give ability to X to call unspecified number of methods of Y.
(each Y will have different number of methods needed)
is this even possible to do?
can a parent class call methods of its child using function pointers?
Thanks.
my problem is as follows:
I have a class X from which i plan to derrive unknown number of other classes Y1, Y2, Y3...(each will have only one instance) then there is another class Z unknown number of objects of which are declared in Ys but their addresses are saved in a link list declared in X so that X has access to all Z objects in corresponding Y. I want to pass a function pointer pointing to a method of Y as a parameter to Z object and then retrieve it from Z in X and call it there.
The goal is to give ability to X to call unspecified number of methods of Y.
(each Y will have different number of methods needed)
is this even possible to do?
can a parent class call methods of its child using function pointers?
Thanks.