File Coverage

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


line stmt bran cond sub pod time code
1             #pragma once
2             #include "../Sv.h"
3              
4             namespace xs {
5              
6             namespace typemap {
7             struct DefaultType {};
8             }
9              
10             template struct Typemap { using _not_exists = void; };
11              
12             template struct has_typemap : std::true_type {};
13             template struct has_typemap::_not_exists> : std::false_type {};
14              
15             template struct TypemapBase {
16             static inline TYPE in (SV*) = delete;
17              
18             static inline Sv create (const TYPE&, const Sv& = Sv()) = delete;
19              
20             static inline Sv out (const TYPE& var, const Sv& proto = Sv()) {
21             return Typemap::create(var, proto);
22             }
23              
24             static inline void destroy (const TYPE&, SV*) {}
25             };
26              
27             template
28 122           auto in (SV* arg) -> decltype(Typemap::in(arg)) {
29 122           return Typemap::in(arg);
30             }
31              
32             template ::value, std::decay_t, TYPEMAP>>
33             Sv out (TYPE&& var, const Sv& proto = Sv()) {
34             return Typemap::out(std::forward(var), proto);
35             }
36              
37             }