| 1 |
|
| MODE: INLINE |
| 2 |
|
| |
| 3 |
|
| struct MyForeign { |
| 4 |
|
| int val; |
| 5 |
|
| MyForeign (int arg) : val(arg) {} |
| 6 |
|
| virtual ~MyForeign () { dcnt.c++; } |
| 7 |
|
| }; |
| 8 |
|
| |
| 9 |
|
| static MyForeign _myforeign(789); |
| 10 |
|
| |
| 11 |
|
| namespace xs { |
| 12 |
|
| template <> struct Typemap<MyForeign*,MyForeign*> : TypemapObject<MyForeign*, MyForeign*, ObjectTypeForeignPtr, ObjectStorageMG> { |
| 13 |
|
| static std::string package () { return "MyTest::MyForeign"; } |
| 14 |
|
| }; |
| 15 |
|
| } |
| 16 |
|
| |
| 17 |
|
| MODULE = MyTest::Typemap::Object PACKAGE = MyTest::MyForeign |
| 18 |
|
| PROTOTYPES: DISABLE |
| 19 |
|
| |
| 20 |
|
| MyForeign* get (SV*) { |
| 21 |
1 |
| RETVAL = &_myforeign; |
| 22 |
1 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
1 |
0 |
1 |
|
| 23 |
|
| |
| 24 |
|
| int MyForeign::val (SV* newval = NULL) { |
| 25 |
3 |
▶ | if (newval) THIS->val = SvIV(newval); |
Branch: 1 branch
| Branch | True | False | Total |
| if (newval) THIS->val = SvIV(newval); |
1 |
2 |
3 |
|
| 26 |
3 |
▶ | RETVAL = THIS->val; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = THIS->val; |
0 |
3 |
3 |
|
| 27 |
|
| } |
| 28 |
|
| |
| 29 |
|
| void MyForeign::DESTROY () { |
| 30 |
1 |
| dcnt.perl++; |
| 31 |
1 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
1 |
0 |
1 |
|