t/typemap/object/mixin.xsi

filter: Statementstmt 97.1% 34 / 35 Branchbran 59.3% 57 / 96 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 69.4% 91 / 131 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« t/typemap/object/object_xsgen.cc ↑ Summary Framework.xs »
1 MODE: INLINE
2  
3 class MixBase {
4 public:
5 int val;
6 MixBase (int arg) : val(arg) {}
7 virtual ~MixBase () { dcnt.c++; }
8 };
9  
10 class MixPluginA {
11 public:
12 int val;
13 MixPluginA () : val(0) {}
14 virtual ~MixPluginA () { dcnt.c++; }
15 };
16  
17 class MixPluginB {
18 public:
19 int val;
20 MixPluginB () : val(0) {}
21 virtual ~MixPluginB () { dcnt.c++; }
22 };
23  
24 namespace xs {
25  
26 template <> struct Typemap<MixBase*> : TypemapObject<MixBase*, MixBase*, ObjectTypePtr, ObjectStorageMG, DynamicCast> {
27 static std::string package () { return "MyTest::MixBase"; }
28 };
29
30 template <> struct Typemap<MixPluginA*> : TypemapObject<MixPluginA*, MixPluginA*, ObjectTypePtr, ObjectStorageMG, DynamicCast> {
31 static std::string package () { return "MyTest::MixPluginA"; }
32 };
33
34 template <> struct Typemap<MixPluginB*> : TypemapObject<MixPluginB*, MixPluginB*, ObjectTypePtr, ObjectStorageMG, DynamicCast> {
35 static std::string package () { return "MyTest::MixPluginB"; }
36 };
37  
38 }
39  
40 MODULE = MyTest::Typemap::Object PACKAGE = MyTest::MixBase
41 PROTOTYPES: DISABLE
42  
43 MixBase* MixBase::new (int arg) {
44 5 if (!arg) XSRETURN_UNDEF;
45 5 ▶ RETVAL = new MixBase(arg);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = new MixBase(arg); 5 0 5
46 5 ▶}
Branch: 1 branch
BranchTrueFalseTotal
} 1 4 5
47 4 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
4 0 4
4 0 4
48 int MixBase::val (SV* newval = NULL) {
49 5 ▶ if (newval) THIS->val = SvIV(newval);
Branch: 1 branch
BranchTrueFalseTotal
if (newval) THIS->val = SvIV(newval); 1 4 5
50 5 ▶ RETVAL = THIS->val;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = THIS->val; 0 5 5
51 }
52  
53 void MixBase::set_from (MixBase* other) {
54 2 ▶ if (other) THIS->val = other->val;
Branch: 1 branch
BranchTrueFalseTotal
if (other) THIS->val = other->val; 1 1 2
55 }
56  
57 void MixBase::DESTROY () {
58 4 dcnt.perl++;
59 4 ▶ Object(ST(0)).call_next_maybe(cv, &ST(1), items-1);
Branch: 3 branches
BranchTrueFalseTotal
Object(ST(0)).call_next_maybe(cv, &ST(1), items-1); 4 0 4
Object(ST(0)).call_next_maybe(cv, &ST(1), items-1); 4 0 4
Object(ST(0)).call_next_maybe(cv, &ST(1), items-1); 4 0 4
60 4 ▶}
Branch: 1 branch
BranchTrueFalseTotal
} 4 0 4
61  
62 0 ▶int CLONE_SKIP (SV*) { RETVAL = 1; }
Branch: 1 branch
BranchTrueFalseTotal
int CLONE_SKIP (SV*) { RETVAL = 1; } 0 0 0
63  
64  
65 MODULE = MyTest::Typemap::Object PACKAGE = MyTest::MixPluginA
66 PROTOTYPES: DISABLE
67  
68 MixPluginA* MixPluginA::new (...) {
69 4 PROTO = Stash::from_name(CLASS).call_next(cv, &ST(1), items-1);
70 4 ▶ if (!PROTO.defined()) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!PROTO.defined()) XSRETURN_UNDEF; 4 0 4
71 4 ▶ RETVAL = new MixPluginA();
Branch: 3 branches
BranchTrueFalseTotal
RETVAL = new MixPluginA(); 4 0 4
RETVAL = new MixPluginA(); 4 0 4
RETVAL = new MixPluginA(); 4 0 4
72 4 ▶}
Branch: 2 branches
BranchTrueFalseTotal
} 4 0 4
} 1 3 4
73 3 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
3 0 3
3 0 3
74 int MixPluginA::val_a (SV* newval = NULL) {
75 6 ▶ if (newval) THIS->val = SvIV(newval);
Branch: 1 branch
BranchTrueFalseTotal
if (newval) THIS->val = SvIV(newval); 2 4 6
76 6 ▶ RETVAL = THIS->val;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = THIS->val; 0 6 6
77 }
78  
79 void MixPluginA::set_from (MixPluginA* other) {
80 2 ▶ Object(ST(0)).call_next(cv, &ST(1), items-1);
Branch: 3 branches
BranchTrueFalseTotal
Object(ST(0)).call_next(cv, &ST(1), items-1); 2 0 2
Object(ST(0)).call_next(cv, &ST(1), items-1); 2 0 2
Object(ST(0)).call_next(cv, &ST(1), items-1); 2 0 2
81 2 ▶ if (other) THIS->val = other->val;
Branch: 1 branch
BranchTrueFalseTotal
if (other) THIS->val = other->val; 1 1 2
82 }
83  
84 void MixPluginA::DESTROY () {
85 3 dcnt.perl++;
86 3 ▶ Object(ST(0)).call_next(cv, &ST(1), items-1);
Branch: 3 branches
BranchTrueFalseTotal
Object(ST(0)).call_next(cv, &ST(1), items-1); 3 0 3
Object(ST(0)).call_next(cv, &ST(1), items-1); 3 0 3
Object(ST(0)).call_next(cv, &ST(1), items-1); 3 0 3
87 3 ▶}
Branch: 1 branch
BranchTrueFalseTotal
} 3 0 3
88  
89  
90  
91 MODULE = MyTest::Typemap::Object PACKAGE = MyTest::MixPluginB
92 PROTOTYPES: DISABLE
93  
94 MixPluginB* MixPluginB::new (...) {
95 5 PROTO = Stash::from_name(CLASS).call_next(cv, &ST(1), items-1);
96 5 ▶ if (!PROTO.defined()) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!PROTO.defined()) XSRETURN_UNDEF; 5 0 5
97 5 ▶ RETVAL = new MixPluginB();
Branch: 3 branches
BranchTrueFalseTotal
RETVAL = new MixPluginB(); 5 0 5
RETVAL = new MixPluginB(); 5 0 5
RETVAL = new MixPluginB(); 5 0 5
98 5 ▶}
Branch: 2 branches
BranchTrueFalseTotal
} 5 0 5
} 1 4 5
99 4 ▶ 
Branch: 2 branches
BranchTrueFalseTotal
4 0 4
4 0 4
100 int MixPluginB::val_b (SV* newval = NULL) {
101 6 ▶ if (newval) THIS->val = SvIV(newval);
Branch: 1 branch
BranchTrueFalseTotal
if (newval) THIS->val = SvIV(newval); 2 4 6
102 6 ▶ RETVAL = THIS->val;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = THIS->val; 0 6 6
103 }
104  
105 void MixPluginB::set_from (MixPluginB* other) {
106 5 ▶ Object(ST(0)).call_next(cv, &ST(1), items-1);
Branch: 3 branches
BranchTrueFalseTotal
Object(ST(0)).call_next(cv, &ST(1), items-1); 3 0 3
Object(ST(0)).call_next(cv, &ST(1), items-1); 3 0 3
Object(ST(0)).call_next(cv, &ST(1), items-1); 2 1 3
107 2 ▶ if (other) THIS->val = other->val;
Branch: 1 branch
BranchTrueFalseTotal
if (other) THIS->val = other->val; 1 1 2
108 }
109  
110 void MixPluginB::DESTROY () {
111 4 dcnt.perl++;
112 4 ▶ Object(ST(0)).call_next(cv, &ST(1), items-1);
Branch: 3 branches
BranchTrueFalseTotal
Object(ST(0)).call_next(cv, &ST(1), items-1); 4 0 4
Object(ST(0)).call_next(cv, &ST(1), items-1); 4 0 4
Object(ST(0)).call_next(cv, &ST(1), items-1); 4 0 4
113 4 ▶}
Branch: 1 branch
BranchTrueFalseTotal
} 4 0 4
« t/typemap/object/object_xsgen.cc ↑ Summary Framework.xs »