Commit ad67811322b8b00e2f657f1afbdc0706f10f1761

Authored by Jürgen Knödlseder
1 parent 1f3663f5

Add GEvents* output typemap.

Showing 1 changed file with 15 additions and 2 deletions
pyext/GObservation.i
... ... @@ -26,11 +26,24 @@
26 26 %{
27 27 /* Put headers and other declarations here that are needed for compilation */
28 28 #include "GObservation.hpp"
  29 +#include "GEvents.hpp"
  30 +#include "GEventList.hpp"
  31 +#include "GEventCube.hpp"
29 32 #include "GTools.hpp"
30 33 %}
31 34  
32   -/* __ Includes ___________________________________________________________ */
33   -%include "GTypemaps.i"
  35 +/* __ Typemaps ___________________________________________________________ */
  36 +%typemap(out) GEvents* {
  37 + if (dynamic_cast<GEventList*>($1) != NULL) {
  38 + $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GEventList, 0 | 0 );
  39 + }
  40 + else if (dynamic_cast<GEventCube*>($1) != NULL) {
  41 + $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GEventCube, 0 | 0 );
  42 + }
  43 + else {
  44 + $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GEvents, 0 | 0 );
  45 + }
  46 +}
34 47  
35 48  
36 49 /***********************************************************************//**
... ...