From ad67811322b8b00e2f657f1afbdc0706f10f1761 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Tue, 18 Dec 2012 15:42:12 +0100 Subject: [PATCH] Add GEvents* output typemap. --- pyext/GObservation.i | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pyext/GObservation.i b/pyext/GObservation.i index d4131ac..ab11409 100644 --- a/pyext/GObservation.i +++ b/pyext/GObservation.i @@ -26,11 +26,24 @@ %{ /* Put headers and other declarations here that are needed for compilation */ #include "GObservation.hpp" +#include "GEvents.hpp" +#include "GEventList.hpp" +#include "GEventCube.hpp" #include "GTools.hpp" %} -/* __ Includes ___________________________________________________________ */ -%include "GTypemaps.i" +/* __ Typemaps ___________________________________________________________ */ +%typemap(out) GEvents* { + if (dynamic_cast($1) != NULL) { + $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GEventList, 0 | 0 ); + } + else if (dynamic_cast($1) != NULL) { + $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GEventCube, 0 | 0 ); + } + else { + $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_GEvents, 0 | 0 ); + } +} /***********************************************************************//** -- libgit2 0.21.4