From ef15d7a495b5821d0fa23beddf7f2a634badc0b7 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Thu, 20 Nov 2014 18:55:32 +0100 Subject: [PATCH] Add missing GEvents type conversion to CTA Python interface --- inst/cta/pyext/cta.i | 16 ++++++++++++++++ 1 file changed, 16 insertions(+), 0 deletions(-) diff --git a/inst/cta/pyext/cta.i b/inst/cta/pyext/cta.i index c3a7efe..20a0b6a 100644 --- a/inst/cta/pyext/cta.i +++ b/inst/cta/pyext/cta.i @@ -142,6 +142,22 @@ } $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), myinfo, 0 | 0); } +%typemap(out) GEvents* { + char classname[80]; + strcpy(classname, "_p_"); + strcat(classname, result->classname().c_str()); + swig_type_info *myinfo = SWIGTYPE_p_GEvents; + swig_cast_info *mycast = 0; + mycast = myinfo->cast; + while (mycast != 0) { + if (strcmp(classname, mycast->type->name) == 0) { + myinfo = mycast->type; + break; + } + mycast = mycast->next; + } + $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), myinfo, 0 | 0); +} /* __ CTA ________________________________________________________________ */ %include "GCTAObservation.i" -- libgit2 0.21.4