I want to create a child class of TASImage and when I try to overwrite the ExecuteEvent function I run into the following problems:
Any ideas on how to resolve this? A minimal example is attached. If you comment out the ExecuteEvent function the code compiles fine. In the example, the function is a simple copy of TASImage::ExecuteEvent without any new code.
replace all “->fImage” occurrences with “->GetImage()”
in the beginning, add appropriate include files which are required in order to define the “ASImage” structure, which originates in the “libAfterImage” (warning: ROOT usually builds and uses its own version of the “libAfterImage”, so you cannot use the one that comes with your operating system -> see how the “libASImage” is built)
One of the error messages was:
…/MyGui.cxx:38:43: error: within this context
if (fScaledImage) image = fScaledImage->fImage;
So the complain is accessing fImage via the pointer fScaledImage.
MyTASImage can access its own base classes data member but not those
from a different object.
but an object can access its own protected member in both itself and a
different object of the same type.
(See paragraph 11.5 ; it would have worked if fScaledImage was a