File Coverage

/usr/local/lib/perl5/site_perl/5.26.1/x86_64-linux/XS/Framework.x/i/xs/typemap/auto.h
Criterion Covered Total %
statement 4 4 100.0
branch 4 4 100.0
condition n/a
subroutine n/a
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             #pragma once
2             #include "base.h"
3             #include
4              
5             namespace xs {
6              
7             // automatic default typemap for if typemap for defined
8             template struct Typemap : Typemap {};
9              
10             // automatic default reference resolving
11             template *>::value> struct TypemapResolveReference {};
12             template struct TypemapResolveReference : Typemap {
13             using Super = Typemap;
14 732           static TYPE& in (pTHX_ SV* arg) {
15 732           auto ret = Super::in(aTHX_ arg);
16 732 100         if (!ret) throw "invalid value: undef not allowed";
    100          
17 721           return *ret;
18             }
19             static Sv out (pTHX_ TYPE& var, const Sv& = {}) = delete;
20             };
21             template struct TypemapResolveReference : Typemap> {};
22             template struct Typemap : TypemapResolveReference {};
23              
24             // automatic default typemap for > if typemap for defined
25             template struct Typemap, panda::iptr> : Typemap {
26             using Super = Typemap;
27             static panda::iptr in (pTHX_ SV* arg) { return Super::in(aTHX_ arg); }
28              
29             static Sv out (pTHX_ const panda::iptr& var, const Sv& proto = {}) {
30             return Super::out(aTHX_ var.get(), proto);
31             }
32             };
33              
34             }