t/cookbook/cookbook_xsgen.cc

filter: Statementstmt 7.0% 104 / 1485 Branchbran 0.0% 1 / 1096 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 4.0% 105 / 2581 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« t/cookbook/recipe09.xsi ↑ Summary t/cookbook/recipe08.xsi »
1 /*
2 * This file was generated automatically by XS::Install::FrozenShit::ParseXS version 3.57 from the
3 * contents of cookbook.xs. Do not edit this file, edit cookbook.xs instead.
4 *
5 * ANY CHANGES MADE HERE WILL BE LOST!
6 *
7 */
8  
9 #line 1 "t/cookbook/cookbook.xs"
10 #include <xs.h>
11 using namespace xs;
12  
13 #line 14 "t/cookbook/cookbook_xsgen.cc"
14 #ifndef PERL_UNUSED_VAR
15 # define PERL_UNUSED_VAR(var) if (0) var = var
16 #endif
17  
18 #ifndef dVAR
19 # define dVAR dNOOP
20 #endif
21  
22  
23 /* This stuff is not part of the API! You have been warned. */
24 #ifndef PERL_VERSION_DECIMAL
25 # define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
26 #endif
27 #ifndef PERL_DECIMAL_VERSION
28 # define PERL_DECIMAL_VERSION \
29 PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
30 #endif
31 #ifndef PERL_VERSION_GE
32 # define PERL_VERSION_GE(r,v,s) \
33 (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
34 #endif
35 #ifndef PERL_VERSION_LE
36 # define PERL_VERSION_LE(r,v,s) \
37 (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
38 #endif
39  
40 /* XS_INTERNAL is the explicit static-linkage variant of the default
41 * XS macro.
42 *
43 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
44 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
45 * for anything but the BOOT XSUB.
46 *
47 * See XSUB.h in core!
48 */
49  
50  
51 /* TODO: This might be compatible further back than 5.10.0. */
52 #if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
53 # undef XS_EXTERNAL
54 # undef XS_INTERNAL
55 # if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
56 # define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
57 # define XS_INTERNAL(name) STATIC XSPROTO(name)
58 # endif
59 # if defined(__SYMBIAN32__)
60 # define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
61 # define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
62 # endif
63 # ifndef XS_EXTERNAL
64 # if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
65 # define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
66 # define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
67 # else
68 # ifdef __cplusplus
69 # define XS_EXTERNAL(name) extern "C" XSPROTO(name)
70 # define XS_INTERNAL(name) static XSPROTO(name)
71 # else
72 # define XS_EXTERNAL(name) XSPROTO(name)
73 # define XS_INTERNAL(name) STATIC XSPROTO(name)
74 # endif
75 # endif
76 # endif
77 #endif
78  
79 /* perl >= 5.10.0 && perl <= 5.15.1 */
80  
81  
82 /* The XS_EXTERNAL macro is used for functions that must not be static
83 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
84 * macro defined, the best we can do is assume XS is the same.
85 * Dito for XS_INTERNAL.
86 */
87 #ifndef XS_EXTERNAL
88 # define XS_EXTERNAL(name) XS(name)
89 #endif
90 #ifndef XS_INTERNAL
91 # define XS_INTERNAL(name) XS(name)
92 #endif
93  
94 /* Now, finally, after all this mess, we want an XS::Install::FrozenShit::ParseXS
95 * internal macro that we're free to redefine for varying linkage due
96 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
97 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
98 */
99  
100 #undef XS_EUPXS
101 #if defined(PERL_EUPXS_ALWAYS_EXPORT)
102 # define XS_EUPXS(name) XS_EXTERNAL(name)
103 #else
104 /* default to internal */
105 # define XS_EUPXS(name) XS_INTERNAL(name)
106 #endif
107  
108 #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
109 #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
110  
111 /* prototype to pass -Wmissing-prototypes */
112 STATIC void
113 S_croak_xs_usage(const CV *const cv, const char *const params);
114  
115 STATIC void
116 S_croak_xs_usage(const CV *const cv, const char *const params)
117 {
118 const GV *const gv = CvGV(cv);
119  
120 PERL_ARGS_ASSERT_CROAK_XS_USAGE;
121  
122 if (gv) {
123 const char *const gvname = GvNAME(gv);
124 const HV *const stash = GvSTASH(gv);
125 const char *const hvname = stash ? HvNAME(stash) : NULL;
126  
127 if (hvname)
128 Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
129 else
130 Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
131 } else {
132 /* Pants. I don't think that it should be possible to get here. */
133 Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
134 }
135 }
136 #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE
137  
138 #define croak_xs_usage S_croak_xs_usage
139  
140 #endif
141  
142 /* NOTE: the prototype of newXSproto() is different in versions of perls,
143 * so we define a portable version of newXSproto()
144 */
145 #ifdef newXS_flags
146 #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
147 #else
148 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
149 #endif /* !defined(newXS_flags) */
150  
151 #if PERL_VERSION_LE(5, 21, 5)
152 # define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
153 #else
154 # define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
155 #endif
156  
157 /* simple backcompat versions of the TARGx() macros with no optimisation */
158 #ifndef TARGi
159 # define TARGi(iv, do_taint) sv_setiv_mg(TARG, iv)
160 # define TARGu(uv, do_taint) sv_setuv_mg(TARG, uv)
161 # define TARGn(nv, do_taint) sv_setnv_mg(TARG, nv)
162 #endif
163  
164 #line 165 "t/cookbook/cookbook_xsgen.cc"
165  
166 /* INCLUDE: Including 'recipe01.xsi' from 'cookbook.xs' */
167  
168 #include <ctime>
169 #include <iostream>
170 struct DateRecipe01a {
171 0 DateRecipe01a() { update(false) ; }
172 0 ~DateRecipe01a() { std::cout << "~DateRecipe01a()\n"; }
173 0 void update(bool trace = true) {
174 0 ▶ if (trace) std::cout << "DateRecipe01a::update()\n";
Branch: 1 branch
BranchTrueFalseTotal
if (trace) std::cout << "DateRecipe01a::update()\n"; 0 0 0
175 0 epoch = std::time(nullptr);
176 0 }
177  
178 0 int get_epoch() const { return epoch; }
179 private:
180 std::time_t epoch;
181 };
182 namespace xs {
183 template <>
184 struct Typemap<DateRecipe01a*> : TypemapObject<DateRecipe01a*, DateRecipe01a*, ObjectTypePtr, ObjectStorageIV, StaticCast> {
185 0 ▶ static std::string package () { return "MyTest::Cookbook::DateRecipe01a"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::DateRecipe01a"; } 0 0 0
186 };
187 }
188 struct DateRecipe01b {
189 0 DateRecipe01b() { update(false) ; }
190 0 ~DateRecipe01b() { std::cout << "~DateRecipe01b()\n"; }
191 0 void update(bool trace = true) {
192 0 ▶ if (trace) std::cout << "DateRecipe01b::update()\n";
Branch: 1 branch
BranchTrueFalseTotal
if (trace) std::cout << "DateRecipe01b::update()\n"; 0 0 0
193 0 epoch = std::time(nullptr);
194 0 }
195  
196 0 int get_epoch() const { return epoch; }
197 private:
198 std::time_t epoch;
199 };
200 namespace xs {
201 template <>
202 struct Typemap<DateRecipe01b*> : TypemapObject<DateRecipe01b*, DateRecipe01b*, ObjectTypePtr, ObjectStorageMG, StaticCast> {
203 0 ▶ static std::string package () { return "MyTest::Cookbook::DateRecipe01b"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::DateRecipe01b"; } 0 0 0
204 };
205 }
206  
207  
208 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01a_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01a_new) { xs::throw_guard(cv, [=]() 0 0 0
209 {
210 0 dVAR; dXSARGS;
211 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
212 0 croak_xs_usage(cv, "CLASS");
213 {
214 DateRecipe01a * RETVAL;
215 0 SV* CLASS = ST(0)
216 ;
217 #line 50 "t/cookbook/recipe01.xsi"
218 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
219 PROTO = CLASS;
220 RETVAL = new DateRecipe01a();
221 #line 222 "t/cookbook/cookbook_xsgen.cc"
222 {
223 SV * RETVALSV;
224 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
225 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
226 0 ST(0) = RETVALSV;
227 }
228 0 }
229 0 XSRETURN(1);
230 0 }); }
231  
232  
233  
234 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01a_update) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01a_update) { xs::throw_guard(cv, [=]() 0 0 0
235 {
236 0 dVAR; dXSARGS;
237 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
238 0 croak_xs_usage(cv, "THIS");
239 PERL_UNUSED_VAR(ax); /* -Wall */
240 0 SP -= items;
241 {
242 0 ▶ DateRecipe01a* THIS = xs::in<DateRecipe01a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
DateRecipe01a* THIS = xs::in<DateRecipe01a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
243 ;
244 #line 52 "t/cookbook/recipe01.xsi"
245 THIS->update();
246 #line 247 "t/cookbook/cookbook_xsgen.cc"
247 0 PUTBACK;
248 0 return;
249 }
250 0 }); }
251  
252  
253  
254 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01a_get_epoch) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01a_get_epoch) { xs::throw_guard(cv, [=]() 0 0 0
255 {
256 0 dVAR; dXSARGS;
257 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
258 0 croak_xs_usage(cv, "THIS");
259 {
260 std::time_t RETVAL;
261 0 ▶ DateRecipe01a* THIS = xs::in<DateRecipe01a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe01a* THIS = xs::in<DateRecipe01a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe01a* THIS = xs::in<DateRecipe01a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
262 ;
263 #line 54 "t/cookbook/recipe01.xsi"
264 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
265 RETVAL = THIS->get_epoch();
266 #line 267 "t/cookbook/cookbook_xsgen.cc"
267 {
268 SV * RETVALSV;
269 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
270 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
271 0 ST(0) = RETVALSV;
272 }
273 0 }
274 0 XSRETURN(1);
275 0 }); }
276  
277  
278  
279 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01a_DESTROY) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01a_DESTROY) { xs::throw_guard(cv, [=]() 0 0 0
280 {
281 0 dVAR; dXSARGS;
282 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
283 0 croak_xs_usage(cv, "THIS");
284 PERL_UNUSED_VAR(ax); /* -Wall */
285 0 SP -= items;
286 {
287 0 ▶ DateRecipe01a* THIS = xs::in<DateRecipe01a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe01a* THIS = xs::in<DateRecipe01a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe01a* THIS = xs::in<DateRecipe01a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
288 ;
289 #line 57 "t/cookbook/recipe01.xsi"
290 std::cout << "xs-adapter MyTest::Cookbook::DateRecipe01a::DESTROY\n";
291 xs::Typemap<DateRecipe01a*>().destroy(THIS, SvRV(ST(0)));
292 #line 293 "t/cookbook/cookbook_xsgen.cc"
293 0 PUTBACK;
294 0 return;
295 }
296 0 }); }
297  
298  
299  
300 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01b_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01b_new) { xs::throw_guard(cv, [=]() 0 0 0
301 {
302 0 dVAR; dXSARGS;
303 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
304 0 croak_xs_usage(cv, "CLASS");
305 {
306 DateRecipe01b * RETVAL;
307 0 SV* CLASS = ST(0)
308 ;
309 #line 63 "t/cookbook/recipe01.xsi"
310 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
311 PROTO = CLASS;
312 RETVAL = new DateRecipe01b();
313 #line 314 "t/cookbook/cookbook_xsgen.cc"
314 {
315 SV * RETVALSV;
316 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
317 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
318 0 ST(0) = RETVALSV;
319 }
320 0 }
321 0 XSRETURN(1);
322 0 }); }
323  
324  
325  
326 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01b_update) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01b_update) { xs::throw_guard(cv, [=]() 0 0 0
327 {
328 0 dVAR; dXSARGS;
329 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
330 0 croak_xs_usage(cv, "THIS");
331 PERL_UNUSED_VAR(ax); /* -Wall */
332 0 SP -= items;
333 {
334 0 ▶ DateRecipe01b* THIS = xs::in<DateRecipe01b *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
DateRecipe01b* THIS = xs::in<DateRecipe01b *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
335 ;
336 #line 65 "t/cookbook/recipe01.xsi"
337 THIS->update();
338 #line 339 "t/cookbook/cookbook_xsgen.cc"
339 0 PUTBACK;
340 0 return;
341 }
342 0 }); }
343  
344  
345  
346 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01b_get_epoch) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe01b_get_epoch) { xs::throw_guard(cv, [=]() 0 0 0
347 {
348 0 dVAR; dXSARGS;
349 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
350 0 croak_xs_usage(cv, "THIS");
351 {
352 std::time_t RETVAL;
353 0 ▶ DateRecipe01b* THIS = xs::in<DateRecipe01b *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe01b* THIS = xs::in<DateRecipe01b *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe01b* THIS = xs::in<DateRecipe01b *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
354 ;
355 #line 67 "t/cookbook/recipe01.xsi"
356 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
357 RETVAL = THIS->get_epoch();
358 #line 359 "t/cookbook/cookbook_xsgen.cc"
359 {
360 SV * RETVALSV;
361 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
362 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
363 0 ST(0) = RETVALSV;
364 }
365 0 }
366 0 XSRETURN(1);
367 0 }); }
368  
369  
370 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe01.xsi' */
371  
372  
373 /* INCLUDE: Including 'recipe02.xsi' from 'cookbook.xs' */
374  
375 #include <ctime>
376 #include <iostream>
377 struct DateRecipe02a {
378 0 DateRecipe02a() { update() ; }
379 0 void update() { epoch = std::time(nullptr); }
380  
381 0 int get_epoch() const { return epoch; }
382 private:
383 std::time_t epoch;
384 };
385 namespace xs {
386 template <>
387 struct Typemap<DateRecipe02a*> : TypemapObject<DateRecipe02a*, DateRecipe02a*, ObjectTypePtr, ObjectStorageIV, StaticCast> {
388 0 ▶ static std::string package () { return "MyTest::Cookbook::DateRecipe02a"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::DateRecipe02a"; } 0 0 0
389 };
390 }
391 struct DateRecipe02b {
392 0 DateRecipe02b() { update() ; }
393 0 void update() { epoch = std::time(nullptr); }
394  
395 0 int get_epoch() const { return epoch; }
396 private:
397 std::time_t epoch;
398 };
399 namespace xs {
400 template <>
401 struct Typemap<DateRecipe02b*> : TypemapObject<DateRecipe02b*, DateRecipe02b*, ObjectTypePtr, ObjectStorageMG, StaticCast> {
402 0 ▶ static std::string package () { return "MyTest::Cookbook::DateRecipe02b"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::DateRecipe02b"; } 0 0 0
403 };
404 }
405  
406  
407 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02a_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02a_new) { xs::throw_guard(cv, [=]() 0 0 0
408 {
409 0 dVAR; dXSARGS;
410 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
411 0 croak_xs_usage(cv, "CLASS");
412 {
413 DateRecipe02a * RETVAL;
414 0 SV* CLASS = ST(0)
415 ;
416 #line 41 "t/cookbook/recipe02.xsi"
417 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
418 PROTO = CLASS;
419 RETVAL = new DateRecipe02a();
420 #line 421 "t/cookbook/cookbook_xsgen.cc"
421 {
422 SV * RETVALSV;
423 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
424 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
425 0 ST(0) = RETVALSV;
426 }
427 0 }
428 0 XSRETURN(1);
429 0 }); }
430  
431  
432  
433 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02a_update) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02a_update) { xs::throw_guard(cv, [=]() 0 0 0
434 {
435 0 dVAR; dXSARGS;
436 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
437 0 croak_xs_usage(cv, "THIS");
438 PERL_UNUSED_VAR(ax); /* -Wall */
439 0 SP -= items;
440 {
441 0 ▶ DateRecipe02a* THIS = xs::in<DateRecipe02a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
DateRecipe02a* THIS = xs::in<DateRecipe02a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
442 ;
443 #line 43 "t/cookbook/recipe02.xsi"
444 THIS->update();
445 #line 446 "t/cookbook/cookbook_xsgen.cc"
446 0 PUTBACK;
447 0 return;
448 }
449 0 }); }
450  
451  
452  
453 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02a_get_epoch) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02a_get_epoch) { xs::throw_guard(cv, [=]() 0 0 0
454 {
455 0 dVAR; dXSARGS;
456 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
457 0 croak_xs_usage(cv, "THIS");
458 {
459 std::time_t RETVAL;
460 0 ▶ DateRecipe02a* THIS = xs::in<DateRecipe02a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe02a* THIS = xs::in<DateRecipe02a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe02a* THIS = xs::in<DateRecipe02a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
461 ;
462 #line 45 "t/cookbook/recipe02.xsi"
463 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
464 RETVAL = THIS->get_epoch();
465 #line 466 "t/cookbook/cookbook_xsgen.cc"
466 {
467 SV * RETVALSV;
468 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
469 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
470 0 ST(0) = RETVALSV;
471 }
472 0 }
473 0 XSRETURN(1);
474 0 }); }
475  
476  
477  
478 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02a_DESTROY) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02a_DESTROY) { xs::throw_guard(cv, [=]() 0 0 0
479 {
480 0 dVAR; dXSARGS;
481 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
482 0 croak_xs_usage(cv, "THIS");
483 PERL_UNUSED_VAR(ax); /* -Wall */
484 0 SP -= items;
485 {
486 0 ▶ DateRecipe02a* THIS = xs::in<DateRecipe02a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe02a* THIS = xs::in<DateRecipe02a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe02a* THIS = xs::in<DateRecipe02a *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
487 ;
488 #line 51 "t/cookbook/recipe02.xsi"
489 xs::Typemap<DateRecipe02a*>().destroy(THIS, SvRV(ST(0)));
490 #line 491 "t/cookbook/cookbook_xsgen.cc"
491 0 PUTBACK;
492 0 return;
493 }
494 0 }); }
495  
496  
497  
498 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02b_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02b_new) { xs::throw_guard(cv, [=]() 0 0 0
499 {
500 0 dVAR; dXSARGS;
501 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
502 0 croak_xs_usage(cv, "CLASS");
503 {
504 DateRecipe02b * RETVAL;
505 0 SV* CLASS = ST(0)
506 ;
507 #line 57 "t/cookbook/recipe02.xsi"
508 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
509 PROTO = CLASS;
510 RETVAL = new DateRecipe02b();
511 #line 512 "t/cookbook/cookbook_xsgen.cc"
512 {
513 SV * RETVALSV;
514 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
515 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
516 0 ST(0) = RETVALSV;
517 }
518 0 }
519 0 XSRETURN(1);
520 0 }); }
521  
522  
523  
524 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02b_update) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02b_update) { xs::throw_guard(cv, [=]() 0 0 0
525 {
526 0 dVAR; dXSARGS;
527 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
528 0 croak_xs_usage(cv, "THIS");
529 PERL_UNUSED_VAR(ax); /* -Wall */
530 0 SP -= items;
531 {
532 0 ▶ DateRecipe02b* THIS = xs::in<DateRecipe02b *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
DateRecipe02b* THIS = xs::in<DateRecipe02b *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
533 ;
534 #line 59 "t/cookbook/recipe02.xsi"
535 THIS->update();
536 #line 537 "t/cookbook/cookbook_xsgen.cc"
537 0 PUTBACK;
538 0 return;
539 }
540 0 }); }
541  
542  
543  
544 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02b_get_epoch) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe02b_get_epoch) { xs::throw_guard(cv, [=]() 0 0 0
545 {
546 0 dVAR; dXSARGS;
547 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
548 0 croak_xs_usage(cv, "THIS");
549 {
550 std::time_t RETVAL;
551 0 ▶ DateRecipe02b* THIS = xs::in<DateRecipe02b *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe02b* THIS = xs::in<DateRecipe02b *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe02b* THIS = xs::in<DateRecipe02b *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
552 ;
553 #line 61 "t/cookbook/recipe02.xsi"
554 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
555 RETVAL = THIS->get_epoch();
556 #line 557 "t/cookbook/cookbook_xsgen.cc"
557 {
558 SV * RETVALSV;
559 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
560 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
561 0 ST(0) = RETVALSV;
562 }
563 0 }
564 0 XSRETURN(1);
565 0 }); }
566  
567  
568 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe02.xsi' */
569  
570  
571 /* INCLUDE: Including 'recipe03.xsi' from 'cookbook.xs' */
572  
573 struct TimezoneRecipe03 {
574 0 const char* get_name() const { return name; }
575 0 static const TimezoneRecipe03& get_instance() {
576 0 ▶ static TimezoneRecipe03* instance = new TimezoneRecipe03();
Branch: 4 branches
BranchTrueFalseTotal
static TimezoneRecipe03* instance = new TimezoneRecipe03(); 0 0 0
static TimezoneRecipe03* instance = new TimezoneRecipe03(); 0 0 0
static TimezoneRecipe03* instance = new TimezoneRecipe03(); 0 0 0
static TimezoneRecipe03* instance = new TimezoneRecipe03(); 0 0 0
577 0 return *instance;
578 }
579 private:
580 0 TimezoneRecipe03() { name = "Europe/Minsk"; }
581 const char* name;
582 };
583 namespace xs {
584 template <>
585 struct Typemap<const TimezoneRecipe03*> : TypemapObject<const TimezoneRecipe03*, const TimezoneRecipe03*, ObjectTypeForeignPtr, ObjectStorageIV, StaticCast> {
586 0 ▶ static std::string package () { return "MyTest::Cookbook::TimezoneRecipe03"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::TimezoneRecipe03"; } 0 0 0
587 };
588 }
589  
590  
591 0 ▶XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe03_get_name) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe03_get_name) { xs::throw_guard(cv, [=]() 0 0 0
592 {
593 0 dVAR; dXSARGS;
594 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
595 0 croak_xs_usage(cv, "THIS");
596 {
597 const char * RETVAL;
598 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
599 0 ▶ const TimezoneRecipe03* THIS = xs::in<const TimezoneRecipe03 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
const TimezoneRecipe03* THIS = xs::in<const TimezoneRecipe03 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
600 ;
601 #line 24 "t/cookbook/recipe03.xsi"
602 RETVAL = THIS->get_name();
603 #line 604 "t/cookbook/cookbook_xsgen.cc"
604 0 sv_setpv((SV*)TARG, RETVAL);
605 0 ST(0) = TARG;
606 }
607 0 XSRETURN(1);
608 0 }); }
609  
610  
611  
612 0 ▶XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe03_get_instance) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe03_get_instance) { xs::throw_guard(cv, [=]() 0 0 0
613 {
614 0 dVAR; dXSARGS;
615 0 ▶ if (items != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 0) 0 0 0
616 0 croak_xs_usage(cv, "");
617 {
618 const TimezoneRecipe03 * RETVAL;
619 #line 26 "t/cookbook/recipe03.xsi"
620 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
621 RETVAL = &TimezoneRecipe03::get_instance();
622 #line 623 "t/cookbook/cookbook_xsgen.cc"
623 {
624 SV * RETVALSV;
625 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
626 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
627 0 ST(0) = RETVALSV;
628 }
629 0 }
630 0 XSRETURN(1);
631 0 }); }
632  
633  
634 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe03.xsi' */
635  
636  
637 /* INCLUDE: Including 'recipe04.xsi' from 'cookbook.xs' */
638  
639 #include <iostream>
640 #include <memory>
641 struct TimezoneRecipe04 {
642 0 const char* get_name() const { return name.c_str(); }
643 0 static std::shared_ptr<TimezoneRecipe04> create(const char* name) {
644 0 return std::make_shared<TimezoneRecipe04>(name);
645 }
646 0 ▶ TimezoneRecipe04(const char* name_): name{name_} { }
Branch: 1 branch
BranchTrueFalseTotal
TimezoneRecipe04(const char* name_): name{name_} { } 0 0 0
647 0 ~TimezoneRecipe04() { std::cout << "~TimezoneRecipe04()\n"; }
648 private:
649 std::string name;
650 };
651 using TimezoneRecipe04SP = std::shared_ptr<TimezoneRecipe04>;
652 namespace xs {
653 template <>
654 struct Typemap<TimezoneRecipe04SP> : TypemapObject<TimezoneRecipe04SP, TimezoneRecipe04SP, ObjectTypeSharedPtr, ObjectStorageMG, StaticCast> {
655 0 ▶ static std::string package () { return "MyTest::Cookbook::TimezoneRecipe04"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::TimezoneRecipe04"; } 0 0 0
656 };
657 }
658 struct DateRecipe04 {
659 0 DateRecipe04() { update() ; }
660 0 void update() { epoch = std::time(nullptr); }
661  
662 0 int get_epoch() const { return epoch; }
663 0 void set_timezone(TimezoneRecipe04SP tz_) { tz = tz_; }
664 0 TimezoneRecipe04SP get_timezone() { return tz; }
665 private:
666 std::time_t epoch;
667 TimezoneRecipe04SP tz;
668 };
669 namespace xs {
670 template <>
671 struct Typemap<DateRecipe04*> : TypemapObject<DateRecipe04*, DateRecipe04*, ObjectTypePtr, ObjectStorageMG, StaticCast> {
672 0 ▶ static std::string package () { return "MyTest::Cookbook::DateRecipe04"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::DateRecipe04"; } 0 0 0
673 };
674 }
675  
676  
677 0 ▶XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe04_get_name) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe04_get_name) { xs::throw_guard(cv, [=]() 0 0 0
678 {
679 0 dVAR; dXSARGS;
680 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
681 0 croak_xs_usage(cv, "tz");
682 {
683 const char * RETVAL;
684 0 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 0 0 0
dXSTARG; 0 0 0
685 0 ▶ TimezoneRecipe04SP tz = xs::in<TimezoneRecipe04SP>(ST(0));
Branch: 1 branch
BranchTrueFalseTotal
TimezoneRecipe04SP tz = xs::in<TimezoneRecipe04SP>(ST(0)); 0 0 0
686 ;
687 #line 48 "t/cookbook/recipe04.xsi"
688 RETVAL = tz->get_name();
689 #line 690 "t/cookbook/cookbook_xsgen.cc"
690 0 ▶ sv_setpv((SV*)TARG, RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
sv_setpv((SV*)TARG, RETVAL); 0 0 0
691 0 ST(0) = TARG;
692 0 }
693 0 XSRETURN(1);
694 0 }); }
695  
696  
697  
698 0 ▶XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe04_create) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe04_create) { xs::throw_guard(cv, [=]() 0 0 0
699 {
700 0 dVAR; dXSARGS;
701 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
702 0 croak_xs_usage(cv, "name");
703 {
704 0 TimezoneRecipe04SP RETVAL;
705 0 const char* name = (const char *)SvPV_nolen(ST(0))
706 ;
707 #line 50 "t/cookbook/recipe04.xsi"
708 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
709 RETVAL = TimezoneRecipe04::create(name);
710 #line 711 "t/cookbook/cookbook_xsgen.cc"
711 {
712 SV * RETVALSV;
713 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
714 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
715 0 ST(0) = RETVALSV;
716 }
717 0 }
718 0 XSRETURN(1);
719 0 }); }
720  
721  
722  
723 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe04_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe04_new) { xs::throw_guard(cv, [=]() 0 0 0
724 {
725 0 dVAR; dXSARGS;
726 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
727 0 croak_xs_usage(cv, "CLASS");
728 {
729 DateRecipe04 * RETVAL;
730 0 SV* CLASS = ST(0)
731 ;
732 #line 55 "t/cookbook/recipe04.xsi"
733 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
734 PROTO = CLASS;
735 RETVAL = new DateRecipe04();
736 #line 737 "t/cookbook/cookbook_xsgen.cc"
737 {
738 SV * RETVALSV;
739 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
740 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
741 0 ST(0) = RETVALSV;
742 }
743 0 }
744 0 XSRETURN(1);
745 0 }); }
746  
747  
748  
749 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe04_update) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe04_update) { xs::throw_guard(cv, [=]() 0 0 0
750 {
751 0 dVAR; dXSARGS;
752 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
753 0 croak_xs_usage(cv, "THIS");
754 PERL_UNUSED_VAR(ax); /* -Wall */
755 0 SP -= items;
756 {
757 0 ▶ DateRecipe04* THIS = xs::in<DateRecipe04 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
DateRecipe04* THIS = xs::in<DateRecipe04 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
758 ;
759 #line 57 "t/cookbook/recipe04.xsi"
760 THIS->update();
761 #line 762 "t/cookbook/cookbook_xsgen.cc"
762 0 PUTBACK;
763 0 return;
764 }
765 0 }); }
766  
767  
768  
769 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe04_get_epoch) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe04_get_epoch) { xs::throw_guard(cv, [=]() 0 0 0
770 {
771 0 dVAR; dXSARGS;
772 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
773 0 croak_xs_usage(cv, "THIS");
774 {
775 std::time_t RETVAL;
776 0 ▶ DateRecipe04* THIS = xs::in<DateRecipe04 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe04* THIS = xs::in<DateRecipe04 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe04* THIS = xs::in<DateRecipe04 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
777 ;
778 #line 59 "t/cookbook/recipe04.xsi"
779 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
780 RETVAL = THIS->get_epoch();
781 #line 782 "t/cookbook/cookbook_xsgen.cc"
782 {
783 SV * RETVALSV;
784 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
785 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
786 0 ST(0) = RETVALSV;
787 }
788 0 }
789 0 XSRETURN(1);
790 0 }); }
791  
792  
793  
794 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe04_get_timezone) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe04_get_timezone) { xs::throw_guard(cv, [=]() 0 0 0
795 {
796 0 dVAR; dXSARGS;
797 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
798 0 croak_xs_usage(cv, "THIS");
799 {
800 0 TimezoneRecipe04SP RETVAL;
801 0 ▶ DateRecipe04* THIS = xs::in<DateRecipe04 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe04* THIS = xs::in<DateRecipe04 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe04* THIS = xs::in<DateRecipe04 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
802 ;
803 #line 61 "t/cookbook/recipe04.xsi"
804 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
805 RETVAL = THIS->get_timezone();
806 #line 807 "t/cookbook/cookbook_xsgen.cc"
807 {
808 SV * RETVALSV;
809 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
810 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
811 0 ST(0) = RETVALSV;
812 }
813 0 }
814 0 XSRETURN(1);
815 0 }); }
816  
817  
818  
819 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe04_set_timezone) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe04_set_timezone) { xs::throw_guard(cv, [=]() 0 0 0
820 {
821 0 dVAR; dXSARGS;
822 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
823 0 croak_xs_usage(cv, "THIS, tz");
824 PERL_UNUSED_VAR(ax); /* -Wall */
825 0 SP -= items;
826 {
827 0 ▶ DateRecipe04* THIS = xs::in<DateRecipe04 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe04* THIS = xs::in<DateRecipe04 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe04* THIS = xs::in<DateRecipe04 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
828 ;
829 0 ▶ TimezoneRecipe04SP tz = xs::in<TimezoneRecipe04SP>(ST(1));
Branch: 1 branch
BranchTrueFalseTotal
TimezoneRecipe04SP tz = xs::in<TimezoneRecipe04SP>(ST(1)); 0 0 0
830 ;
831 #line 63 "t/cookbook/recipe04.xsi"
832 THIS->set_timezone(tz);
833 #line 834 "t/cookbook/cookbook_xsgen.cc"
834 0 PUTBACK;
835 0 return;
836 0 }
837 0 }); }
838  
839  
840 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe04.xsi' */
841  
842  
843 /* INCLUDE: Including 'recipe05.xsi' from 'cookbook.xs' */
844  
845 #include <iostream>
846 struct TimezoneRecipe05: public panda::Refcnt {
847 0 const char* get_name() const { return name.c_str(); }
848 0 ▶ TimezoneRecipe05(const char* name_): name{name_} { }
Branch: 1 branch
BranchTrueFalseTotal
TimezoneRecipe05(const char* name_): name{name_} { } 0 0 0
849 0 ~TimezoneRecipe05() { std::cout << "~TimezoneRecipe05()\n"; }
850 private:
851 std::string name;
852 };
853 using TimezoneRecipe05SP = panda::iptr<TimezoneRecipe05>;
854 struct DateRecipe05 {
855 0 DateRecipe05() { update() ; }
856 0 void update() { epoch = std::time(nullptr); }
857  
858 0 int get_epoch() const { return epoch; }
859 0 void set_timezone(TimezoneRecipe05SP tz_) { tz = tz_; }
860 0 TimezoneRecipe05SP get_timezone() { return tz; }
861 private:
862 std::time_t epoch;
863 TimezoneRecipe05SP tz;
864 };
865 namespace xs {
866 template <>
867 struct Typemap<TimezoneRecipe05*> : TypemapObject<TimezoneRecipe05*, TimezoneRecipe05*, ObjectTypeRefcntPtr, ObjectStorageMG, StaticCast> {
868 0 ▶ static std::string package () { return "MyTest::Cookbook::TimezoneRecipe05"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::TimezoneRecipe05"; } 0 0 0
869 };
870 }
871 namespace xs {
872 template <>
873 struct Typemap<DateRecipe05*> : TypemapObject<DateRecipe05*, DateRecipe05*, ObjectTypePtr, ObjectStorageMG, StaticCast> {
874 0 ▶ static std::string package () { return "MyTest::Cookbook::DateRecipe05"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::DateRecipe05"; } 0 0 0
875 };
876 }
877  
878  
879 0 ▶XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe05_get_name) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe05_get_name) { xs::throw_guard(cv, [=]() 0 0 0
880 {
881 0 dVAR; dXSARGS;
882 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
883 0 croak_xs_usage(cv, "THIS");
884 {
885 const char * RETVAL;
886 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
887 0 ▶ TimezoneRecipe05* THIS = xs::in<TimezoneRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
TimezoneRecipe05* THIS = xs::in<TimezoneRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
888 ;
889 #line 46 "t/cookbook/recipe05.xsi"
890 RETVAL = THIS->get_name();
891 #line 892 "t/cookbook/cookbook_xsgen.cc"
892 0 sv_setpv((SV*)TARG, RETVAL);
893 0 ST(0) = TARG;
894 }
895 0 XSRETURN(1);
896 0 }); }
897  
898  
899  
900 0 ▶XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe05_create) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe05_create) { xs::throw_guard(cv, [=]() 0 0 0
901 {
902 0 dVAR; dXSARGS;
903 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
904 0 croak_xs_usage(cv, "name");
905 {
906 0 TimezoneRecipe05SP RETVAL;
907 0 const char* name = (const char *)SvPV_nolen(ST(0))
908 ;
909 #line 48 "t/cookbook/recipe05.xsi"
910 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
911 RETVAL = TimezoneRecipe05SP(new TimezoneRecipe05(name));
912 #line 913 "t/cookbook/cookbook_xsgen.cc"
913 {
914 SV * RETVALSV;
915 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
916 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
917 0 ST(0) = RETVALSV;
918 }
919 0 }
920 0 XSRETURN(1);
921 0 }); }
922  
923  
924  
925 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe05_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe05_new) { xs::throw_guard(cv, [=]() 0 0 0
926 {
927 0 dVAR; dXSARGS;
928 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
929 0 croak_xs_usage(cv, "CLASS");
930 {
931 DateRecipe05 * RETVAL;
932 0 SV* CLASS = ST(0)
933 ;
934 #line 53 "t/cookbook/recipe05.xsi"
935 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
936 PROTO = CLASS;
937 RETVAL = new DateRecipe05();
938 #line 939 "t/cookbook/cookbook_xsgen.cc"
939 {
940 SV * RETVALSV;
941 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
942 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
943 0 ST(0) = RETVALSV;
944 }
945 0 }
946 0 XSRETURN(1);
947 0 }); }
948  
949  
950  
951 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe05_update) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe05_update) { xs::throw_guard(cv, [=]() 0 0 0
952 {
953 0 dVAR; dXSARGS;
954 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
955 0 croak_xs_usage(cv, "THIS");
956 PERL_UNUSED_VAR(ax); /* -Wall */
957 0 SP -= items;
958 {
959 0 ▶ DateRecipe05* THIS = xs::in<DateRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
DateRecipe05* THIS = xs::in<DateRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
960 ;
961 #line 55 "t/cookbook/recipe05.xsi"
962 THIS->update();
963 #line 964 "t/cookbook/cookbook_xsgen.cc"
964 0 PUTBACK;
965 0 return;
966 }
967 0 }); }
968  
969  
970  
971 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe05_get_epoch) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe05_get_epoch) { xs::throw_guard(cv, [=]() 0 0 0
972 {
973 0 dVAR; dXSARGS;
974 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
975 0 croak_xs_usage(cv, "THIS");
976 {
977 std::time_t RETVAL;
978 0 ▶ DateRecipe05* THIS = xs::in<DateRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe05* THIS = xs::in<DateRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe05* THIS = xs::in<DateRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
979 ;
980 #line 57 "t/cookbook/recipe05.xsi"
981 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
982 RETVAL = THIS->get_epoch();
983 #line 984 "t/cookbook/cookbook_xsgen.cc"
984 {
985 SV * RETVALSV;
986 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
987 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
988 0 ST(0) = RETVALSV;
989 }
990 0 }
991 0 XSRETURN(1);
992 0 }); }
993  
994  
995  
996 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe05_get_timezone) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe05_get_timezone) { xs::throw_guard(cv, [=]() 0 0 0
997 {
998 0 dVAR; dXSARGS;
999 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1000 0 croak_xs_usage(cv, "THIS");
1001 {
1002 0 TimezoneRecipe05SP RETVAL;
1003 0 ▶ DateRecipe05* THIS = xs::in<DateRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe05* THIS = xs::in<DateRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe05* THIS = xs::in<DateRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1004 ;
1005 #line 59 "t/cookbook/recipe05.xsi"
1006 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1007 RETVAL = THIS->get_timezone();
1008 #line 1009 "t/cookbook/cookbook_xsgen.cc"
1009 {
1010 SV * RETVALSV;
1011 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1012 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1013 0 ST(0) = RETVALSV;
1014 }
1015 0 }
1016 0 XSRETURN(1);
1017 0 }); }
1018  
1019  
1020  
1021 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe05_set_timezone) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe05_set_timezone) { xs::throw_guard(cv, [=]() 0 0 0
1022 {
1023 0 dVAR; dXSARGS;
1024 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
1025 0 croak_xs_usage(cv, "THIS, tz");
1026 PERL_UNUSED_VAR(ax); /* -Wall */
1027 0 SP -= items;
1028 {
1029 0 ▶ DateRecipe05* THIS = xs::in<DateRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe05* THIS = xs::in<DateRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe05* THIS = xs::in<DateRecipe05 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1030 ;
1031 0 ▶ TimezoneRecipe05SP tz = xs::in<TimezoneRecipe05SP>(ST(1));
Branch: 1 branch
BranchTrueFalseTotal
TimezoneRecipe05SP tz = xs::in<TimezoneRecipe05SP>(ST(1)); 0 0 0
1032 ;
1033 #line 61 "t/cookbook/recipe05.xsi"
1034 THIS->set_timezone(tz);
1035 #line 1036 "t/cookbook/cookbook_xsgen.cc"
1036 0 PUTBACK;
1037 0 return;
1038 0 }
1039 0 }); }
1040  
1041  
1042 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe05.xsi' */
1043  
1044  
1045 /* INCLUDE: Including 'recipe06.xsi' from 'cookbook.xs' */
1046  
1047 struct Base06 {
1048 0 virtual const char* method() { return "from base"; }
1049 0 virtual ~Base06() { }
1050 };
1051 struct Derived06A: public Base06 {
1052 0 virtual const char* method() { return "from derived-A"; }
1053 0 const char* specific_method() { return "specific-A"; }
1054 };
1055 struct Derived06B: public Base06 {
1056 0 virtual const char* method() { return "from derived-B"; }
1057 0 const char* specific_method() { return "specific-B"; }
1058 };
1059 namespace xs {
1060 template <typename D>
1061 struct Typemap<Base06*, D> : TypemapObject<Base06*, D, ObjectTypePtr, ObjectStorageMG, StaticCast> {
1062 0 ▶ static std::string package () { return "MyTest::Cookbook::Base04"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::Base04"; } 0 0 0
1063 };
1064  
1065 template <> struct Typemap<Derived06A*> : Typemap<Base06*, Derived06A*> {
1066 0 ▶ static std::string package () { return "MyTest::Cookbook::Derived06A"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::Derived06A"; } 0 0 0
1067 };
1068  
1069 template <> struct Typemap<Derived06B*> : Typemap<Base06*, Derived06B*> {
1070 0 ▶ static std::string package () { return "MyTest::Cookbook::Derived06B"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::Derived06B"; } 0 0 0
1071 };
1072 }
1073  
1074  
1075 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Base06_method) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Base06_method) { xs::throw_guard(cv, [=]() 0 0 0
1076 {
1077 0 dVAR; dXSARGS;
1078 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1079 0 croak_xs_usage(cv, "THIS");
1080 {
1081 const char * RETVAL;
1082 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
1083 0 ▶ Base06* THIS = xs::in<Base06 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Base06* THIS = xs::in<Base06 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1084 ;
1085 #line 38 "t/cookbook/recipe06.xsi"
1086 RETVAL = THIS->method();
1087 #line 1088 "t/cookbook/cookbook_xsgen.cc"
1088 0 sv_setpv((SV*)TARG, RETVAL);
1089 0 ST(0) = TARG;
1090 }
1091 0 XSRETURN(1);
1092 0 }); }
1093  
1094  
1095  
1096 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Base06_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Base06_new) { xs::throw_guard(cv, [=]() 0 0 0
1097 {
1098 0 dVAR; dXSARGS;
1099 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1100 0 croak_xs_usage(cv, "CLASS");
1101 {
1102 Base06 * RETVAL;
1103 0 SV* CLASS = ST(0)
1104 ;
1105 #line 40 "t/cookbook/recipe06.xsi"
1106 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1107 PROTO = CLASS;
1108 RETVAL = new Base06();
1109 #line 1110 "t/cookbook/cookbook_xsgen.cc"
1110 {
1111 SV * RETVALSV;
1112 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1113 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1114 0 ST(0) = RETVALSV;
1115 }
1116 0 }
1117 0 XSRETURN(1);
1118 0 }); }
1119  
1120  
1121  
1122 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Derived06A_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Derived06A_new) { xs::throw_guard(cv, [=]() 0 0 0
1123 {
1124 0 dVAR; dXSARGS;
1125 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1126 0 croak_xs_usage(cv, "CLASS");
1127 {
1128 Derived06A * RETVAL;
1129 0 SV* CLASS = ST(0)
1130 ;
1131 #line 45 "t/cookbook/recipe06.xsi"
1132 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1133 PROTO = CLASS;
1134 RETVAL = new Derived06A();
1135 #line 1136 "t/cookbook/cookbook_xsgen.cc"
1136 {
1137 SV * RETVALSV;
1138 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1139 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1140 0 ST(0) = RETVALSV;
1141 }
1142 0 }
1143 0 XSRETURN(1);
1144 0 }); }
1145  
1146  
1147  
1148 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Derived06A_specific_method) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Derived06A_specific_method) { xs::throw_guard(cv, [=]() 0 0 0
1149 {
1150 0 dVAR; dXSARGS;
1151 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1152 0 croak_xs_usage(cv, "THIS");
1153 {
1154 const char * RETVAL;
1155 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
1156 0 ▶ Derived06A* THIS = xs::in<Derived06A *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Derived06A* THIS = xs::in<Derived06A *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1157 ;
1158 #line 47 "t/cookbook/recipe06.xsi"
1159 RETVAL = THIS->specific_method();
1160 #line 1161 "t/cookbook/cookbook_xsgen.cc"
1161 0 sv_setpv((SV*)TARG, RETVAL);
1162 0 ST(0) = TARG;
1163 }
1164 0 XSRETURN(1);
1165 0 }); }
1166  
1167  
1168  
1169 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Derived06B_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Derived06B_new) { xs::throw_guard(cv, [=]() 0 0 0
1170 {
1171 0 dVAR; dXSARGS;
1172 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1173 0 croak_xs_usage(cv, "CLASS");
1174 {
1175 Derived06B * RETVAL;
1176 0 SV* CLASS = ST(0)
1177 ;
1178 #line 56 "t/cookbook/recipe06.xsi"
1179 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1180 PROTO = CLASS;
1181 RETVAL = new Derived06B();
1182 #line 1183 "t/cookbook/cookbook_xsgen.cc"
1183 {
1184 SV * RETVALSV;
1185 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1186 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1187 0 ST(0) = RETVALSV;
1188 }
1189 0 }
1190 0 XSRETURN(1);
1191 0 }); }
1192  
1193  
1194  
1195 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Derived06B_specific_method) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Derived06B_specific_method) { xs::throw_guard(cv, [=]() 0 0 0
1196 {
1197 0 dVAR; dXSARGS;
1198 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1199 0 croak_xs_usage(cv, "THIS");
1200 {
1201 const char * RETVAL;
1202 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
1203 0 ▶ Derived06B* THIS = xs::in<Derived06B *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Derived06B* THIS = xs::in<Derived06B *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1204 ;
1205 #line 58 "t/cookbook/recipe06.xsi"
1206 RETVAL = THIS->specific_method();
1207 #line 1208 "t/cookbook/cookbook_xsgen.cc"
1208 0 sv_setpv((SV*)TARG, RETVAL);
1209 0 ST(0) = TARG;
1210 }
1211 0 XSRETURN(1);
1212 0 }); }
1213  
1214  
1215 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe06.xsi' */
1216  
1217  
1218 /* INCLUDE: Including 'recipe07.xsi' from 'cookbook.xs' */
1219  
1220 #include <iostream>
1221 enum class Status07 { CONNECTED = 1, AUTHORIZED = 2, NOT_AUTHORIZED = 3, DISCONNECTED = 4 };
1222 struct Client07 {
1223 int id;
1224 Status07 status;
1225  
1226 0 Client07 (int id_): id{id_}, status{Status07::CONNECTED } {}
1227 0 void disconnect() {
1228 0 std::cout << "disconnecting " << id << "\n";
1229 0 status = Status07::DISCONNECTED;
1230 0 }
1231 0 void welcome() {
1232 0 std::cout << "[sending] welcome dear client " << id << "\n";
1233 0 }
1234 };
1235 struct ServerBase07 {
1236 0 void on_client(Client07* c) {
1237 0 ▶ if (c->status == Status07::AUTHORIZED) c->welcome();
Branch: 1 branch
BranchTrueFalseTotal
if (c->status == Status07::AUTHORIZED) c->welcome(); 0 0 0
1238 0 ▶ if (c->status == Status07::NOT_AUTHORIZED) c->disconnect();
Branch: 1 branch
BranchTrueFalseTotal
if (c->status == Status07::NOT_AUTHORIZED) c->disconnect(); 0 0 0
1239 0 }
1240 };
1241 struct LoggerPlugin07 {
1242 0 void on_client(Client07* c) { std::cout << "client " << c->id << ", status: " << (int) c->status << "\n"; }
1243 };
1244 struct AuthorizerPlugin07 {
1245 0 void on_client(Client07* c) {
1246 0 ▶ c->status = (c->id < 0) ? Status07::NOT_AUTHORIZED : Status07::AUTHORIZED;
Branch: 1 branch
BranchTrueFalseTotal
c->status = (c->id < 0) ? Status07::NOT_AUTHORIZED : Status07::AUTHORIZED; 0 0 0
1247 0 }
1248 };
1249 namespace xs {
1250 template <>
1251 struct Typemap<Client07*> : TypemapObject<Client07*, Client07*, ObjectTypePtr, ObjectStorageMG> {
1252 0 ▶ static std::string package () { return "MyTest::Cookbook::Client07"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::Client07"; } 0 0 0
1253 };
1254  
1255 template <>
1256 struct Typemap<ServerBase07*> : TypemapObject<ServerBase07*, ServerBase07*, ObjectTypePtr, ObjectStorageMG> {
1257 0 ▶ static std::string package () { return "MyTest::Cookbook::ServerBase07"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::ServerBase07"; } 0 0 0
1258 };
1259  
1260 template <>
1261 struct Typemap<LoggerPlugin07*> : TypemapObject<LoggerPlugin07*, LoggerPlugin07*, ObjectTypePtr, ObjectStorageMG> {
1262 0 ▶ static std::string package () { return "MyTest::Cookbook::LoggerPlugin07"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::LoggerPlugin07"; } 0 0 0
1263 };
1264  
1265 template <>
1266 struct Typemap<AuthorizerPlugin07*> : TypemapObject<AuthorizerPlugin07*, AuthorizerPlugin07*, ObjectTypePtr, ObjectStorageMG> {
1267 0 ▶ static std::string package () { return "MyTest::Cookbook::AuthorizerPlugin07"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::AuthorizerPlugin07"; } 0 0 0
1268 };
1269 }
1270  
1271  
1272 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Client07_disconnect) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Client07_disconnect) { xs::throw_guard(cv, [=]() 0 0 0
1273 {
1274 0 dVAR; dXSARGS;
1275 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1276 0 croak_xs_usage(cv, "THIS");
1277 PERL_UNUSED_VAR(ax); /* -Wall */
1278 0 SP -= items;
1279 {
1280 0 ▶ Client07* THIS = xs::in<Client07 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Client07* THIS = xs::in<Client07 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1281 ;
1282 #line 65 "t/cookbook/recipe07.xsi"
1283 THIS->disconnect();
1284 #line 1285 "t/cookbook/cookbook_xsgen.cc"
1285 0 PUTBACK;
1286 0 return;
1287 }
1288 0 }); }
1289  
1290  
1291  
1292 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Client07_welcome) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Client07_welcome) { xs::throw_guard(cv, [=]() 0 0 0
1293 {
1294 0 dVAR; dXSARGS;
1295 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1296 0 croak_xs_usage(cv, "THIS");
1297 PERL_UNUSED_VAR(ax); /* -Wall */
1298 0 SP -= items;
1299 {
1300 0 ▶ Client07* THIS = xs::in<Client07 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Client07* THIS = xs::in<Client07 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1301 ;
1302 #line 67 "t/cookbook/recipe07.xsi"
1303 THIS->welcome();
1304 #line 1305 "t/cookbook/cookbook_xsgen.cc"
1305 0 PUTBACK;
1306 0 return;
1307 }
1308 0 }); }
1309  
1310  
1311  
1312 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Client07_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Client07_new) { xs::throw_guard(cv, [=]() 0 0 0
1313 {
1314 0 dVAR; dXSARGS;
1315 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
1316 0 croak_xs_usage(cv, "CLASS, id");
1317 {
1318 Client07 * RETVAL;
1319 0 SV* CLASS = ST(0)
1320 ;
1321 0 ▶ int id = (int)SvIV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
int id = (int)SvIV(ST(1)) 0 0 0
1322 ;
1323 #line 69 "t/cookbook/recipe07.xsi"
1324 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1325 PROTO = CLASS;
1326 RETVAL = new Client07(id);
1327 #line 1328 "t/cookbook/cookbook_xsgen.cc"
1328 {
1329 SV * RETVALSV;
1330 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1331 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1332 0 ST(0) = RETVALSV;
1333 }
1334 0 }
1335 0 XSRETURN(1);
1336 0 }); }
1337  
1338  
1339  
1340 0 ▶XS_EUPXS(XS_MyTest__Cookbook__ServerBase07_on_client) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__ServerBase07_on_client) { xs::throw_guard(cv, [=]() 0 0 0
1341 {
1342 0 dVAR; dXSARGS;
1343 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
1344 0 croak_xs_usage(cv, "THIS, c");
1345 PERL_UNUSED_VAR(ax); /* -Wall */
1346 0 SP -= items;
1347 {
1348 0 ▶ ServerBase07* THIS = xs::in<ServerBase07 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
ServerBase07* THIS = xs::in<ServerBase07 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1349 ;
1350 0 Client07* c = xs::in<Client07 *>(ST(1));
1351 ;
1352 #line 75 "t/cookbook/recipe07.xsi"
1353 THIS->on_client(c);
1354 #line 1355 "t/cookbook/cookbook_xsgen.cc"
1355 0 PUTBACK;
1356 0 return;
1357 }
1358 0 }); }
1359  
1360  
1361  
1362 0 ▶XS_EUPXS(XS_MyTest__Cookbook__ServerBase07_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__ServerBase07_new) { xs::throw_guard(cv, [=]() 0 0 0
1363 {
1364 0 dVAR; dXSARGS;
1365 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1366 0 croak_xs_usage(cv, "CLASS");
1367 {
1368 ServerBase07 * RETVAL;
1369 0 SV* CLASS = ST(0)
1370 ;
1371 #line 77 "t/cookbook/recipe07.xsi"
1372 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1373 PROTO = CLASS;
1374 RETVAL = new ServerBase07();
1375 #line 1376 "t/cookbook/cookbook_xsgen.cc"
1376 {
1377 SV * RETVALSV;
1378 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1379 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1380 0 ST(0) = RETVALSV;
1381 }
1382 0 }
1383 0 XSRETURN(1);
1384 0 }); }
1385  
1386  
1387  
1388 0 ▶XS_EUPXS(XS_MyTest__Cookbook__LoggerPlugin07_on_client) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__LoggerPlugin07_on_client) { xs::throw_guard(cv, [=]() 0 0 0
1389 {
1390 0 dVAR; dXSARGS;
1391 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
1392 0 croak_xs_usage(cv, "THIS, c");
1393 PERL_UNUSED_VAR(ax); /* -Wall */
1394 0 SP -= items;
1395 {
1396 0 ▶ LoggerPlugin07* THIS = xs::in<LoggerPlugin07 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
LoggerPlugin07* THIS = xs::in<LoggerPlugin07 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1397 ;
1398 0 Client07* c = xs::in<Client07 *>(ST(1));
1399 ;
1400 #line 83 "t/cookbook/recipe07.xsi"
1401 THIS->on_client(c);
1402 Object(ST(0)).call_next(cv, &ST(1), items-1);
1403 THIS->on_client(c);
1404 #line 1405 "t/cookbook/cookbook_xsgen.cc"
1405 0 PUTBACK;
1406 0 return;
1407 }
1408 0 }); }
1409  
1410  
1411  
1412 0 ▶XS_EUPXS(XS_MyTest__Cookbook__LoggerPlugin07_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__LoggerPlugin07_new) { xs::throw_guard(cv, [=]() 0 0 0
1413 {
1414 0 dVAR; dXSARGS;
1415 0 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 0 0 0
1416 0 croak_xs_usage(cv, "CLASS, ...");
1417 {
1418 LoggerPlugin07 * RETVAL;
1419 0 SV* CLASS = ST(0)
1420 ;
1421 #line 89 "t/cookbook/recipe07.xsi"
1422 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1423 PROTO = CLASS;
1424 PROTO = Stash::from_name(CLASS).call_next(cv, &ST(1), items-1);
1425 if (!PROTO.defined()) XSRETURN_UNDEF;
1426 RETVAL = new LoggerPlugin07();
1427 #line 1428 "t/cookbook/cookbook_xsgen.cc"
1428 {
1429 SV * RETVALSV;
1430 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1431 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1432 0 ST(0) = RETVALSV;
1433 }
1434 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
1435 0 XSRETURN(1);
1436 0 }); }
1437  
1438  
1439  
1440 0 ▶XS_EUPXS(XS_MyTest__Cookbook__AuthorizerPlugin07_on_client) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__AuthorizerPlugin07_on_client) { xs::throw_guard(cv, [=]() 0 0 0
1441 {
1442 0 dVAR; dXSARGS;
1443 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
1444 0 croak_xs_usage(cv, "THIS, c");
1445 PERL_UNUSED_VAR(ax); /* -Wall */
1446 0 SP -= items;
1447 {
1448 0 ▶ AuthorizerPlugin07* THIS = xs::in<AuthorizerPlugin07 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
AuthorizerPlugin07* THIS = xs::in<AuthorizerPlugin07 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1449 ;
1450 0 Client07* c = xs::in<Client07 *>(ST(1));
1451 ;
1452 #line 98 "t/cookbook/recipe07.xsi"
1453 THIS->on_client(c);
1454 Object(ST(0)).call_next(cv, &ST(1), items-1);
1455 #line 1456 "t/cookbook/cookbook_xsgen.cc"
1456 0 PUTBACK;
1457 0 return;
1458 }
1459 0 }); }
1460  
1461  
1462  
1463 0 ▶XS_EUPXS(XS_MyTest__Cookbook__AuthorizerPlugin07_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__AuthorizerPlugin07_new) { xs::throw_guard(cv, [=]() 0 0 0
1464 {
1465 0 dVAR; dXSARGS;
1466 0 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 0 0 0
1467 0 croak_xs_usage(cv, "CLASS, ...");
1468 {
1469 AuthorizerPlugin07 * RETVAL;
1470 0 SV* CLASS = ST(0)
1471 ;
1472 #line 103 "t/cookbook/recipe07.xsi"
1473 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1474 PROTO = CLASS;
1475 PROTO = Stash::from_name(CLASS).call_next(cv, &ST(1), items-1);
1476 if (!PROTO.defined()) XSRETURN_UNDEF;
1477 RETVAL = new AuthorizerPlugin07();
1478 #line 1479 "t/cookbook/cookbook_xsgen.cc"
1479 {
1480 SV * RETVALSV;
1481 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1482 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1483 0 ST(0) = RETVALSV;
1484 }
1485 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
1486 0 XSRETURN(1);
1487 0 }); }
1488  
1489  
1490 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe07.xsi' */
1491  
1492  
1493 /* INCLUDE: Including 'recipe08.xsi' from 'cookbook.xs' */
1494  
1495 #include <iostream>
1496 /* is able to hold only files in WAV-format */
1497 struct WAVFile {
1498 0 WAVFile(const char* name): name_{name} {}
1499 0 const char* name() const noexcept { return name_; }
1500 private:
1501 const char* name_;
1502 };
1503 /* is able to hold any files only in ogg, mp3 and aac formats */
1504 struct MultimediaFile {
1505 0 MultimediaFile(const char* name, const char* format): name_{name}, format_{format} {}
1506 0 const char* name() const noexcept { return name_; }
1507 0 const char* format() const noexcept { return format_; }
1508 private:
1509 const char* name_;
1510 const char* format_;
1511 };
1512 struct WAVPlayer {
1513 0 WAVPlayer(double preferred_bitrate): preferred_bitrate_{preferred_bitrate} {}
1514 0 ~WAVPlayer() { std::cout << "~WAVPlayer\n"; }
1515 0 std::string play_wav(WAVFile* file) {
1516 0 ▶ std::string result = "wav-player is playing ";
Branch: 1 branch
BranchTrueFalseTotal
std::string result = "wav-player is playing "; 0 0 0
1517 0 ▶ result += file->name();
Branch: 1 branch
BranchTrueFalseTotal
result += file->name(); 0 0 0
1518 0 ▶ result += " with bitrate ";
Branch: 1 branch
BranchTrueFalseTotal
result += " with bitrate "; 0 0 0
1519 0 ▶ result += std::to_string(preferred_bitrate_);
Branch: 2 branches
BranchTrueFalseTotal
result += std::to_string(preferred_bitrate_); 0 0 0
result += std::to_string(preferred_bitrate_); 0 0 0
1520 0 return result;
1521 }
1522 0 double preferred_bitrate() const noexcept { return preferred_bitrate_; }
1523 0 WAVPlayer* clone() const noexcept { return new WAVPlayer(preferred_bitrate_); }
1524 private:
1525 double preferred_bitrate_;
1526 };
1527 struct MultimediaPlayer {
1528 0 MultimediaPlayer(int quality): quality_{quality} {}
1529 0 ~MultimediaPlayer() { std::cout << "~MultimediaPlayer\n"; }
1530 0 std::string play_file(MultimediaFile* file) {
1531 0 ▶ std::string result = "player is playing ";
Branch: 1 branch
BranchTrueFalseTotal
std::string result = "player is playing "; 0 0 0
1532 0 ▶ result += file->name();
Branch: 1 branch
BranchTrueFalseTotal
result += file->name(); 0 0 0
1533 0 ▶ result += " (";
Branch: 1 branch
BranchTrueFalseTotal
result += " ("; 0 0 0
1534 0 ▶ result += file->format();
Branch: 1 branch
BranchTrueFalseTotal
result += file->format(); 0 0 0
1535 0 ▶ result += ")";
Branch: 1 branch
BranchTrueFalseTotal
result += ")"; 0 0 0
1536 0 ▶ result += " with quality ";
Branch: 1 branch
BranchTrueFalseTotal
result += " with quality "; 0 0 0
1537 0 ▶ result += std::to_string(quality_);
Branch: 1 branch
BranchTrueFalseTotal
result += std::to_string(quality_); 0 0 0
1538 0 return result;
1539 }
1540 0 int quality() const noexcept { return quality_; }
1541 0 MultimediaPlayer* clone() const noexcept { return new MultimediaPlayer(quality_); }
1542 private:
1543 int quality_;
1544 };
1545 namespace xs {
1546 template <>
1547 struct Typemap<WAVFile*> : TypemapObject<WAVFile*, WAVFile*, ObjectTypePtr, ObjectStorageMG> {
1548 0 ▶ static std::string package () { return "MyTest::Cookbook::WAVFile"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::WAVFile"; } 0 0 0
1549 };
1550  
1551 template <>
1552 struct Typemap<MultimediaFile*> : TypemapObject<MultimediaFile*, MultimediaFile*, ObjectTypePtr, ObjectStorageMG> {
1553 0 ▶ static std::string package () { return "MyTest::Cookbook::MultimediaFile"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::MultimediaFile"; } 0 0 0
1554 };
1555  
1556 template <>
1557 struct Typemap<WAVPlayer*> : TypemapObject<WAVPlayer*, WAVPlayer*, ObjectTypePtr, ObjectStorageMG> {
1558 0 ▶ static std::string package () { return "MyTest::Cookbook::WAVPlayer"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::WAVPlayer"; } 0 0 0
1559 };
1560  
1561 template <>
1562 struct Typemap<MultimediaPlayer*> : TypemapObject<MultimediaPlayer*, MultimediaPlayer*, ObjectTypePtr, ObjectStorageMG> {
1563 0 ▶ static std::string package () { return "MyTest::Cookbook::MultimediaPlayer"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::MultimediaPlayer"; } 0 0 0
1564 };
1565 }
1566  
1567  
1568 0 ▶XS_EUPXS(XS_MyTest__Cookbook__WAVFile_name) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__WAVFile_name) { xs::throw_guard(cv, [=]() 0 0 0
1569 {
1570 0 dVAR; dXSARGS;
1571 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1572 0 croak_xs_usage(cv, "THIS");
1573 PERL_UNUSED_VAR(ax); /* -Wall */
1574 0 SP -= items;
1575 {
1576 0 ▶ WAVFile* THIS = xs::in<WAVFile *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
WAVFile* THIS = xs::in<WAVFile *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1577 ;
1578 #line 83 "t/cookbook/recipe08.xsi"
1579 THIS->name();
1580 #line 1581 "t/cookbook/cookbook_xsgen.cc"
1581 0 PUTBACK;
1582 0 return;
1583 }
1584 0 }); }
1585  
1586  
1587  
1588 0 ▶XS_EUPXS(XS_MyTest__Cookbook__WAVFile_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__WAVFile_new) { xs::throw_guard(cv, [=]() 0 0 0
1589 {
1590 0 dVAR; dXSARGS;
1591 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
1592 0 croak_xs_usage(cv, "CLASS, name");
1593 {
1594 WAVFile * RETVAL;
1595 0 SV* CLASS = ST(0)
1596 ;
1597 0 const char* name = (const char *)SvPV_nolen(ST(1))
1598 ;
1599 #line 85 "t/cookbook/recipe08.xsi"
1600 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1601 PROTO = CLASS;
1602 RETVAL = new WAVFile(name);
1603 #line 1604 "t/cookbook/cookbook_xsgen.cc"
1604 {
1605 SV * RETVALSV;
1606 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1607 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1608 0 ST(0) = RETVALSV;
1609 }
1610 0 }
1611 0 XSRETURN(1);
1612 0 }); }
1613  
1614  
1615  
1616 0 ▶XS_EUPXS(XS_MyTest__Cookbook__MultimediaFile_name) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__MultimediaFile_name) { xs::throw_guard(cv, [=]() 0 0 0
1617 {
1618 0 dVAR; dXSARGS;
1619 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1620 0 croak_xs_usage(cv, "THIS");
1621 PERL_UNUSED_VAR(ax); /* -Wall */
1622 0 SP -= items;
1623 {
1624 0 ▶ MultimediaFile* THIS = xs::in<MultimediaFile *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
MultimediaFile* THIS = xs::in<MultimediaFile *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1625 ;
1626 #line 90 "t/cookbook/recipe08.xsi"
1627 THIS->name();
1628 #line 1629 "t/cookbook/cookbook_xsgen.cc"
1629 0 PUTBACK;
1630 0 return;
1631 }
1632 0 }); }
1633  
1634  
1635  
1636 0 ▶XS_EUPXS(XS_MyTest__Cookbook__MultimediaFile_format) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__MultimediaFile_format) { xs::throw_guard(cv, [=]() 0 0 0
1637 {
1638 0 dVAR; dXSARGS;
1639 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1640 0 croak_xs_usage(cv, "THIS");
1641 PERL_UNUSED_VAR(ax); /* -Wall */
1642 0 SP -= items;
1643 {
1644 0 ▶ MultimediaFile* THIS = xs::in<MultimediaFile *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
MultimediaFile* THIS = xs::in<MultimediaFile *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1645 ;
1646 #line 92 "t/cookbook/recipe08.xsi"
1647 THIS->format();
1648 #line 1649 "t/cookbook/cookbook_xsgen.cc"
1649 0 PUTBACK;
1650 0 return;
1651 }
1652 0 }); }
1653  
1654  
1655  
1656 0 ▶XS_EUPXS(XS_MyTest__Cookbook__MultimediaFile_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__MultimediaFile_new) { xs::throw_guard(cv, [=]() 0 0 0
1657 {
1658 0 dVAR; dXSARGS;
1659 0 ▶ if (items != 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 3) 0 0 0
1660 0 croak_xs_usage(cv, "CLASS, name, format");
1661 {
1662 MultimediaFile * RETVAL;
1663 0 SV* CLASS = ST(0)
1664 ;
1665 0 const char* name = (const char *)SvPV_nolen(ST(1))
1666 ;
1667 0 ▶ const char* format = (const char *)SvPV_nolen(ST(2))
Branch: 1 branch
BranchTrueFalseTotal
const char* format = (const char *)SvPV_nolen(ST(2)) 0 0 0
1668 ;
1669 #line 94 "t/cookbook/recipe08.xsi"
1670 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1671 PROTO = CLASS;
1672 RETVAL = new MultimediaFile(name, format);
1673 #line 1674 "t/cookbook/cookbook_xsgen.cc"
1674 {
1675 SV * RETVALSV;
1676 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1677 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1678 0 ST(0) = RETVALSV;
1679 }
1680 0 }
1681 0 XSRETURN(1);
1682 0 }); }
1683  
1684  
1685  
1686 0 ▶XS_EUPXS(XS_MyTest__Cookbook__WAVPlayer_play_wav) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__WAVPlayer_play_wav) { xs::throw_guard(cv, [=]() 0 0 0
1687 {
1688 0 dVAR; dXSARGS;
1689 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
1690 0 croak_xs_usage(cv, "THIS, file");
1691 {
1692 0 std::string RETVAL;
1693 0 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 0 0 0
dXSTARG; 0 0 0
1694 0 ▶ WAVPlayer* THIS = xs::in<WAVPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
WAVPlayer* THIS = xs::in<WAVPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
WAVPlayer* THIS = xs::in<WAVPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1695 ;
1696 0 ▶ WAVFile* file = xs::in<WAVFile *>(ST(1));
Branch: 2 branches
BranchTrueFalseTotal
WAVFile* file = xs::in<WAVFile *>(ST(1)); 0 0 0
WAVFile* file = xs::in<WAVFile *>(ST(1)); 0 0 0
1697 ;
1698 #line 99 "t/cookbook/recipe08.xsi"
1699 RETVAL = THIS->play_wav(file);
1700 #line 1701 "t/cookbook/cookbook_xsgen.cc"
1701 0 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 0 0 0
1702 0 ST(0) = TARG;
1703 0 }
1704 0 XSRETURN(1);
1705 0 }); }
1706  
1707  
1708  
1709 0 ▶XS_EUPXS(XS_MyTest__Cookbook__WAVPlayer_preferred_bitrate) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__WAVPlayer_preferred_bitrate) { xs::throw_guard(cv, [=]() 0 0 0
1710 {
1711 0 dVAR; dXSARGS;
1712 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1713 0 croak_xs_usage(cv, "THIS");
1714 {
1715 double RETVAL;
1716 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
1717 0 ▶ WAVPlayer* THIS = xs::in<WAVPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
WAVPlayer* THIS = xs::in<WAVPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1718 ;
1719 #line 101 "t/cookbook/recipe08.xsi"
1720 RETVAL = THIS->preferred_bitrate();
1721 #line 1722 "t/cookbook/cookbook_xsgen.cc"
1722 0 ▶ TARGn((double)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGn((double)RETVAL, 1); 0 0 0
1723 0 ST(0) = TARG;
1724 }
1725 0 XSRETURN(1);
1726 0 }); }
1727  
1728  
1729  
1730 0 ▶XS_EUPXS(XS_MyTest__Cookbook__WAVPlayer_clone) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__WAVPlayer_clone) { xs::throw_guard(cv, [=]() 0 0 0
1731 {
1732 0 dVAR; dXSARGS;
1733 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1734 0 croak_xs_usage(cv, "THIS");
1735 {
1736 WAVPlayer * RETVAL;
1737 0 ▶ WAVPlayer* THIS = xs::in<WAVPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
WAVPlayer* THIS = xs::in<WAVPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
WAVPlayer* THIS = xs::in<WAVPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1738 ;
1739 #line 104 "t/cookbook/recipe08.xsi"
1740 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1741 Object self{ST(0)};
1742 PROTO = self.stash();
1743 RETVAL = THIS->clone();
1744 #line 1745 "t/cookbook/cookbook_xsgen.cc"
1745 {
1746 SV * RETVALSV;
1747 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1748 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1749 0 ST(0) = RETVALSV;
1750 }
1751 0 }
1752 0 XSRETURN(1);
1753 0 }); }
1754  
1755  
1756  
1757 0 ▶XS_EUPXS(XS_MyTest__Cookbook__WAVPlayer_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__WAVPlayer_new) { xs::throw_guard(cv, [=]() 0 0 0
1758 {
1759 0 dVAR; dXSARGS;
1760 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
1761 0 croak_xs_usage(cv, "CLASS, preferred_bitrate");
1762 {
1763 WAVPlayer * RETVAL;
1764 0 SV* CLASS = ST(0)
1765 ;
1766 0 ▶ double preferred_bitrate = (double)SvNV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
double preferred_bitrate = (double)SvNV(ST(1)) 0 0 0
1767 ;
1768 #line 109 "t/cookbook/recipe08.xsi"
1769 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1770 PROTO = CLASS;
1771 RETVAL = new WAVPlayer(preferred_bitrate);
1772 #line 1773 "t/cookbook/cookbook_xsgen.cc"
1773 {
1774 SV * RETVALSV;
1775 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1776 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1777 0 ST(0) = RETVALSV;
1778 }
1779 0 }
1780 0 XSRETURN(1);
1781 0 }); }
1782  
1783  
1784  
1785 0 ▶XS_EUPXS(XS_MyTest__Cookbook__MultimediaPlayer_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__MultimediaPlayer_new) { xs::throw_guard(cv, [=]() 0 0 0
1786 {
1787 0 dVAR; dXSARGS;
1788 0 ▶ if (items != 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 3) 0 0 0
1789 0 croak_xs_usage(cv, "CLASS, preferred_bitrate, quality");
1790 {
1791 MultimediaPlayer * RETVAL;
1792 0 SV* CLASS = ST(0)
1793 ;
1794 0 ▶ double preferred_bitrate = (double)SvNV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
double preferred_bitrate = (double)SvNV(ST(1)) 0 0 0
1795 ;
1796 0 ▶ int quality = (int)SvIV(ST(2))
Branch: 1 branch
BranchTrueFalseTotal
int quality = (int)SvIV(ST(2)) 0 0 0
1797 ;
1798 #line 115 "t/cookbook/recipe08.xsi"
1799 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1800 PROTO = CLASS;
1801 (void)preferred_bitrate; // silence warning
1802 PROTO = Stash::from_name(CLASS).call_next(cv, &ST(1), 1);
1803 if (!PROTO.defined()) XSRETURN_UNDEF;
1804 RETVAL = new MultimediaPlayer(quality);
1805 #line 1806 "t/cookbook/cookbook_xsgen.cc"
1806 {
1807 SV * RETVALSV;
1808 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1809 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1810 0 ST(0) = RETVALSV;
1811 }
1812 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
1813 0 XSRETURN(1);
1814 0 }); }
1815  
1816  
1817  
1818 0 ▶XS_EUPXS(XS_MyTest__Cookbook__MultimediaPlayer_play_file) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__MultimediaPlayer_play_file) { xs::throw_guard(cv, [=]() 0 0 0
1819 {
1820 0 dVAR; dXSARGS;
1821 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
1822 0 croak_xs_usage(cv, "THIS, file");
1823 {
1824 0 std::string RETVAL;
1825 0 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 0 0 0
dXSTARG; 0 0 0
1826 0 ▶ MultimediaPlayer* THIS = xs::in<MultimediaPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
MultimediaPlayer* THIS = xs::in<MultimediaPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
MultimediaPlayer* THIS = xs::in<MultimediaPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1827 ;
1828 0 ▶ MultimediaFile* file = xs::in<MultimediaFile *>(ST(1));
Branch: 2 branches
BranchTrueFalseTotal
MultimediaFile* file = xs::in<MultimediaFile *>(ST(1)); 0 0 0
MultimediaFile* file = xs::in<MultimediaFile *>(ST(1)); 0 0 0
1829 ;
1830 #line 121 "t/cookbook/recipe08.xsi"
1831 RETVAL = THIS->play_file(file);
1832 #line 1833 "t/cookbook/cookbook_xsgen.cc"
1833 0 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 0 0 0
1834 0 ST(0) = TARG;
1835 0 }
1836 0 XSRETURN(1);
1837 0 }); }
1838  
1839  
1840  
1841 0 ▶XS_EUPXS(XS_MyTest__Cookbook__MultimediaPlayer_quality) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__MultimediaPlayer_quality) { xs::throw_guard(cv, [=]() 0 0 0
1842 {
1843 0 dVAR; dXSARGS;
1844 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1845 0 croak_xs_usage(cv, "THIS");
1846 {
1847 int RETVAL;
1848 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
1849 0 ▶ MultimediaPlayer* THIS = xs::in<MultimediaPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
MultimediaPlayer* THIS = xs::in<MultimediaPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1850 ;
1851 #line 123 "t/cookbook/recipe08.xsi"
1852 RETVAL = THIS->quality();
1853 #line 1854 "t/cookbook/cookbook_xsgen.cc"
1854 0 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 0 0
1855 0 ST(0) = TARG;
1856 }
1857 0 XSRETURN(1);
1858 0 }); }
1859  
1860  
1861  
1862 0 ▶XS_EUPXS(XS_MyTest__Cookbook__MultimediaPlayer_clone) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__MultimediaPlayer_clone) { xs::throw_guard(cv, [=]() 0 0 0
1863 {
1864 0 dVAR; dXSARGS;
1865 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1866 0 croak_xs_usage(cv, "THIS");
1867 {
1868 MultimediaPlayer * RETVAL;
1869 0 ▶ MultimediaPlayer* THIS = xs::in<MultimediaPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
MultimediaPlayer* THIS = xs::in<MultimediaPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
MultimediaPlayer* THIS = xs::in<MultimediaPlayer *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1870 ;
1871 #line 126 "t/cookbook/recipe08.xsi"
1872 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1873 Object self{ST(0)};
1874 PROTO = self.call_next(cv);
1875 RETVAL = THIS->clone();
1876 #line 1877 "t/cookbook/cookbook_xsgen.cc"
1877 {
1878 SV * RETVALSV;
1879 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
1880 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
1881 0 ST(0) = RETVALSV;
1882 }
1883 0 }
1884 0 XSRETURN(1);
1885 0 }); }
1886  
1887  
1888 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe08.xsi' */
1889  
1890  
1891 /* INCLUDE: Including 'recipe09.xsi' from 'cookbook.xs' */
1892  
1893 #include <vector>
1894 struct Point {
1895 double x;
1896 double y;
1897 };
1898 struct ShapeA {
1899 0 size_t point_count() const { return points.size(); }
1900 0 Point& get_point(size_t idx) { return points.at(idx); }
1901 0 void add_point(const Point& pt) { points.push_back(pt); }
1902 private:
1903 std::vector<Point> points;
1904 };
1905 struct XSShapeA : public ShapeA {
1906 0 void add_label(SV* maybe_label = nullptr) {
1907 0 ▶ Sv label = maybe_label ? Sv{maybe_label} : Sv::undef;
Branch: 2 branches
BranchTrueFalseTotal
Sv label = maybe_label ? Sv{maybe_label} : Sv::undef; 0 0 0
Sv label = maybe_label ? Sv{maybe_label} : Sv::undef; 0 0 0
1908 0 ▶ labels.push_back(Ref::create(maybe_label));
Branch: 2 branches
BranchTrueFalseTotal
labels.push_back(Ref::create(maybe_label)); 0 0 0
labels.push_back(Ref::create(maybe_label)); 0 0 0
1909 0 }
1910 0 Ref& get_ref(size_t idx) { return labels.at(idx); }
1911 private:
1912 std::vector<Ref> labels;
1913 };
1914 namespace xs {
1915 template <>
1916 struct Typemap<Point*> : TypemapObject<Point*, Point*, ObjectTypePtr, ObjectStorageMG> {
1917 0 ▶ static std::string package () { return "MyTest::Cookbook::Point"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::Point"; } 0 0 0
1918 };
1919  
1920 template <typename D>
1921 struct Typemap<ShapeA*, D> : TypemapObject<ShapeA*, D, ObjectTypePtr, ObjectStorageMG> {
1922 0 ▶ static std::string package () { return "MyTest::Cookbook::ShapeA"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::ShapeA"; } 0 0 0
1923 };
1924  
1925 template <>
1926 struct Typemap<XSShapeA*> : Typemap<ShapeA*, XSShapeA*> {
1927 0 ▶ static std::string package () { return "MyTest::Cookbook::ShapeB"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::ShapeB"; } 0 0 0
1928 };
1929 }
1930 static xs::Sv::payload_marker_t payload_marker_09;
1931  
1932  
1933 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Point_x) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Point_x) { xs::throw_guard(cv, [=]() 0 0 0
1934 {
1935 0 dVAR; dXSARGS;
1936 0 dXSI32;
1937 0 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 0 0 0
if (items < 1 || items > 2) 0 0 0
1938 0 croak_xs_usage(cv, "THIS, new_val= nullptr");
1939 {
1940 double RETVAL;
1941 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
1942 0 ▶ Point* THIS = xs::in<Point *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Point* THIS = xs::in<Point *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1943 ;
1944 SV* new_val;
1945  
1946 0 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 0 0 0
1947 0 new_val = nullptr;
1948 else {
1949 0 new_val = ST(1)
1950 ;
1951 }
1952 #line 53 "t/cookbook/recipe09.xsi"
1953 double* val = nullptr;
1954 switch(ix) {
1955 case 1: val = &THIS->y; break;
1956 default: val = &THIS->x; break;
1957 }
1958 if (new_val) {
1959 *val = SvNV(new_val);
1960 }
1961 RETVAL = *val;
1962 #line 1963 "t/cookbook/cookbook_xsgen.cc"
1963 0 ▶ TARGn((double)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGn((double)RETVAL, 1); 0 0 0
1964 0 ST(0) = TARG;
1965 }
1966 0 XSRETURN(1);
1967 0 }); }
1968  
1969  
1970  
1971 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Point_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Point_new) { xs::throw_guard(cv, [=]() 0 0 0
1972 {
1973 0 dVAR; dXSARGS;
1974 0 ▶ if (items < 1 || items > 3)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 3) 0 0 0
if (items < 1 || items > 3) 0 0 0
1975 0 croak_xs_usage(cv, "CLASS, x= 0, y= 0");
1976 {
1977 Point * RETVAL;
1978 0 SV* CLASS = ST(0)
1979 ;
1980 double x;
1981 double y;
1982  
1983 0 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 0 0 0
1984 0 x = 0;
1985 else {
1986 0 ▶ x = (double)SvNV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
x = (double)SvNV(ST(1)) 0 0 0
1987 ;
1988 }
1989  
1990 0 ▶ if (items < 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 3) 0 0 0
1991 0 y = 0;
1992 else {
1993 0 ▶ y = (double)SvNV(ST(2))
Branch: 1 branch
BranchTrueFalseTotal
y = (double)SvNV(ST(2)) 0 0 0
1994 ;
1995 }
1996 #line 65 "t/cookbook/recipe09.xsi"
1997 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1998 PROTO = CLASS;
1999 RETVAL = new Point{x, y};
2000 #line 2001 "t/cookbook/cookbook_xsgen.cc"
2001 {
2002 SV * RETVALSV;
2003 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
2004 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2005 0 ST(0) = RETVALSV;
2006 }
2007 0 }
2008 0 XSRETURN(1);
2009 0 }); }
2010  
2011  
2012  
2013 0 ▶XS_EUPXS(XS_MyTest__Cookbook__ShapeA_point_count) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__ShapeA_point_count) { xs::throw_guard(cv, [=]() 0 0 0
2014 {
2015 0 dVAR; dXSARGS;
2016 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2017 0 croak_xs_usage(cv, "THIS");
2018 {
2019 size_t RETVAL;
2020 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
2021 0 ▶ ShapeA* THIS = xs::in<ShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
ShapeA* THIS = xs::in<ShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2022 ;
2023 #line 71 "t/cookbook/recipe09.xsi"
2024 RETVAL = THIS->point_count();
2025 #line 2026 "t/cookbook/cookbook_xsgen.cc"
2026 0 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 0 0
2027 0 ST(0) = TARG;
2028 }
2029 0 XSRETURN(1);
2030 0 }); }
2031  
2032  
2033  
2034 0 ▶XS_EUPXS(XS_MyTest__Cookbook__ShapeA_get_point) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__ShapeA_get_point) { xs::throw_guard(cv, [=]() 0 0 0
2035 {
2036 0 dVAR; dXSARGS;
2037 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
2038 0 croak_xs_usage(cv, "THIS, idx");
2039 PERL_UNUSED_VAR(ax); /* -Wall */
2040 0 SP -= items;
2041 {
2042 0 ▶ ShapeA* THIS = xs::in<ShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
ShapeA* THIS = xs::in<ShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
ShapeA* THIS = xs::in<ShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2043 ;
2044 0 ▶ size_t idx = (size_t)SvUV(ST(1))
Branch: 2 branches
BranchTrueFalseTotal
size_t idx = (size_t)SvUV(ST(1)) 0 0 0
size_t idx = (size_t)SvUV(ST(1)) 0 0 0
2045 ;
2046 #line 74 "t/cookbook/recipe09.xsi"
2047 Object self{ST(0)};
2048 Array payload(self.payload(&payload_marker_09).obj);
2049  
2050 auto& pt = THIS->get_point(idx);
2051 auto pt_copy = new Point{pt.x, pt.y};
2052 auto wrapped_pt = xs::out<>(pt_copy);
2053 mXPUSHs(wrapped_pt.detach());
2054  
2055 if (GIMME_V == G_ARRAY) {
2056 auto ref = payload.at(idx);
2057 Sv value = SvRV(ref);
2058 mXPUSHs(value.detach());
2059 }
2060 #line 2061 "t/cookbook/cookbook_xsgen.cc"
2061 0 PUTBACK;
2062 0 return;
2063 0 }
2064 0 }); }
2065  
2066  
2067  
2068 0 ▶XS_EUPXS(XS_MyTest__Cookbook__ShapeA_add_point) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__ShapeA_add_point) { xs::throw_guard(cv, [=]() 0 0 0
2069 {
2070 0 dVAR; dXSARGS;
2071 0 ▶ if (items < 2 || items > 3)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 2 || items > 3) 0 0 0
if (items < 2 || items > 3) 0 0 0
2072 0 croak_xs_usage(cv, "THIS, pt, maybe_label= nullptr");
2073 PERL_UNUSED_VAR(ax); /* -Wall */
2074 0 SP -= items;
2075 {
2076 0 ▶ ShapeA* THIS = xs::in<ShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
ShapeA* THIS = xs::in<ShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
ShapeA* THIS = xs::in<ShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2077 ;
2078 0 ▶ Point* pt = xs::in<Point *>(ST(1));
Branch: 1 branch
BranchTrueFalseTotal
Point* pt = xs::in<Point *>(ST(1)); 0 0 0
2079 ;
2080 SV* maybe_label;
2081  
2082 0 ▶ if (items < 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 3) 0 0 0
2083 0 maybe_label = nullptr;
2084 else {
2085 0 maybe_label = ST(2)
2086 ;
2087 }
2088 #line 90 "t/cookbook/recipe09.xsi"
2089 THIS->add_point(*pt);
2090 Object self{ST(0)};
2091 Array payload(self.payload(&payload_marker_09).obj);
2092 Sv label = maybe_label ? Sv{maybe_label} : Sv::undef;
2093 Sv ref = Ref::create(maybe_label);
2094 payload.push(ref);
2095 #line 2096 "t/cookbook/cookbook_xsgen.cc"
2096 0 PUTBACK;
2097 0 return;
2098 0 }
2099 0 }); }
2100  
2101  
2102  
2103 0 ▶XS_EUPXS(XS_MyTest__Cookbook__ShapeA_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__ShapeA_new) { xs::throw_guard(cv, [=]() 0 0 0
2104 {
2105 0 dVAR; dXSARGS;
2106 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2107 0 croak_xs_usage(cv, "CLASS");
2108 {
2109 0 Sv RETVAL;
2110 0 ▶ SV* CLASS = ST(0)
Branch: 1 branch
BranchTrueFalseTotal
SV* CLASS = ST(0) 0 0 0
2111 ;
2112 #line 99 "t/cookbook/recipe09.xsi"
2113 auto shape = new ShapeA();
2114 Object obj = xs::out<>(shape, CLASS);
2115 auto payload = Array::create();
2116 obj.payload_attach(payload, &payload_marker_09);
2117 RETVAL = obj.ref();
2118 #line 2119 "t/cookbook/cookbook_xsgen.cc"
2119 {
2120 SV * RETVALSV;
2121 0 RETVALSV = NULL;
2122 0 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 0 0 0
2123 0 ▶ if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach();
Branch: 2 branches
BranchTrueFalseTotal
if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach(); 0 0 0
if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach(); 0 0 0
2124 0 else switch (RETVAL.type()) {
2125 0 ▶ case SVt_PVAV: XSRETURN(xs::Array(RETVAL.get<AV>()).push_on_stack(MARK));
Branch: 2 branches
BranchTrueFalseTotal
case SVt_PVAV: XSRETURN(xs::Array(RETVAL.get<AV>()).push_on_stack(MARK)); 0 0 0
case SVt_PVAV: XSRETURN(xs::Array(RETVAL.get<AV>()).push_on_stack(MARK)); 0 0 0
2126 0 ▶ case SVt_PVHV: XSRETURN(xs::Hash(RETVAL.get<HV>()).push_on_stack(MARK));
Branch: 2 branches
BranchTrueFalseTotal
case SVt_PVHV: XSRETURN(xs::Hash(RETVAL.get<HV>()).push_on_stack(MARK)); 0 0 0
case SVt_PVHV: XSRETURN(xs::Hash(RETVAL.get<HV>()).push_on_stack(MARK)); 0 0 0
2127 0 case SVt_PVCV:
2128 case SVt_PVIO:
2129 0 ▶ RETVALSV = newRV_noinc(RETVAL.detach());
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = newRV_noinc(RETVAL.detach()); 0 0 0
2130 0 break;
2131 0 default: throw "unknown type of Sv to return";
2132 }
2133 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2134 0 ST(0) = RETVALSV;
2135 }
2136 0 ▶ }
Branch: 3 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
} 0 0 0
2137 0 XSRETURN(1);
2138 0 }); }
2139  
2140  
2141  
2142 0 ▶XS_EUPXS(XS_MyTest__Cookbook__ShapeB_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__ShapeB_new) { xs::throw_guard(cv, [=]() 0 0 0
2143 {
2144 0 dVAR; dXSARGS;
2145 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2146 0 croak_xs_usage(cv, "CLASS");
2147 {
2148 XSShapeA * RETVAL;
2149 0 SV* CLASS = ST(0)
2150 ;
2151 #line 109 "t/cookbook/recipe09.xsi"
2152 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2153 PROTO = CLASS;
2154 RETVAL = new XSShapeA();
2155 #line 2156 "t/cookbook/cookbook_xsgen.cc"
2156 {
2157 SV * RETVALSV;
2158 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
2159 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2160 0 ST(0) = RETVALSV;
2161 }
2162 0 }
2163 0 XSRETURN(1);
2164 0 }); }
2165  
2166  
2167  
2168 0 ▶XS_EUPXS(XS_MyTest__Cookbook__ShapeB_add_point) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__ShapeB_add_point) { xs::throw_guard(cv, [=]() 0 0 0
2169 {
2170 0 dVAR; dXSARGS;
2171 0 ▶ if (items < 2 || items > 3)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 2 || items > 3) 0 0 0
if (items < 2 || items > 3) 0 0 0
2172 0 croak_xs_usage(cv, "THIS, pt, maybe_label= nullptr");
2173 PERL_UNUSED_VAR(ax); /* -Wall */
2174 0 SP -= items;
2175 {
2176 0 ▶ XSShapeA* THIS = xs::in<XSShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
XSShapeA* THIS = xs::in<XSShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2177 ;
2178 0 Point* pt = xs::in<Point *>(ST(1));
2179 ;
2180 SV* maybe_label;
2181  
2182 0 ▶ if (items < 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 3) 0 0 0
2183 0 maybe_label = nullptr;
2184 else {
2185 0 maybe_label = ST(2)
2186 ;
2187 }
2188 #line 112 "t/cookbook/recipe09.xsi"
2189 THIS->add_point(*pt);
2190 THIS->add_label(maybe_label);
2191 #line 2192 "t/cookbook/cookbook_xsgen.cc"
2192 0 PUTBACK;
2193 0 return;
2194 }
2195 0 }); }
2196  
2197  
2198  
2199 0 ▶XS_EUPXS(XS_MyTest__Cookbook__ShapeB_get_point) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__ShapeB_get_point) { xs::throw_guard(cv, [=]() 0 0 0
2200 {
2201 0 dVAR; dXSARGS;
2202 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
2203 0 croak_xs_usage(cv, "THIS, idx");
2204 PERL_UNUSED_VAR(ax); /* -Wall */
2205 0 SP -= items;
2206 {
2207 0 ▶ XSShapeA* THIS = xs::in<XSShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
XSShapeA* THIS = xs::in<XSShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
XSShapeA* THIS = xs::in<XSShapeA *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2208 ;
2209 0 ▶ size_t idx = (size_t)SvUV(ST(1))
Branch: 2 branches
BranchTrueFalseTotal
size_t idx = (size_t)SvUV(ST(1)) 0 0 0
size_t idx = (size_t)SvUV(ST(1)) 0 0 0
2210 ;
2211 #line 117 "t/cookbook/recipe09.xsi"
2212 auto& pt = THIS->get_point(idx);
2213 auto pt_copy = new Point{pt.x, pt.y};
2214 auto wrapped_pt = xs::out<>(pt_copy);
2215 mXPUSHs(wrapped_pt.detach());
2216 if (GIMME_V == G_ARRAY) {
2217 Sv value = SvRV(THIS->get_ref(idx));
2218 mXPUSHs(value.detach());
2219 }
2220 #line 2221 "t/cookbook/cookbook_xsgen.cc"
2221 0 PUTBACK;
2222 0 return;
2223 0 }
2224 0 }); }
2225  
2226  
2227 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe09.xsi' */
2228  
2229  
2230 /* INCLUDE: Including 'recipe10.xsi' from 'cookbook.xs' */
2231  
2232 #include <iostream>
2233 struct DateRecipe10;
2234 struct TimezoneRecipe10 {
2235 0 const char* get_name() const { return name.c_str(); }
2236 private:
2237 0 ▶ TimezoneRecipe10(const char* name_): name{name_} { }
Branch: 1 branch
BranchTrueFalseTotal
TimezoneRecipe10(const char* name_): name{name_} { } 0 0 0
2238 std::string name;
2239 friend struct DateRecipe10;
2240 };
2241 struct DateRecipe10 {
2242 0 DateRecipe10(const char* tz_ = "Europe/Minsk"): tz(tz_) { update(); }
2243 0 ~DateRecipe10() { std::cout << "~DateRecipe10()\n"; }
2244 0 void update() { epoch = std::time(nullptr); }
2245  
2246 0 int get_epoch() const { return epoch; }
2247 0 TimezoneRecipe10& get_timezone() { return tz; }
2248 private:
2249 std::time_t epoch;
2250 TimezoneRecipe10 tz;
2251 };
2252 namespace xs {
2253 template <>
2254 struct Typemap<DateRecipe10*> : TypemapObject<DateRecipe10*, DateRecipe10*, ObjectTypePtr, ObjectStorageMG> {
2255 0 ▶ static std::string package () { return "MyTest::Cookbook::DateRecipe10"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::DateRecipe10"; } 0 0 0
2256 };
2257  
2258 template <>
2259 struct Typemap<TimezoneRecipe10*> : TypemapObject<TimezoneRecipe10*, TimezoneRecipe10*, ObjectTypeForeignPtr, ObjectStorageMG> {
2260 0 ▶ static std::string package () { return "MyTest::Cookbook::TimezoneRecipe10"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::TimezoneRecipe10"; } 0 0 0
2261 };
2262 };
2263 static xs::Sv::payload_marker_t payload_marker_10;
2264  
2265  
2266 0 ▶XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe10_get_name) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe10_get_name) { xs::throw_guard(cv, [=]() 0 0 0
2267 {
2268 0 dVAR; dXSARGS;
2269 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2270 0 croak_xs_usage(cv, "THIS");
2271 {
2272 const char * RETVAL;
2273 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
2274 0 ▶ TimezoneRecipe10* THIS = xs::in<TimezoneRecipe10 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
TimezoneRecipe10* THIS = xs::in<TimezoneRecipe10 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2275 ;
2276 #line 45 "t/cookbook/recipe10.xsi"
2277 RETVAL = THIS->get_name();
2278 #line 2279 "t/cookbook/cookbook_xsgen.cc"
2279 0 sv_setpv((SV*)TARG, RETVAL);
2280 0 ST(0) = TARG;
2281 }
2282 0 XSRETURN(1);
2283 0 }); }
2284  
2285  
2286  
2287 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe10_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe10_new) { xs::throw_guard(cv, [=]() 0 0 0
2288 {
2289 0 dVAR; dXSARGS;
2290 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
2291 0 croak_xs_usage(cv, "CLASS, name");
2292 {
2293 DateRecipe10 * RETVAL;
2294 0 SV* CLASS = ST(0)
2295 ;
2296 0 const char* name = (const char *)SvPV_nolen(ST(1))
2297 ;
2298 #line 50 "t/cookbook/recipe10.xsi"
2299 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2300 PROTO = CLASS;
2301 RETVAL = new DateRecipe10(name);
2302 #line 2303 "t/cookbook/cookbook_xsgen.cc"
2303 {
2304 SV * RETVALSV;
2305 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
2306 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2307 0 ST(0) = RETVALSV;
2308 }
2309 0 }
2310 0 XSRETURN(1);
2311 0 }); }
2312  
2313  
2314  
2315 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe10_update) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe10_update) { xs::throw_guard(cv, [=]() 0 0 0
2316 {
2317 0 dVAR; dXSARGS;
2318 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2319 0 croak_xs_usage(cv, "THIS");
2320 PERL_UNUSED_VAR(ax); /* -Wall */
2321 0 SP -= items;
2322 {
2323 0 ▶ DateRecipe10* THIS = xs::in<DateRecipe10 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
DateRecipe10* THIS = xs::in<DateRecipe10 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2324 ;
2325 #line 52 "t/cookbook/recipe10.xsi"
2326 THIS->update();
2327 #line 2328 "t/cookbook/cookbook_xsgen.cc"
2328 0 PUTBACK;
2329 0 return;
2330 }
2331 0 }); }
2332  
2333  
2334  
2335 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe10_get_epoch) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe10_get_epoch) { xs::throw_guard(cv, [=]() 0 0 0
2336 {
2337 0 dVAR; dXSARGS;
2338 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2339 0 croak_xs_usage(cv, "THIS");
2340 {
2341 std::time_t RETVAL;
2342 0 ▶ DateRecipe10* THIS = xs::in<DateRecipe10 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe10* THIS = xs::in<DateRecipe10 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe10* THIS = xs::in<DateRecipe10 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2343 ;
2344 #line 54 "t/cookbook/recipe10.xsi"
2345 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2346 RETVAL = THIS->get_epoch();
2347 #line 2348 "t/cookbook/cookbook_xsgen.cc"
2348 {
2349 SV * RETVALSV;
2350 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
2351 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2352 0 ST(0) = RETVALSV;
2353 }
2354 0 }
2355 0 XSRETURN(1);
2356 0 }); }
2357  
2358  
2359  
2360 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe10_get_timezone) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe10_get_timezone) { xs::throw_guard(cv, [=]() 0 0 0
2361 {
2362 0 dVAR; dXSARGS;
2363 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2364 0 croak_xs_usage(cv, "THIS");
2365 {
2366 0 Sv RETVAL;
2367 0 ▶ DateRecipe10* THIS = xs::in<DateRecipe10 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe10* THIS = xs::in<DateRecipe10 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe10* THIS = xs::in<DateRecipe10 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2368 ;
2369 #line 57 "t/cookbook/recipe10.xsi"
2370 Object self {ST(0)};
2371 Object tz = xs::out<>(&THIS->get_timezone());
2372 auto self_ref = Ref::create(self);
2373 tz.payload_attach(self_ref, &payload_marker_10);
2374 RETVAL = tz.ref();
2375 #line 2376 "t/cookbook/cookbook_xsgen.cc"
2376 {
2377 SV * RETVALSV;
2378 0 RETVALSV = NULL;
2379 0 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 0 0 0
2380 0 ▶ if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach();
Branch: 2 branches
BranchTrueFalseTotal
if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach(); 0 0 0
if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach(); 0 0 0
2381 0 else switch (RETVAL.type()) {
2382 0 ▶ case SVt_PVAV: XSRETURN(xs::Array(RETVAL.get<AV>()).push_on_stack(MARK));
Branch: 2 branches
BranchTrueFalseTotal
case SVt_PVAV: XSRETURN(xs::Array(RETVAL.get<AV>()).push_on_stack(MARK)); 0 0 0
case SVt_PVAV: XSRETURN(xs::Array(RETVAL.get<AV>()).push_on_stack(MARK)); 0 0 0
2383 0 ▶ case SVt_PVHV: XSRETURN(xs::Hash(RETVAL.get<HV>()).push_on_stack(MARK));
Branch: 2 branches
BranchTrueFalseTotal
case SVt_PVHV: XSRETURN(xs::Hash(RETVAL.get<HV>()).push_on_stack(MARK)); 0 0 0
case SVt_PVHV: XSRETURN(xs::Hash(RETVAL.get<HV>()).push_on_stack(MARK)); 0 0 0
2384 0 case SVt_PVCV:
2385 case SVt_PVIO:
2386 0 ▶ RETVALSV = newRV_noinc(RETVAL.detach());
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = newRV_noinc(RETVAL.detach()); 0 0 0
2387 0 break;
2388 0 default: throw "unknown type of Sv to return";
2389 }
2390 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2391 0 ST(0) = RETVALSV;
2392 }
2393 0 ▶ }
Branch: 4 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
} 0 0 0
} 0 0 0
2394 0 XSRETURN(1);
2395 0 }); }
2396  
2397  
2398 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe10.xsi' */
2399  
2400  
2401 /* INCLUDE: Including 'recipe11.xsi' from 'cookbook.xs' */
2402  
2403 struct DateRecipe11;
2404 struct TimezoneRecipe11: public panda::Refcnt {
2405 0 const char* get_name() const { return name.c_str(); }
2406 private:
2407 0 ▶ TimezoneRecipe11(const char* name_): name{name_} { }
Branch: 1 branch
BranchTrueFalseTotal
TimezoneRecipe11(const char* name_): name{name_} { } 0 0 0
2408 std::string name;
2409 friend struct DateRecipe11;
2410 };
2411 using TimezoneRecipe11SP = panda::iptr<TimezoneRecipe11>;
2412 struct DateRecipe11: public panda::Refcnt {
2413 0 ▶ DateRecipe11(const char* tz_ = "Europe/Minsk"): tz(new TimezoneRecipe11(tz_)) { update(); }
Branch: 3 branches
BranchTrueFalseTotal
DateRecipe11(const char* tz_ = "Europe/Minsk"): tz(new TimezoneRecipe11(tz_)) { update(); } 0 0 0
DateRecipe11(const char* tz_ = "Europe/Minsk"): tz(new TimezoneRecipe11(tz_)) { update(); } 0 0 0
DateRecipe11(const char* tz_ = "Europe/Minsk"): tz(new TimezoneRecipe11(tz_)) { update(); } 0 0 0
2414 0 void update() { epoch = std::time(nullptr); }
2415  
2416 0 int get_epoch() const { return epoch; }
2417 0 TimezoneRecipe11SP get_timezone() { return tz; }
2418 private:
2419 std::time_t epoch;
2420 TimezoneRecipe11SP tz;
2421 };
2422 namespace xs {
2423 template <>
2424 struct Typemap<DateRecipe11*> : TypemapObject<DateRecipe11*, DateRecipe11*, ObjectTypeRefcntPtr, ObjectStorageMG> {
2425 0 ▶ static std::string package () { return "MyTest::Cookbook::DateRecipe11"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::DateRecipe11"; } 0 0 0
2426 };
2427  
2428 template <>
2429 struct Typemap<TimezoneRecipe11*> : TypemapObject<TimezoneRecipe11*, TimezoneRecipe11*, ObjectTypeRefcntPtr, ObjectStorageMG> {
2430 0 ▶ static std::string package () { return "MyTest::Cookbook::TimezoneRecipe11"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::TimezoneRecipe11"; } 0 0 0
2431 };
2432 };
2433  
2434  
2435 0 ▶XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe11_get_name) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__TimezoneRecipe11_get_name) { xs::throw_guard(cv, [=]() 0 0 0
2436 {
2437 0 dVAR; dXSARGS;
2438 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2439 0 croak_xs_usage(cv, "THIS");
2440 {
2441 const char * RETVAL;
2442 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
2443 0 ▶ TimezoneRecipe11* THIS = xs::in<TimezoneRecipe11 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
TimezoneRecipe11* THIS = xs::in<TimezoneRecipe11 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2444 ;
2445 #line 41 "t/cookbook/recipe11.xsi"
2446 RETVAL = THIS->get_name();
2447 #line 2448 "t/cookbook/cookbook_xsgen.cc"
2448 0 sv_setpv((SV*)TARG, RETVAL);
2449 0 ST(0) = TARG;
2450 }
2451 0 XSRETURN(1);
2452 0 }); }
2453  
2454  
2455  
2456 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe11_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe11_new) { xs::throw_guard(cv, [=]() 0 0 0
2457 {
2458 0 dVAR; dXSARGS;
2459 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
2460 0 croak_xs_usage(cv, "CLASS, name");
2461 {
2462 DateRecipe11 * RETVAL;
2463 0 SV* CLASS = ST(0)
2464 ;
2465 0 const char* name = (const char *)SvPV_nolen(ST(1))
2466 ;
2467 #line 46 "t/cookbook/recipe11.xsi"
2468 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2469 PROTO = CLASS;
2470 RETVAL = new DateRecipe11(name);
2471 #line 2472 "t/cookbook/cookbook_xsgen.cc"
2472 {
2473 SV * RETVALSV;
2474 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
2475 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2476 0 ST(0) = RETVALSV;
2477 }
2478 0 }
2479 0 XSRETURN(1);
2480 0 }); }
2481  
2482  
2483  
2484 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe11_update) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe11_update) { xs::throw_guard(cv, [=]() 0 0 0
2485 {
2486 0 dVAR; dXSARGS;
2487 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2488 0 croak_xs_usage(cv, "THIS");
2489 PERL_UNUSED_VAR(ax); /* -Wall */
2490 0 SP -= items;
2491 {
2492 0 ▶ DateRecipe11* THIS = xs::in<DateRecipe11 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
DateRecipe11* THIS = xs::in<DateRecipe11 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2493 ;
2494 #line 48 "t/cookbook/recipe11.xsi"
2495 THIS->update();
2496 #line 2497 "t/cookbook/cookbook_xsgen.cc"
2497 0 PUTBACK;
2498 0 return;
2499 }
2500 0 }); }
2501  
2502  
2503  
2504 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe11_get_epoch) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe11_get_epoch) { xs::throw_guard(cv, [=]() 0 0 0
2505 {
2506 0 dVAR; dXSARGS;
2507 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2508 0 croak_xs_usage(cv, "THIS");
2509 {
2510 std::time_t RETVAL;
2511 0 ▶ DateRecipe11* THIS = xs::in<DateRecipe11 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe11* THIS = xs::in<DateRecipe11 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe11* THIS = xs::in<DateRecipe11 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2512 ;
2513 #line 50 "t/cookbook/recipe11.xsi"
2514 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2515 RETVAL = THIS->get_epoch();
2516 #line 2517 "t/cookbook/cookbook_xsgen.cc"
2517 {
2518 SV * RETVALSV;
2519 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
2520 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2521 0 ST(0) = RETVALSV;
2522 }
2523 0 }
2524 0 XSRETURN(1);
2525 0 }); }
2526  
2527  
2528  
2529 0 ▶XS_EUPXS(XS_MyTest__Cookbook__DateRecipe11_get_timezone) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__DateRecipe11_get_timezone) { xs::throw_guard(cv, [=]() 0 0 0
2530 {
2531 0 dVAR; dXSARGS;
2532 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2533 0 croak_xs_usage(cv, "THIS");
2534 {
2535 0 TimezoneRecipe11SP RETVAL;
2536 0 ▶ DateRecipe11* THIS = xs::in<DateRecipe11 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
DateRecipe11* THIS = xs::in<DateRecipe11 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
DateRecipe11* THIS = xs::in<DateRecipe11 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2537 ;
2538 #line 52 "t/cookbook/recipe11.xsi"
2539 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2540 RETVAL = THIS->get_timezone();
2541 #line 2542 "t/cookbook/cookbook_xsgen.cc"
2542 {
2543 SV * RETVALSV;
2544 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
2545 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2546 0 ST(0) = RETVALSV;
2547 }
2548 0 }
2549 0 XSRETURN(1);
2550 0 }); }
2551  
2552  
2553 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe11.xsi' */
2554  
2555  
2556 /* INCLUDE: Including 'recipe12.xsi' from 'cookbook.xs' */
2557  
2558 #include <cmath>
2559 #include <iostream>
2560 struct PointRecipe12 {
2561 double x;
2562 double y;
2563 };
2564 0 double distance(const PointRecipe12& pt_a, const PointRecipe12& pt_b) {
2565 0 auto dx = pt_a.x - pt_a.x;
2566 0 auto dy = pt_a.y - pt_b.y;
2567 0 return std::sqrt(dx * dx + dy * dy);
2568 }
2569 struct StatisticsRecipe12 {
2570 0 StatisticsRecipe12(const PointRecipe12& interest_, const std::vector<PointRecipe12>& points_): interest{interest_}, points{points_} {
2571 0 ▶ if(points.empty()) throw std::runtime_error("points cannot be empty");
Branch: 2 branches
BranchTrueFalseTotal
if(points.empty()) throw std::runtime_error("points cannot be empty"); 0 0 0
if(points.empty()) throw std::runtime_error("points cannot be empty"); 0 0 0
2572 0 }
2573  
2574 0 const PointRecipe12& nearest() const {
2575 0 ▶ return select([](const double& prev_dist, const double& new_dist) { return new_dist < prev_dist; } );
Branch: 1 branch
BranchTrueFalseTotal
return select([](const double& prev_dist, const double& new_dist) { return new_dist < prev_dist; } ); 0 0 0
2576 }
2577  
2578 0 const PointRecipe12& farest() const {
2579 0 ▶ return select([](const double& prev_dist, const double& new_dist) { return new_dist > prev_dist; } );
Branch: 1 branch
BranchTrueFalseTotal
return select([](const double& prev_dist, const double& new_dist) { return new_dist > prev_dist; } ); 0 0 0
2580 }
2581 private:
2582 template<typename F>
2583 0 const PointRecipe12& select(F&& fn) const {
2584 0 const PointRecipe12* pt = &points.front();
2585 0 ▶ auto best_distance = distance(interest, *pt);
Branch: 2 branches
BranchTrueFalseTotal
auto best_distance = distance(interest, *pt); 0 0 0
auto best_distance = distance(interest, *pt); 0 0 0
2586 0 ▶ for(auto it = points.cbegin() + 1; it != points.cend(); ++it) {
Branch: 2 branches
BranchTrueFalseTotal
for(auto it = points.cbegin() + 1; it != points.cend(); ++it) { 0 0 0
for(auto it = points.cbegin() + 1; it != points.cend(); ++it) { 0 0 0
2587 0 ▶ auto new_distance = distance(interest, *it);
Branch: 2 branches
BranchTrueFalseTotal
auto new_distance = distance(interest, *it); 0 0 0
auto new_distance = distance(interest, *it); 0 0 0
2588 0 ▶ if(fn(best_distance, new_distance)) {
Branch: 2 branches
BranchTrueFalseTotal
if(fn(best_distance, new_distance)) { 0 0 0
if(fn(best_distance, new_distance)) { 0 0 0
2589 0 pt = &*it;
2590 0 best_distance = new_distance;
2591 }
2592 }
2593 0 return *pt;
2594 }
2595  
2596 const PointRecipe12& interest;
2597 const std::vector<PointRecipe12>& points;
2598 };
2599 namespace xs {
2600 template <>
2601 struct Typemap<PointRecipe12*> : TypemapObject<PointRecipe12*, PointRecipe12*, ObjectTypePtr, ObjectStorageMG> {
2602 0 ▶ static std::string package () { return "MyTest::Cookbook::PointRecipe12"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::PointRecipe12"; } 0 0 0
2603 };
2604  
2605  
2606 template <>
2607 struct Typemap<StatisticsRecipe12*> : TypemapObject<StatisticsRecipe12*, StatisticsRecipe12*, ObjectTypePtr, ObjectStorageMG> {
2608 0 ▶ static std::string package () { return "MyTest::Cookbook::StatisticsRecipe12"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::StatisticsRecipe12"; } 0 0 0
2609 };
2610 }
2611 static xs::Sv::payload_marker_t payload_marker_12;
2612 struct StatisticsRecipe12_payload {
2613 PointRecipe12 interest;
2614 std::vector<PointRecipe12> points;
2615 0 ~StatisticsRecipe12_payload() { std::cout << "~StatisticsRecipe12_payload\n"; }
2616 };
2617 0 static int payload_marker_IntersectionFinderAdder_free(pTHX_ SV*, MAGIC* mg) {
2618 0 ▶ if (mg->mg_virtual == &payload_marker_12) {
Branch: 1 branch
BranchTrueFalseTotal
if (mg->mg_virtual == &payload_marker_12) { 0 0 0
2619 0 auto* payload = static_cast<StatisticsRecipe12_payload*>((void*)mg->mg_ptr);
2620 0 ▶ delete payload;
Branch: 1 branch
BranchTrueFalseTotal
delete payload; 0 0 0
2621 }
2622 0 return 0;
2623 }
2624  
2625  
2626 0 ▶XS_EUPXS(XS_MyTest__Cookbook__PointRecipe12_x) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__PointRecipe12_x) { xs::throw_guard(cv, [=]() 0 0 0
2627 {
2628 0 dVAR; dXSARGS;
2629 0 dXSI32;
2630 0 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 0 0 0
if (items < 1 || items > 2) 0 0 0
2631 0 croak_xs_usage(cv, "THIS, new_val= nullptr");
2632 {
2633 double RETVAL;
2634 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
2635 0 ▶ PointRecipe12* THIS = xs::in<PointRecipe12 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
PointRecipe12* THIS = xs::in<PointRecipe12 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2636 ;
2637 SV* new_val;
2638  
2639 0 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 0 0 0
2640 0 new_val = nullptr;
2641 else {
2642 0 new_val = ST(1)
2643 ;
2644 }
2645 #line 83 "t/cookbook/recipe12.xsi"
2646 double* val = nullptr;
2647 switch(ix) {
2648 case 1: val = &THIS->y; break;
2649 default: val = &THIS->x; break;
2650 }
2651 if (new_val) {
2652 *val = SvNV(new_val);
2653 }
2654 RETVAL = *val;
2655 #line 2656 "t/cookbook/cookbook_xsgen.cc"
2656 0 ▶ TARGn((double)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGn((double)RETVAL, 1); 0 0 0
2657 0 ST(0) = TARG;
2658 }
2659 0 XSRETURN(1);
2660 0 }); }
2661  
2662  
2663  
2664 0 ▶XS_EUPXS(XS_MyTest__Cookbook__PointRecipe12_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__PointRecipe12_new) { xs::throw_guard(cv, [=]() 0 0 0
2665 {
2666 0 dVAR; dXSARGS;
2667 0 ▶ if (items < 1 || items > 3)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 3) 0 0 0
if (items < 1 || items > 3) 0 0 0
2668 0 croak_xs_usage(cv, "CLASS, x= 0, y= 0");
2669 {
2670 PointRecipe12 * RETVAL;
2671 0 SV* CLASS = ST(0)
2672 ;
2673 double x;
2674 double y;
2675  
2676 0 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 0 0 0
2677 0 x = 0;
2678 else {
2679 0 ▶ x = (double)SvNV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
x = (double)SvNV(ST(1)) 0 0 0
2680 ;
2681 }
2682  
2683 0 ▶ if (items < 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 3) 0 0 0
2684 0 y = 0;
2685 else {
2686 0 ▶ y = (double)SvNV(ST(2))
Branch: 1 branch
BranchTrueFalseTotal
y = (double)SvNV(ST(2)) 0 0 0
2687 ;
2688 }
2689 #line 95 "t/cookbook/recipe12.xsi"
2690 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2691 PROTO = CLASS;
2692 RETVAL = new PointRecipe12{x, y};
2693 #line 2694 "t/cookbook/cookbook_xsgen.cc"
2694 {
2695 SV * RETVALSV;
2696 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
2697 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2698 0 ST(0) = RETVALSV;
2699 }
2700 0 }
2701 0 XSRETURN(1);
2702 0 }); }
2703  
2704  
2705  
2706 0 ▶XS_EUPXS(XS_MyTest__Cookbook__StatisticsRecipe12_nearest) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__StatisticsRecipe12_nearest) { xs::throw_guard(cv, [=]() 0 0 0
2707 {
2708 0 dVAR; dXSARGS;
2709 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2710 0 croak_xs_usage(cv, "THIS");
2711 {
2712 PointRecipe12 * RETVAL;
2713 0 ▶ StatisticsRecipe12* THIS = xs::in<StatisticsRecipe12 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
StatisticsRecipe12* THIS = xs::in<StatisticsRecipe12 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
StatisticsRecipe12* THIS = xs::in<StatisticsRecipe12 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2714 ;
2715 #line 103 "t/cookbook/recipe12.xsi"
2716 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2717 RETVAL = new PointRecipe12(THIS->nearest());
2718 #line 2719 "t/cookbook/cookbook_xsgen.cc"
2719 {
2720 SV * RETVALSV;
2721 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
2722 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2723 0 ST(0) = RETVALSV;
2724 }
2725 0 }
2726 0 XSRETURN(1);
2727 0 }); }
2728  
2729  
2730  
2731 0 ▶XS_EUPXS(XS_MyTest__Cookbook__StatisticsRecipe12_farest) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__StatisticsRecipe12_farest) { xs::throw_guard(cv, [=]() 0 0 0
2732 {
2733 0 dVAR; dXSARGS;
2734 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2735 0 croak_xs_usage(cv, "THIS");
2736 {
2737 PointRecipe12 * RETVAL;
2738 0 ▶ StatisticsRecipe12* THIS = xs::in<StatisticsRecipe12 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
StatisticsRecipe12* THIS = xs::in<StatisticsRecipe12 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
StatisticsRecipe12* THIS = xs::in<StatisticsRecipe12 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2739 ;
2740 #line 107 "t/cookbook/recipe12.xsi"
2741 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2742 RETVAL = new PointRecipe12(THIS->farest());
2743 #line 2744 "t/cookbook/cookbook_xsgen.cc"
2744 {
2745 SV * RETVALSV;
2746 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
2747 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2748 0 ST(0) = RETVALSV;
2749 }
2750 0 }
2751 0 XSRETURN(1);
2752 0 }); }
2753  
2754  
2755  
2756 0 ▶XS_EUPXS(XS_MyTest__Cookbook__StatisticsRecipe12_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__StatisticsRecipe12_new) { xs::throw_guard(cv, [=]() 0 0 0
2757 {
2758 0 dVAR; dXSARGS;
2759 0 ▶ if (items != 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 3) 0 0 0
2760 0 croak_xs_usage(cv, "CLASS, interest, pts");
2761 {
2762 0 Sv RETVAL;
2763 0 SV* CLASS = ST(0)
2764 ;
2765 0 ▶ PointRecipe12* interest = xs::in<PointRecipe12 *>(ST(1));
Branch: 1 branch
BranchTrueFalseTotal
PointRecipe12* interest = xs::in<PointRecipe12 *>(ST(1)); 0 0 0
2766 ;
2767 0 ▶ Array pts = ST(2);
Branch: 1 branch
BranchTrueFalseTotal
Array pts = ST(2); 0 0 0
2768 0 ▶ if (!pts && SvOK(ST(2))) throw "arg is not a 'Array' reference"
Branch: 3 branches
BranchTrueFalseTotal
if (!pts && SvOK(ST(2))) throw "arg is not a 'Array' reference" 0 0 0
if (!pts && SvOK(ST(2))) throw "arg is not a 'Array' reference" 0 0 0
if (!pts && SvOK(ST(2))) throw "arg is not a 'Array' reference" 0 0 0
2769 ;
2770 #line 111 "t/cookbook/recipe12.xsi"
2771 using payload_ptr_t = std::unique_ptr<StatisticsRecipe12_payload>;
2772 using stats_ptr_t = std::unique_ptr<StatisticsRecipe12>;
2773  
2774 std::vector<PointRecipe12> points;
2775 for(auto it: pts) {
2776 points.push_back(*(xs::in<PointRecipe12*>(it)));
2777 }
2778  
2779 // better to use std::make_unique from C++ 14, if available.
2780 auto payload_holder = payload_ptr_t{new StatisticsRecipe12_payload{ *interest, std::move(points) }};
2781 auto self_holder = stats_ptr_t{new StatisticsRecipe12{ payload_holder->interest, payload_holder->points }};
2782  
2783 Object self = xs::out(self_holder.get(), CLASS);
2784 self.payload_attach((void*)payload_holder.get(), &payload_marker_12);
2785  
2786 payload_holder.release();
2787 self_holder.release();
2788  
2789 RETVAL = self.ref();
2790 #line 2791 "t/cookbook/cookbook_xsgen.cc"
2791 {
2792 SV * RETVALSV;
2793 0 RETVALSV = NULL;
2794 0 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 0 0 0
2795 0 ▶ if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach();
Branch: 2 branches
BranchTrueFalseTotal
if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach(); 0 0 0
if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach(); 0 0 0
2796 0 else switch (RETVAL.type()) {
2797 0 ▶ case SVt_PVAV: XSRETURN(xs::Array(RETVAL.get<AV>()).push_on_stack(MARK));
Branch: 2 branches
BranchTrueFalseTotal
case SVt_PVAV: XSRETURN(xs::Array(RETVAL.get<AV>()).push_on_stack(MARK)); 0 0 0
case SVt_PVAV: XSRETURN(xs::Array(RETVAL.get<AV>()).push_on_stack(MARK)); 0 0 0
2798 0 ▶ case SVt_PVHV: XSRETURN(xs::Hash(RETVAL.get<HV>()).push_on_stack(MARK));
Branch: 2 branches
BranchTrueFalseTotal
case SVt_PVHV: XSRETURN(xs::Hash(RETVAL.get<HV>()).push_on_stack(MARK)); 0 0 0
case SVt_PVHV: XSRETURN(xs::Hash(RETVAL.get<HV>()).push_on_stack(MARK)); 0 0 0
2799 0 case SVt_PVCV:
2800 case SVt_PVIO:
2801 0 ▶ RETVALSV = newRV_noinc(RETVAL.detach());
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = newRV_noinc(RETVAL.detach()); 0 0 0
2802 0 break;
2803 0 default: throw "unknown type of Sv to return";
2804 }
2805 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2806 0 ST(0) = RETVALSV;
2807 }
2808 0 ▶ }
Branch: 6 branches
BranchTrueFalseTotal
} 0 0 0
} 0 0 0
} 0 0 0
} 0 0 0
} 0 0 0
} 0 0 0
2809 0 XSRETURN(1);
2810 0 }); }
2811  
2812  
2813 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe12.xsi' */
2814  
2815  
2816 /* INCLUDE: Including 'recipe13.xsi' from 'cookbook.xs' */
2817  
2818 #include <cmath>
2819 #include <iostream>
2820 struct PointRecipe13: public panda::Refcnt {
2821 double x;
2822 double y;
2823 0 PointRecipe13(double xx, double yy): x{xx}, y{yy}{}
2824 };
2825 using PointRecipe13SP = panda::iptr<PointRecipe13>;
2826 struct Shape13: public panda::Refcnt {
2827 0 size_t point_count() const { return points.size(); }
2828 0 PointRecipe13SP get_point(size_t idx) { return points.at(idx); }
2829 0 void add_point(PointRecipe13SP pt) { points.push_back(pt); }
2830 private:
2831 std::vector<PointRecipe13SP> points;
2832 };
2833 namespace xs {
2834 template <>
2835 struct Typemap<PointRecipe13*> : TypemapObject<PointRecipe13*, PointRecipe13*, ObjectTypeRefcntPtr, ObjectStorageMGBackref> {
2836 0 ▶ static std::string package () { return "MyTest::Cookbook::PointRecipe13"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::PointRecipe13"; } 0 0 0
2837 };
2838  
2839 template <>
2840 struct Typemap<Shape13*> : TypemapObject<Shape13*, Shape13*, ObjectTypeRefcntPtr, ObjectStorageMG> {
2841 0 ▶ static std::string package () { return "MyTest::Cookbook::Shape13"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::Cookbook::Shape13"; } 0 0 0
2842 };
2843 }
2844  
2845  
2846 0 ▶XS_EUPXS(XS_MyTest__Cookbook__PointRecipe13_x) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__PointRecipe13_x) { xs::throw_guard(cv, [=]() 0 0 0
2847 {
2848 0 dVAR; dXSARGS;
2849 0 dXSI32;
2850 0 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 0 0 0
if (items < 1 || items > 2) 0 0 0
2851 0 croak_xs_usage(cv, "THIS, new_val= nullptr");
2852 {
2853 double RETVAL;
2854 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
2855 0 ▶ PointRecipe13* THIS = xs::in<PointRecipe13 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
PointRecipe13* THIS = xs::in<PointRecipe13 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2856 ;
2857 SV* new_val;
2858  
2859 0 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 0 0 0
2860 0 new_val = nullptr;
2861 else {
2862 0 new_val = ST(1)
2863 ;
2864 }
2865 #line 38 "t/cookbook/recipe13.xsi"
2866 double* val = nullptr;
2867 switch(ix) {
2868 case 1: val = &THIS->y; break;
2869 default: val = &THIS->x; break;
2870 }
2871 if (new_val) {
2872 *val = SvNV(new_val);
2873 }
2874 RETVAL = *val;
2875 #line 2876 "t/cookbook/cookbook_xsgen.cc"
2876 0 ▶ TARGn((double)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGn((double)RETVAL, 1); 0 0 0
2877 0 ST(0) = TARG;
2878 }
2879 0 XSRETURN(1);
2880 0 }); }
2881  
2882  
2883  
2884 0 ▶XS_EUPXS(XS_MyTest__Cookbook__PointRecipe13_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__PointRecipe13_new) { xs::throw_guard(cv, [=]() 0 0 0
2885 {
2886 0 dVAR; dXSARGS;
2887 0 ▶ if (items < 1 || items > 3)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 3) 0 0 0
if (items < 1 || items > 3) 0 0 0
2888 0 croak_xs_usage(cv, "CLASS, x= 0, y= 0");
2889 {
2890 PointRecipe13 * RETVAL;
2891 0 SV* CLASS = ST(0)
2892 ;
2893 double x;
2894 double y;
2895  
2896 0 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 0 0 0
2897 0 x = 0;
2898 else {
2899 0 ▶ x = (double)SvNV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
x = (double)SvNV(ST(1)) 0 0 0
2900 ;
2901 }
2902  
2903 0 ▶ if (items < 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 3) 0 0 0
2904 0 y = 0;
2905 else {
2906 0 ▶ y = (double)SvNV(ST(2))
Branch: 1 branch
BranchTrueFalseTotal
y = (double)SvNV(ST(2)) 0 0 0
2907 ;
2908 }
2909 #line 50 "t/cookbook/recipe13.xsi"
2910 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2911 PROTO = CLASS;
2912 RETVAL = make_backref<PointRecipe13>(x, y);
2913 //RETVAL = new PointRecipe13(x, y);
2914 #line 2915 "t/cookbook/cookbook_xsgen.cc"
2915 {
2916 SV * RETVALSV;
2917 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
2918 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2919 0 ST(0) = RETVALSV;
2920 }
2921 0 }
2922 0 XSRETURN(1);
2923 0 }); }
2924  
2925  
2926  
2927 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Shape13_point_count) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Shape13_point_count) { xs::throw_guard(cv, [=]() 0 0 0
2928 {
2929 0 dVAR; dXSARGS;
2930 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
2931 0 croak_xs_usage(cv, "THIS");
2932 {
2933 size_t RETVAL;
2934 0 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 0 0 0
2935 0 ▶ Shape13* THIS = xs::in<Shape13 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Shape13* THIS = xs::in<Shape13 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2936 ;
2937 #line 57 "t/cookbook/recipe13.xsi"
2938 RETVAL = THIS->point_count();
2939 #line 2940 "t/cookbook/cookbook_xsgen.cc"
2940 0 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 0 0
2941 0 ST(0) = TARG;
2942 }
2943 0 XSRETURN(1);
2944 0 }); }
2945  
2946  
2947  
2948 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Shape13_add_point) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Shape13_add_point) { xs::throw_guard(cv, [=]() 0 0 0
2949 {
2950 0 dVAR; dXSARGS;
2951 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
2952 0 croak_xs_usage(cv, "THIS, pt");
2953 PERL_UNUSED_VAR(ax); /* -Wall */
2954 0 SP -= items;
2955 {
2956 0 ▶ Shape13* THIS = xs::in<Shape13 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Shape13* THIS = xs::in<Shape13 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
Shape13* THIS = xs::in<Shape13 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2957 ;
2958 0 ▶ PointRecipe13SP pt = xs::in<PointRecipe13SP>(ST(1));
Branch: 1 branch
BranchTrueFalseTotal
PointRecipe13SP pt = xs::in<PointRecipe13SP>(ST(1)); 0 0 0
2959 ;
2960 #line 59 "t/cookbook/recipe13.xsi"
2961 THIS->add_point(pt);
2962 #line 2963 "t/cookbook/cookbook_xsgen.cc"
2963 0 PUTBACK;
2964 0 return;
2965 0 }
2966 0 }); }
2967  
2968  
2969  
2970 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Shape13_get_point) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Shape13_get_point) { xs::throw_guard(cv, [=]() 0 0 0
2971 {
2972 0 dVAR; dXSARGS;
2973 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
2974 0 croak_xs_usage(cv, "THIS, idx");
2975 {
2976 0 PointRecipe13SP RETVAL;
2977 0 ▶ Shape13* THIS = xs::in<Shape13 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Shape13* THIS = xs::in<Shape13 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
Shape13* THIS = xs::in<Shape13 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
2978 ;
2979 0 ▶ size_t idx = (size_t)SvUV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
size_t idx = (size_t)SvUV(ST(1)) 0 0 0
2980 ;
2981 #line 61 "t/cookbook/recipe13.xsi"
2982 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2983 RETVAL = THIS->get_point(idx);
2984 #line 2985 "t/cookbook/cookbook_xsgen.cc"
2985 {
2986 SV * RETVALSV;
2987 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
2988 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
2989 0 ST(0) = RETVALSV;
2990 }
2991 0 }
2992 0 XSRETURN(1);
2993 0 }); }
2994  
2995  
2996  
2997 0 ▶XS_EUPXS(XS_MyTest__Cookbook__Shape13_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Cookbook__Shape13_new) { xs::throw_guard(cv, [=]() 0 0 0
2998 {
2999 0 dVAR; dXSARGS;
3000 0 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 0 0 0
3001 0 croak_xs_usage(cv, "CLASS, ...");
3002 {
3003 Shape13 * RETVAL;
3004 0 SV* CLASS = ST(0)
3005 ;
3006 #line 63 "t/cookbook/recipe13.xsi"
3007 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
3008 PROTO = CLASS;
3009 RETVAL = new Shape13();
3010 #line 3011 "t/cookbook/cookbook_xsgen.cc"
3011 {
3012 SV * RETVALSV;
3013 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
3014 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
3015 0 ST(0) = RETVALSV;
3016 }
3017 0 }
3018 0 XSRETURN(1);
3019 0 }); }
3020  
3021  
3022 /* INCLUDE: Returning to 'cookbook.xs' from 'recipe13.xsi' */
3023  
3024 #ifdef __cplusplus
3025 extern "C" {
3026 #endif
3027  
3028 70 ▶XS_EXTERNAL(boot_MyTest__Cookbook) { xs::throw_guard(cv, [=]() mutable
Branch: 1 branch
BranchTrueFalseTotal
XS_EXTERNAL(boot_MyTest__Cookbook) { xs::throw_guard(cv, [=]() mutable 35 0 35
3029 {
3030 #if PERL_VERSION_LE(5, 21, 5)
3031 dVAR; dXSARGS;
3032 #else
3033 35 dVAR; dXSBOOTARGSXSAPIVERCHK;
3034 #endif
3035 #if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
3036 char* file = __FILE__;
3037 #else
3038 35 const char* file = __FILE__;
3039 #endif
3040  
3041 PERL_UNUSED_VAR(file);
3042  
3043 PERL_UNUSED_VAR(cv); /* -W */
3044 PERL_UNUSED_VAR(items); /* -W */
3045 #if PERL_VERSION_LE(5, 21, 5)
3046 XS_VERSION_BOOTCHECK;
3047 # ifdef XS_APIVERSION_BOOTCHECK
3048 XS_APIVERSION_BOOTCHECK;
3049 # endif
3050 #endif
3051  
3052 35 newXS_deffile("MyTest::Cookbook::DateRecipe01a::new", XS_MyTest__Cookbook__DateRecipe01a_new);
3053 35 newXS_deffile("MyTest::Cookbook::DateRecipe01a::update", XS_MyTest__Cookbook__DateRecipe01a_update);
3054 35 newXS_deffile("MyTest::Cookbook::DateRecipe01a::get_epoch", XS_MyTest__Cookbook__DateRecipe01a_get_epoch);
3055 35 newXS_deffile("MyTest::Cookbook::DateRecipe01a::DESTROY", XS_MyTest__Cookbook__DateRecipe01a_DESTROY);
3056 35 newXS_deffile("MyTest::Cookbook::DateRecipe01b::new", XS_MyTest__Cookbook__DateRecipe01b_new);
3057 35 newXS_deffile("MyTest::Cookbook::DateRecipe01b::update", XS_MyTest__Cookbook__DateRecipe01b_update);
3058 35 newXS_deffile("MyTest::Cookbook::DateRecipe01b::get_epoch", XS_MyTest__Cookbook__DateRecipe01b_get_epoch);
3059 35 newXS_deffile("MyTest::Cookbook::DateRecipe02a::new", XS_MyTest__Cookbook__DateRecipe02a_new);
3060 35 newXS_deffile("MyTest::Cookbook::DateRecipe02a::update", XS_MyTest__Cookbook__DateRecipe02a_update);
3061 35 newXS_deffile("MyTest::Cookbook::DateRecipe02a::get_epoch", XS_MyTest__Cookbook__DateRecipe02a_get_epoch);
3062 35 newXS_deffile("MyTest::Cookbook::DateRecipe02a::DESTROY", XS_MyTest__Cookbook__DateRecipe02a_DESTROY);
3063 35 newXS_deffile("MyTest::Cookbook::DateRecipe02b::new", XS_MyTest__Cookbook__DateRecipe02b_new);
3064 35 newXS_deffile("MyTest::Cookbook::DateRecipe02b::update", XS_MyTest__Cookbook__DateRecipe02b_update);
3065 35 newXS_deffile("MyTest::Cookbook::DateRecipe02b::get_epoch", XS_MyTest__Cookbook__DateRecipe02b_get_epoch);
3066 35 newXS_deffile("MyTest::Cookbook::TimezoneRecipe03::get_name", XS_MyTest__Cookbook__TimezoneRecipe03_get_name);
3067 35 newXS_deffile("MyTest::Cookbook::TimezoneRecipe03::get_instance", XS_MyTest__Cookbook__TimezoneRecipe03_get_instance);
3068 35 newXS_deffile("MyTest::Cookbook::TimezoneRecipe04::get_name", XS_MyTest__Cookbook__TimezoneRecipe04_get_name);
3069 35 newXS_deffile("MyTest::Cookbook::TimezoneRecipe04::create", XS_MyTest__Cookbook__TimezoneRecipe04_create);
3070 35 newXS_deffile("MyTest::Cookbook::DateRecipe04::new", XS_MyTest__Cookbook__DateRecipe04_new);
3071 35 newXS_deffile("MyTest::Cookbook::DateRecipe04::update", XS_MyTest__Cookbook__DateRecipe04_update);
3072 35 newXS_deffile("MyTest::Cookbook::DateRecipe04::get_epoch", XS_MyTest__Cookbook__DateRecipe04_get_epoch);
3073 35 newXS_deffile("MyTest::Cookbook::DateRecipe04::get_timezone", XS_MyTest__Cookbook__DateRecipe04_get_timezone);
3074 35 newXS_deffile("MyTest::Cookbook::DateRecipe04::set_timezone", XS_MyTest__Cookbook__DateRecipe04_set_timezone);
3075 35 newXS_deffile("MyTest::Cookbook::TimezoneRecipe05::get_name", XS_MyTest__Cookbook__TimezoneRecipe05_get_name);
3076 35 newXS_deffile("MyTest::Cookbook::TimezoneRecipe05::create", XS_MyTest__Cookbook__TimezoneRecipe05_create);
3077 35 newXS_deffile("MyTest::Cookbook::DateRecipe05::new", XS_MyTest__Cookbook__DateRecipe05_new);
3078 35 newXS_deffile("MyTest::Cookbook::DateRecipe05::update", XS_MyTest__Cookbook__DateRecipe05_update);
3079 35 newXS_deffile("MyTest::Cookbook::DateRecipe05::get_epoch", XS_MyTest__Cookbook__DateRecipe05_get_epoch);
3080 35 newXS_deffile("MyTest::Cookbook::DateRecipe05::get_timezone", XS_MyTest__Cookbook__DateRecipe05_get_timezone);
3081 35 newXS_deffile("MyTest::Cookbook::DateRecipe05::set_timezone", XS_MyTest__Cookbook__DateRecipe05_set_timezone);
3082 35 newXS_deffile("MyTest::Cookbook::Base06::method", XS_MyTest__Cookbook__Base06_method);
3083 35 newXS_deffile("MyTest::Cookbook::Base06::new", XS_MyTest__Cookbook__Base06_new);
3084 35 newXS_deffile("MyTest::Cookbook::Derived06A::new", XS_MyTest__Cookbook__Derived06A_new);
3085 35 newXS_deffile("MyTest::Cookbook::Derived06A::specific_method", XS_MyTest__Cookbook__Derived06A_specific_method);
3086 35 newXS_deffile("MyTest::Cookbook::Derived06B::new", XS_MyTest__Cookbook__Derived06B_new);
3087 35 newXS_deffile("MyTest::Cookbook::Derived06B::specific_method", XS_MyTest__Cookbook__Derived06B_specific_method);
3088 35 newXS_deffile("MyTest::Cookbook::Client07::disconnect", XS_MyTest__Cookbook__Client07_disconnect);
3089 35 newXS_deffile("MyTest::Cookbook::Client07::welcome", XS_MyTest__Cookbook__Client07_welcome);
3090 35 newXS_deffile("MyTest::Cookbook::Client07::new", XS_MyTest__Cookbook__Client07_new);
3091 35 newXS_deffile("MyTest::Cookbook::ServerBase07::on_client", XS_MyTest__Cookbook__ServerBase07_on_client);
3092 35 newXS_deffile("MyTest::Cookbook::ServerBase07::new", XS_MyTest__Cookbook__ServerBase07_new);
3093 35 newXS_deffile("MyTest::Cookbook::LoggerPlugin07::on_client", XS_MyTest__Cookbook__LoggerPlugin07_on_client);
3094 35 newXS_deffile("MyTest::Cookbook::LoggerPlugin07::new", XS_MyTest__Cookbook__LoggerPlugin07_new);
3095 35 newXS_deffile("MyTest::Cookbook::AuthorizerPlugin07::on_client", XS_MyTest__Cookbook__AuthorizerPlugin07_on_client);
3096 35 newXS_deffile("MyTest::Cookbook::AuthorizerPlugin07::new", XS_MyTest__Cookbook__AuthorizerPlugin07_new);
3097 35 newXS_deffile("MyTest::Cookbook::WAVFile::name", XS_MyTest__Cookbook__WAVFile_name);
3098 35 newXS_deffile("MyTest::Cookbook::WAVFile::new", XS_MyTest__Cookbook__WAVFile_new);
3099 35 newXS_deffile("MyTest::Cookbook::MultimediaFile::name", XS_MyTest__Cookbook__MultimediaFile_name);
3100 35 newXS_deffile("MyTest::Cookbook::MultimediaFile::format", XS_MyTest__Cookbook__MultimediaFile_format);
3101 35 newXS_deffile("MyTest::Cookbook::MultimediaFile::new", XS_MyTest__Cookbook__MultimediaFile_new);
3102 35 newXS_deffile("MyTest::Cookbook::WAVPlayer::play_wav", XS_MyTest__Cookbook__WAVPlayer_play_wav);
3103 35 newXS_deffile("MyTest::Cookbook::WAVPlayer::preferred_bitrate", XS_MyTest__Cookbook__WAVPlayer_preferred_bitrate);
3104 35 newXS_deffile("MyTest::Cookbook::WAVPlayer::clone", XS_MyTest__Cookbook__WAVPlayer_clone);
3105 35 newXS_deffile("MyTest::Cookbook::WAVPlayer::new", XS_MyTest__Cookbook__WAVPlayer_new);
3106 35 newXS_deffile("MyTest::Cookbook::MultimediaPlayer::new", XS_MyTest__Cookbook__MultimediaPlayer_new);
3107 35 newXS_deffile("MyTest::Cookbook::MultimediaPlayer::play_file", XS_MyTest__Cookbook__MultimediaPlayer_play_file);
3108 35 newXS_deffile("MyTest::Cookbook::MultimediaPlayer::quality", XS_MyTest__Cookbook__MultimediaPlayer_quality);
3109 35 newXS_deffile("MyTest::Cookbook::MultimediaPlayer::clone", XS_MyTest__Cookbook__MultimediaPlayer_clone);
3110 35 cv = newXS_deffile("MyTest::Cookbook::Point::x", XS_MyTest__Cookbook__Point_x);
3111 35 XSANY.any_i32 = 0;
3112 35 cv = newXS_deffile("MyTest::Cookbook::Point::y", XS_MyTest__Cookbook__Point_x);
3113 35 XSANY.any_i32 = 1;
3114 35 newXS_deffile("MyTest::Cookbook::Point::new", XS_MyTest__Cookbook__Point_new);
3115 35 newXS_deffile("MyTest::Cookbook::ShapeA::point_count", XS_MyTest__Cookbook__ShapeA_point_count);
3116 35 newXS_deffile("MyTest::Cookbook::ShapeA::get_point", XS_MyTest__Cookbook__ShapeA_get_point);
3117 35 newXS_deffile("MyTest::Cookbook::ShapeA::add_point", XS_MyTest__Cookbook__ShapeA_add_point);
3118 35 newXS_deffile("MyTest::Cookbook::ShapeA::new", XS_MyTest__Cookbook__ShapeA_new);
3119 35 newXS_deffile("MyTest::Cookbook::ShapeB::new", XS_MyTest__Cookbook__ShapeB_new);
3120 35 newXS_deffile("MyTest::Cookbook::ShapeB::add_point", XS_MyTest__Cookbook__ShapeB_add_point);
3121 35 newXS_deffile("MyTest::Cookbook::ShapeB::get_point", XS_MyTest__Cookbook__ShapeB_get_point);
3122 35 newXS_deffile("MyTest::Cookbook::TimezoneRecipe10::get_name", XS_MyTest__Cookbook__TimezoneRecipe10_get_name);
3123 35 newXS_deffile("MyTest::Cookbook::DateRecipe10::new", XS_MyTest__Cookbook__DateRecipe10_new);
3124 35 newXS_deffile("MyTest::Cookbook::DateRecipe10::update", XS_MyTest__Cookbook__DateRecipe10_update);
3125 35 newXS_deffile("MyTest::Cookbook::DateRecipe10::get_epoch", XS_MyTest__Cookbook__DateRecipe10_get_epoch);
3126 35 newXS_deffile("MyTest::Cookbook::DateRecipe10::get_timezone", XS_MyTest__Cookbook__DateRecipe10_get_timezone);
3127 35 newXS_deffile("MyTest::Cookbook::TimezoneRecipe11::get_name", XS_MyTest__Cookbook__TimezoneRecipe11_get_name);
3128 35 newXS_deffile("MyTest::Cookbook::DateRecipe11::new", XS_MyTest__Cookbook__DateRecipe11_new);
3129 35 newXS_deffile("MyTest::Cookbook::DateRecipe11::update", XS_MyTest__Cookbook__DateRecipe11_update);
3130 35 newXS_deffile("MyTest::Cookbook::DateRecipe11::get_epoch", XS_MyTest__Cookbook__DateRecipe11_get_epoch);
3131 35 newXS_deffile("MyTest::Cookbook::DateRecipe11::get_timezone", XS_MyTest__Cookbook__DateRecipe11_get_timezone);
3132 35 cv = newXS_deffile("MyTest::Cookbook::PointRecipe12::x", XS_MyTest__Cookbook__PointRecipe12_x);
3133 35 XSANY.any_i32 = 0;
3134 35 cv = newXS_deffile("MyTest::Cookbook::PointRecipe12::y", XS_MyTest__Cookbook__PointRecipe12_x);
3135 35 XSANY.any_i32 = 1;
3136 35 newXS_deffile("MyTest::Cookbook::PointRecipe12::new", XS_MyTest__Cookbook__PointRecipe12_new);
3137 35 newXS_deffile("MyTest::Cookbook::StatisticsRecipe12::nearest", XS_MyTest__Cookbook__StatisticsRecipe12_nearest);
3138 35 newXS_deffile("MyTest::Cookbook::StatisticsRecipe12::farest", XS_MyTest__Cookbook__StatisticsRecipe12_farest);
3139 35 newXS_deffile("MyTest::Cookbook::StatisticsRecipe12::new", XS_MyTest__Cookbook__StatisticsRecipe12_new);
3140 35 cv = newXS_deffile("MyTest::Cookbook::PointRecipe13::x", XS_MyTest__Cookbook__PointRecipe13_x);
3141 35 XSANY.any_i32 = 0;
3142 35 cv = newXS_deffile("MyTest::Cookbook::PointRecipe13::y", XS_MyTest__Cookbook__PointRecipe13_x);
3143 35 XSANY.any_i32 = 1;
3144 35 newXS_deffile("MyTest::Cookbook::PointRecipe13::new", XS_MyTest__Cookbook__PointRecipe13_new);
3145 35 newXS_deffile("MyTest::Cookbook::Shape13::point_count", XS_MyTest__Cookbook__Shape13_point_count);
3146 35 newXS_deffile("MyTest::Cookbook::Shape13::add_point", XS_MyTest__Cookbook__Shape13_add_point);
3147 35 newXS_deffile("MyTest::Cookbook::Shape13::get_point", XS_MyTest__Cookbook__Shape13_get_point);
3148 35 newXS_deffile("MyTest::Cookbook::Shape13::new", XS_MyTest__Cookbook__Shape13_new);
3149  
3150 /* Initialisation Section */
3151  
3152 #line 7 "t/cookbook/cookbook.xs"
3153 {
3154 Stash("MyTest::Cookbook", GV_ADD).mark_as_loaded("MyTest");
3155 }
3156  
3157 #line 47 "t/cookbook/recipe02.xsi"
3158 {
3159 Stash("MyTest::Cookbook::DateRecipe02a", GV_ADD).mark_as_loaded("MyTest::Cookbook");
3160 }
3161  
3162 #line 63 "t/cookbook/recipe02.xsi"
3163 {
3164 Stash("MyTest::Cookbook::DateRecipe02b", GV_ADD).mark_as_loaded("MyTest::Cookbook");
3165 }
3166  
3167 #line 49 "t/cookbook/recipe06.xsi"
3168 {
3169 Stash("MyTest::Cookbook::Derived06A").inherit("MyTest::Cookbook::Base06");
3170 }
3171  
3172 #line 60 "t/cookbook/recipe06.xsi"
3173 {
3174 Stash("MyTest::Cookbook::Derived06B").inherit("MyTest::Cookbook::Base06");
3175 }
3176  
3177 #line 111 "t/cookbook/recipe07.xsi"
3178 {
3179 auto stash = Stash("MyTest::Cookbook::Server07", GV_ADD);
3180 stash.inherit("MyTest::Cookbook::LoggerPlugin07");
3181 stash.inherit("MyTest::Cookbook::AuthorizerPlugin07");
3182 stash.inherit("MyTest::Cookbook::ServerBase07");
3183 }
3184  
3185 #line 131 "t/cookbook/recipe08.xsi"
3186 {
3187 auto stash = Stash("MyTest::Cookbook::MultimediaPlayer", GV_ADD);
3188 stash.inherit("MyTest::Cookbook::WAVPlayer");
3189 }
3190  
3191 #line 127 "t/cookbook/recipe09.xsi"
3192 {
3193 auto stash = Stash("MyTest::Cookbook::ShapeB", GV_ADD);
3194 stash.inherit("MyTest::Cookbook::ShapeA");
3195 }
3196  
3197 #line 132 "t/cookbook/recipe12.xsi"
3198 {
3199 payload_marker_12.svt_free = payload_marker_IntersectionFinderAdder_free;
3200 }
3201  
3202 #line 3203 "t/cookbook/cookbook_xsgen.cc"
3203  
3204 /* End of Initialisation Section */
3205  
3206 #if PERL_VERSION_LE(5, 21, 5)
3207 # if PERL_VERSION_GE(5, 9, 0)
3208 if (PL_unitcheckav)
3209 call_list(PL_scopestack_ix, PL_unitcheckav);
3210 # endif
3211 XSRETURN_YES;
3212 #else
3213 35 Perl_xs_boot_epilog(aTHX_ ax);
3214 #endif
3215 70 }); }
3216  
3217 #ifdef __cplusplus
3218 }
3219 #endif
« t/cookbook/recipe09.xsi ↑ Summary t/cookbook/recipe08.xsi »