From e85a52d21ba1843b5fc267ff614604fd241cffd8 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Wed, 5 Feb 2014 15:57:24 +0100 Subject: [PATCH] Add cast to CTA response --- inst/cta/pyext/GCTAResponse.i | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) diff --git a/inst/cta/pyext/GCTAResponse.i b/inst/cta/pyext/GCTAResponse.i index d612576..7f1496f 100644 --- a/inst/cta/pyext/GCTAResponse.i +++ b/inst/cta/pyext/GCTAResponse.i @@ -128,4 +128,14 @@ public: GCTAResponse copy() { return (*self); } + GCTAResponse* cta(GResponse* rsp) { + GCTAResponse* ptr = dynamic_cast(rsp); + if (ptr != NULL) { + return ptr; + } + else { + throw GException::bad_type("cta(GResponse*)", + "GResponse not of type GCTAResponse"); + } + } }; -- libgit2 0.21.4