Action #287
Updated by Knödlseder Jürgen over 12 years ago
GammaLib uses extensively derived classes to implement specific instances of a general quantity. For example, @GObservation@ defines a general observation, and @GCTAObservation@ implements an observation with the CTA telescope.
When we now iterate in Python over observations (for example the observations that are stored in an @GObservations@ container), we always see the base class type @GObservation@ instead of the derived class type.
To circumvent this problem, specific functions for typecasting are implemented for now. This makes that Python code rather complex. We would like to investigate whether it is not possible to do automatic type casting in SWIG.
In this task we investigate possible solutions. For this purpose, create a simple base class and a derived class, and see whether you can tweak the swig interface file so that a pointer to the derived class is returned.
When we now iterate in Python over observations (for example the observations that are stored in an @GObservations@ container), we always see the base class type @GObservation@ instead of the derived class type.
To circumvent this problem, specific functions for typecasting are implemented for now. This makes that Python code rather complex. We would like to investigate whether it is not possible to do automatic type casting in SWIG.
In this task we investigate possible solutions. For this purpose, create a simple base class and a derived class, and see whether you can tweak the swig interface file so that a pointer to the derived class is returned.