src/xs/typemap/numeric.h

filter: Statementstmt 0.0% 0 / 1 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 3 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« src/xs/typemap/error.h ↑ Summary src/xs/typemap/object.h »
1 #pragma once
2 #include "base.h"
3 #include "../Simple.h" // for _getnum()
4  
5 namespace xs {
6  
7 template <class TYPE> struct TypemapNumeric : TypemapBase<TYPE> {
8 static inline TYPE in (SV* arg) { return detail::_getnum<TYPE>(arg); }
9 0 ▶ static inline Sv out (TYPE var, const Sv& = Sv()) { return Simple(var); }
Branch: 1 branch
BranchTrueFalseTotal
static inline Sv out (TYPE var, const Sv& = Sv()) { return Simple(var); } 0 0 0
10 };
11  
12 template <> struct Typemap<char> : TypemapNumeric<char> {};
13 template <> struct Typemap<short> : TypemapNumeric<short> {};
14 template <> struct Typemap<int> : TypemapNumeric<int> {};
15 template <> struct Typemap<long> : TypemapNumeric<long> {};
16 template <> struct Typemap<long long> : TypemapNumeric<long long> {};
17 template <> struct Typemap<unsigned char> : TypemapNumeric<unsigned char> {};
18 template <> struct Typemap<unsigned short> : TypemapNumeric<unsigned short> {};
19 template <> struct Typemap<unsigned> : TypemapNumeric<unsigned> {};
20 template <> struct Typemap<unsigned long> : TypemapNumeric<unsigned long> {};
21 template <> struct Typemap<unsigned long long> : TypemapNumeric<unsigned long long> {};
22 template <> struct Typemap<float> : TypemapNumeric<float> {};
23 template <> struct Typemap<double> : TypemapNumeric<double> {};
24  
25 template <> struct Typemap<bool> : TypemapBase<bool> {
26 static inline Sv out (bool var, const Sv& = {}) { return Simple(var); }
27 static inline bool in (Sv arg) { return arg.is_true(); }
28 };
29  
30 }
« src/xs/typemap/error.h ↑ Summary src/xs/typemap/object.h »