Commit e85a52d21ba1843b5fc267ff614604fd241cffd8
1 parent
698f0626
Add cast to CTA response
Showing
1 changed file
with
10 additions
and
0 deletions
inst/cta/pyext/GCTAResponse.i
| ... | ... | @@ -128,4 +128,14 @@ public: |
| 128 | 128 | GCTAResponse copy() { |
| 129 | 129 | return (*self); |
| 130 | 130 | } |
| 131 | + GCTAResponse* cta(GResponse* rsp) { | |
| 132 | + GCTAResponse* ptr = dynamic_cast<GCTAResponse*>(rsp); | |
| 133 | + if (ptr != NULL) { | |
| 134 | + return ptr; | |
| 135 | + } | |
| 136 | + else { | |
| 137 | + throw GException::bad_type("cta(GResponse*)", | |
| 138 | + "GResponse not of type GCTAResponse"); | |
| 139 | + } | |
| 140 | + } | |
| 131 | 141 | }; | ... | ... |