t/typemap/object/child.xsi

filter: Statementstmt 100% 25 / 25 Branchbran 55.3% 31 / 56 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 69.1% 56 / 81 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« src/xs/Stash.cc ↑ Summary t/typemap/object/object_xsgen.cc »
1 MODE: INLINE
2  
3 template <int i>
4 class _MyChild : public _MyBase<i> {
5 public:
6 int val2;
7 _MyChild (int arg1, int arg2) : _MyBase<i>(arg1), val2(arg2) {}
8 _MyBase<i>* clone () const { return new _MyChild(this->val, val2); }
9 virtual ~_MyChild () { dcnt.c++; }
10 };
11  
12 using MyChild = _MyChild<0>;
13 using PTRMyChild = _MyChild<1>;
14  
15 namespace xs {
16 template <> struct Typemap<PTRMyChild*> : Typemap<PTRMyBase*, PTRMyChild*> {
17 static std::string package () { return "MyTest::PTRMyChild"; }
18 };
19 template <> struct Typemap<MyChild*> : Typemap<MyBase*, MyChild*> {
20 static std::string package () { return "MyTest::MyChild"; }
21 };
22 }
23  
24  
25 MODULE = MyTest::Typemap::Object PACKAGE = MyTest::PTRMyChild
26 PROTOTYPES: DISABLE
27  
28 BOOT {
29 35 ▶ Stash("MyTest::PTRMyChild").inherit(Stash("MyTest::PTRMyBase"));
Branch: 3 branches
BranchTrueFalseTotal
Stash("MyTest::PTRMyChild").inherit(Stash("MyTest::PTRMyBase")); 35 0 35
Stash("MyTest::PTRMyChild").inherit(Stash("MyTest::PTRMyBase")); 35 0 35
Stash("MyTest::PTRMyChild").inherit(Stash("MyTest::PTRMyBase")); 35 0 35
30 }
31  
32 2 PTRMyChild* PTRMyChild::new (int arg1, int arg2)
33 2 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
2 0 2
34 2 ▶int PTRMyChild::val2 (SV* newval = NULL) {
Branch: 2 branches
BranchTrueFalseTotal
int PTRMyChild::val2 (SV* newval = NULL) { 2 0 2
int PTRMyChild::val2 (SV* newval = NULL) { 2 0 2
35 2 ▶ if (newval) THIS->val2 = SvIV(newval);
Branch: 1 branch
BranchTrueFalseTotal
if (newval) THIS->val2 = SvIV(newval); 0 2 2
36 2 ▶ RETVAL = THIS->val2;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = THIS->val2; 0 2 2
37 }
38  
39 void PTRMyChild::set_from (PTRMyChild* other) {
40 1 ▶ if (other) {
Branch: 1 branch
BranchTrueFalseTotal
if (other) { 1 0 1
41 1 THIS->val = other->val;
42 1 THIS->val2 = other->val2;
43 }
44 }
45  
46 void PTRMyChild::DESTROY () {
47 2 dcnt.perl++;
48 2 ▶ Sub(cv).SUPER().call(&ST(0), items);
Branch: 3 branches
BranchTrueFalseTotal
Sub(cv).SUPER().call(&ST(0), items); 2 0 2
Sub(cv).SUPER().call(&ST(0), items); 2 0 2
Sub(cv).SUPER().call(&ST(0), items); 2 0 2
49 2 ▶}
Branch: 1 branch
BranchTrueFalseTotal
} 2 0 2
50  
51 MODULE = MyTest::Typemap::Object PACKAGE = MyTest::MyChild
52 PROTOTYPES: DISABLE
53  
54 BOOT {
55 35 ▶ Stash("MyTest::MyChild").inherit(Stash("MyTest::MyBase"));
Branch: 3 branches
BranchTrueFalseTotal
Stash("MyTest::MyChild").inherit(Stash("MyTest::MyBase")); 35 0 35
Stash("MyTest::MyChild").inherit(Stash("MyTest::MyBase")); 35 0 35
Stash("MyTest::MyChild").inherit(Stash("MyTest::MyBase")); 35 0 35
56 }
57  
58 MyChild* MyChild::new (int arg1, int arg2) {
59 7 if (!arg1 && !arg2) XSRETURN_UNDEF;
60 7 ▶ RETVAL = new MyChild(arg1, arg2);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = new MyChild(arg1, arg2); 7 0 7
61 7 ▶}
Branch: 2 branches
BranchTrueFalseTotal
} 1 6 7
} 1 0 1
62 6 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
6 0 6
6 0 6
63 int MyChild::val2 (SV* newval = NULL) {
64 6 ▶ if (newval) THIS->val2 = SvIV(newval);
Branch: 1 branch
BranchTrueFalseTotal
if (newval) THIS->val2 = SvIV(newval); 0 6 6
65 6 ▶ RETVAL = THIS->val2;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = THIS->val2; 2 4 6
66 }
67  
68 void MyChild::set_from (MyChild* other) {
69 3 ▶ if (other) {
Branch: 1 branch
BranchTrueFalseTotal
if (other) { 2 1 3
70 2 THIS->val = other->val;
71 2 THIS->val2 = other->val2;
72 }
73 }
74  
75 void MyChild::DESTROY () {
76 6 dcnt.perl++;
77 6 ▶ Sub(cv).SUPER().call(&ST(0), items);
Branch: 3 branches
BranchTrueFalseTotal
Sub(cv).SUPER().call(&ST(0), items); 6 0 6
Sub(cv).SUPER().call(&ST(0), items); 6 0 6
Sub(cv).SUPER().call(&ST(0), items); 6 0 6
78 6 ▶}
Branch: 1 branch
BranchTrueFalseTotal
} 6 0 6
« src/xs/Stash.cc ↑ Summary t/typemap/object/object_xsgen.cc »