On Oct 8, 9:08 am, Jim <j...@astro.livjm.ac.ukwrote:
Quote:
Hi,
I've got a class(extendRA) which inherits from another class (regrid).
The method (regridder) which does most of the objects work is
contained in the base class, however two of the methods it uses to do
it's job are overridden in the derived class. When I instantiate the
derived class, I want to call the base classes method regridder but
have it use the new overridden methods.
>
I have a feeling this isn't possible, but overridding the regridder
method in derived class, which doesn't need to change , seems
inefficient.
>
Any ideas? The code's pretty bulky so I don't really want to post it
and it's a fairly general point. All I want is the majority of the
program to stay constant, but just change these small methods for
special cases.
>
Thanks!
This is perfectly fine and a common idiom in C++.
You should try it in sample program with some sample classes
to illustrate the idea (this way, you won't be distracted by
the bulk of your actual class).