t/typemap/object/foreign.xsi

filter: Statementstmt 100% 6 / 6 Branchbran 62.5% 5 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 78.5% 11 / 14 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« t/typemap/svapi.xsi ↑ Summary t/typemap/svrefs.xsi »
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
BranchTrueFalseTotal
} 1 0 1
23  
24 int MyForeign::val (SV* newval = NULL) {
25 3 ▶ if (newval) THIS->val = SvIV(newval);
Branch: 1 branch
BranchTrueFalseTotal
if (newval) THIS->val = SvIV(newval); 1 2 3
26 3 ▶ RETVAL = THIS->val;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = THIS->val; 0 3 3
27 }
28  
29 void MyForeign::DESTROY () {
30 1 dcnt.perl++;
31 1 ▶}
Branch: 1 branch
BranchTrueFalseTotal
} 1 0 1
« t/typemap/svapi.xsi ↑ Summary t/typemap/svrefs.xsi »