Commit 855e46e73fc563fb787113e6a19fc2fcc88892ab
1 parent
87b38d5e
Add constructor cast.
Showing
1 changed file
with
10 additions
and
0 deletions
inst/cta/pyext/GCTAInstDir.i
| @@ -78,4 +78,14 @@ public: | @@ -78,4 +78,14 @@ public: | ||
| 78 | GCTAInstDir copy() { | 78 | GCTAInstDir copy() { |
| 79 | return (*self); | 79 | return (*self); |
| 80 | } | 80 | } |
| 81 | + GCTAInstDir(GInstDir* dir) { | ||
| 82 | + GCTAInstDir* ptr = dynamic_cast<GCTAInstDir*>(dir); | ||
| 83 | + if (ptr != NULL) { | ||
| 84 | + return (ptr->clone()); | ||
| 85 | + } | ||
| 86 | + else { | ||
| 87 | + throw GException::bad_type("GCTAInstDir(GInstDir*)", | ||
| 88 | + "GInstDir not of type GCTAInstDir"); | ||
| 89 | + } | ||
| 90 | + } | ||
| 81 | }; | 91 | }; |