cpp

Coverage Report

Created: 2025-06-14 21:05

/home/uke/oil/mycpp/gc_tuple.h
Line
Count
Source (jump to first uncovered line)
1
#ifndef MYCPP_GC_TUPLE_H
2
#define MYCPP_GC_TUPLE_H
3
4
#include <type_traits>
5
6
#include "mycpp/gc_obj.h"
7
8
template <class A, class B>
9
class Tuple2 {
10
  typedef Tuple2<A, B> this_type;
11
12
 public:
13
165
  Tuple2(A a, B b) : a_(a), b_(b) {
14
165
  }
_ZN6Tuple2IP6BigStrS1_EC2ES1_S1_
Line
Count
Source
13
10
  Tuple2(A a, B b) : a_(a), b_(b) {
14
10
  }
_ZN6Tuple2IblEC2Ebl
Line
Count
Source
13
5
  Tuple2(A a, B b) : a_(a), b_(b) {
14
5
  }
_ZN6Tuple2IiP6BigStrEC2EiS1_
Line
Count
Source
13
38
  Tuple2(A a, B b) : a_(a), b_(b) {
14
38
  }
_ZN6Tuple2IP6BigStriEC2ES1_i
Line
Count
Source
13
15
  Tuple2(A a, B b) : a_(a), b_(b) {
14
15
  }
_ZN6Tuple2IiiEC2Eii
Line
Count
Source
13
37
  Tuple2(A a, B b) : a_(a), b_(b) {
14
37
  }
_ZN6Tuple2IN9expr_asdl5tok_eEP6BigStrEC2ES1_S3_
Line
Count
Source
13
58
  Tuple2(A a, B b) : a_(a), b_(b) {
14
58
  }
_ZN6Tuple2IiPS_IiP6BigStrEEC2EiS3_
Line
Count
Source
13
2
  Tuple2(A a, B b) : a_(a), b_(b) {
14
2
  }
Unexecuted instantiation: _ZN6Tuple2IllEC2Ell
Unexecuted instantiation: _ZN6Tuple2IiPvEC2EiS0_
Unexecuted instantiation: _ZN6Tuple2IP4ListIPS0_IPS_IiiEEEP4DictIiiEEC2ES6_S9_
Unexecuted instantiation: _ZN6Tuple2IP6BigStrPN11syntax_asdl5loc_tEEC2ES1_S4_
Unexecuted instantiation: _ZN6Tuple2IP6BigStrPN11syntax_asdl12CompoundWordEEC2ES1_S4_
Unexecuted instantiation: _ZN6Tuple2IP4ListIP6BigStrEPS0_IPN11syntax_asdl12CompoundWordEEEC2ES4_S9_
Unexecuted instantiation: _ZN6Tuple2IP6BigStrbEC2ES1_b
15
16
207
  A at0() {
17
207
    return a_;
18
207
  }
_ZN6Tuple2IiiE3at0Ev
Line
Count
Source
16
55
  A at0() {
17
55
    return a_;
18
55
  }
_ZN6Tuple2IP6BigStriE3at0Ev
Line
Count
Source
16
33
  A at0() {
17
33
    return a_;
18
33
  }
_ZN6Tuple2IiP6BigStrE3at0Ev
Line
Count
Source
16
48
  A at0() {
17
48
    return a_;
18
48
  }
_ZN6Tuple2IN9expr_asdl5tok_eEP6BigStrE3at0Ev
Line
Count
Source
16
58
  A at0() {
17
58
    return a_;
18
58
  }
_ZN6Tuple2IblE3at0Ev
Line
Count
Source
16
1
  A at0() {
17
1
    return a_;
18
1
  }
_ZN6Tuple2IP6BigStrS1_E3at0Ev
Line
Count
Source
16
10
  A at0() {
17
10
    return a_;
18
10
  }
_ZN6Tuple2IiPS_IiP6BigStrEE3at0Ev
Line
Count
Source
16
2
  A at0() {
17
2
    return a_;
18
2
  }
19
191
  B at1() {
20
191
    return b_;
21
191
  }
_ZN6Tuple2IiiE3at1Ev
Line
Count
Source
19
52
  B at1() {
20
52
    return b_;
21
52
  }
_ZN6Tuple2IP6BigStriE3at1Ev
Line
Count
Source
19
27
  B at1() {
20
27
    return b_;
21
27
  }
_ZN6Tuple2IiP6BigStrE3at1Ev
Line
Count
Source
19
39
  B at1() {
20
39
    return b_;
21
39
  }
_ZN6Tuple2IN9expr_asdl5tok_eEP6BigStrE3at1Ev
Line
Count
Source
19
58
  B at1() {
20
58
    return b_;
21
58
  }
_ZN6Tuple2IblE3at1Ev
Line
Count
Source
19
1
  B at1() {
20
1
    return b_;
21
1
  }
_ZN6Tuple2IP6BigStrS1_E3at1Ev
Line
Count
Source
19
10
  B at1() {
20
10
    return b_;
21
10
  }
_ZN6Tuple2IiPS_IiP6BigStrEE3at1Ev
Line
Count
Source
19
4
  B at1() {
20
4
    return b_;
21
4
  }
22
23
64
  static constexpr ObjHeader obj_header() {
24
64
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
25
64
  }
_ZN6Tuple2IiP6BigStrE10obj_headerEv
Line
Count
Source
23
27
  static constexpr ObjHeader obj_header() {
24
27
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
25
27
  }
_ZN6Tuple2IP6BigStriE10obj_headerEv
Line
Count
Source
23
14
  static constexpr ObjHeader obj_header() {
24
14
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
25
14
  }
_ZN6Tuple2IiiE10obj_headerEv
Line
Count
Source
23
21
  static constexpr ObjHeader obj_header() {
24
21
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
25
21
  }
_ZN6Tuple2IiPS_IiP6BigStrEE10obj_headerEv
Line
Count
Source
23
2
  static constexpr ObjHeader obj_header() {
24
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
25
2
  }
Unexecuted instantiation: _ZN6Tuple2IP6BigStrS1_E10obj_headerEv
Unexecuted instantiation: _ZN6Tuple2IP4ListIPS0_IPS_IiiEEEP4DictIiiEE10obj_headerEv
Unexecuted instantiation: _ZN6Tuple2IP6BigStrbE10obj_headerEv
26
27
64
  static constexpr uint32_t field_mask() {
28
64
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
29
64
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
30
64
  }
_ZN6Tuple2IiP6BigStrE10field_maskEv
Line
Count
Source
27
27
  static constexpr uint32_t field_mask() {
28
27
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
29
27
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
30
27
  }
_ZN6Tuple2IP6BigStriE10field_maskEv
Line
Count
Source
27
14
  static constexpr uint32_t field_mask() {
28
14
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
29
14
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
30
14
  }
_ZN6Tuple2IiiE10field_maskEv
Line
Count
Source
27
21
  static constexpr uint32_t field_mask() {
28
21
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
29
21
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
30
21
  }
_ZN6Tuple2IiPS_IiP6BigStrEE10field_maskEv
Line
Count
Source
27
2
  static constexpr uint32_t field_mask() {
28
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
29
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
30
2
  }
Unexecuted instantiation: _ZN6Tuple2IP6BigStrS1_E10field_maskEv
Unexecuted instantiation: _ZN6Tuple2IP4ListIPS0_IPS_IiiEEEP4DictIiiEE10field_maskEv
Unexecuted instantiation: _ZN6Tuple2IP6BigStrbE10field_maskEv
31
32
 private:
33
  A a_;
34
  B b_;
35
};
36
37
template <class A, class B, class C>
38
class Tuple3 {
39
  typedef Tuple3<A, B, C> this_type;
40
41
 public:
42
3
  Tuple3(A a, B b, C c) : a_(a), b_(b), c_(c) {
43
3
  }
_ZN6Tuple3IiP6BigStrS1_EC2EiS1_S1_
Line
Count
Source
42
2
  Tuple3(A a, B b, C c) : a_(a), b_(b), c_(c) {
43
2
  }
_ZN6Tuple3IdddEC2Eddd
Line
Count
Source
42
1
  Tuple3(A a, B b, C c) : a_(a), b_(b), c_(c) {
43
1
  }
44
3
  A at0() {
45
3
    return a_;
46
3
  }
_ZN6Tuple3IiP6BigStrS1_E3at0Ev
Line
Count
Source
44
2
  A at0() {
45
2
    return a_;
46
2
  }
_ZN6Tuple3IdddE3at0Ev
Line
Count
Source
44
1
  A at0() {
45
1
    return a_;
46
1
  }
47
3
  B at1() {
48
3
    return b_;
49
3
  }
_ZN6Tuple3IiP6BigStrS1_E3at1Ev
Line
Count
Source
47
2
  B at1() {
48
2
    return b_;
49
2
  }
_ZN6Tuple3IdddE3at1Ev
Line
Count
Source
47
1
  B at1() {
48
1
    return b_;
49
1
  }
50
3
  C at2() {
51
3
    return c_;
52
3
  }
_ZN6Tuple3IiP6BigStrS1_E3at2Ev
Line
Count
Source
50
2
  C at2() {
51
2
    return c_;
52
2
  }
_ZN6Tuple3IdddE3at2Ev
Line
Count
Source
50
1
  C at2() {
51
1
    return c_;
52
1
  }
53
54
2
  static constexpr ObjHeader obj_header() {
55
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
56
2
  }
_ZN6Tuple3IiP6BigStrS1_E10obj_headerEv
Line
Count
Source
54
2
  static constexpr ObjHeader obj_header() {
55
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
56
2
  }
Unexecuted instantiation: _ZN6Tuple3IP6BigStrS1_S1_E10obj_headerEv
57
58
2
  static constexpr uint32_t field_mask() {
59
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
60
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
61
2
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0);
62
2
  }
_ZN6Tuple3IiP6BigStrS1_E10field_maskEv
Line
Count
Source
58
2
  static constexpr uint32_t field_mask() {
59
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
60
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
61
2
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0);
62
2
  }
Unexecuted instantiation: _ZN6Tuple3IP6BigStrS1_S1_E10field_maskEv
63
64
 private:
65
  A a_;
66
  B b_;
67
  C c_;
68
};
69
70
template <class A, class B, class C, class D>
71
class Tuple4 {
72
  typedef Tuple4<A, B, C, D> this_type;
73
74
 public:
75
2
  Tuple4(A a, B b, C c, D d) : a_(a), b_(b), c_(c), d_(d) {
76
2
  }
77
2
  A at0() {
78
2
    return a_;
79
2
  }
80
2
  B at1() {
81
2
    return b_;
82
2
  }
83
2
  C at2() {
84
2
    return c_;
85
2
  }
86
2
  D at3() {
87
2
    return d_;
88
2
  }
89
90
2
  static constexpr ObjHeader obj_header() {
91
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
92
2
  }
_ZN6Tuple4IiP6BigStrS1_iE10obj_headerEv
Line
Count
Source
90
2
  static constexpr ObjHeader obj_header() {
91
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
92
2
  }
Unexecuted instantiation: _ZN6Tuple4IiiP6BigStrS1_E10obj_headerEv
93
94
2
  static constexpr uint32_t field_mask() {
95
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
96
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
97
2
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0) |
98
2
           (std::is_pointer<D>() ? maskbit(offsetof(this_type, d_)) : 0);
99
2
  }
_ZN6Tuple4IiP6BigStrS1_iE10field_maskEv
Line
Count
Source
94
2
  static constexpr uint32_t field_mask() {
95
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
96
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
97
2
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0) |
98
2
           (std::is_pointer<D>() ? maskbit(offsetof(this_type, d_)) : 0);
99
2
  }
Unexecuted instantiation: _ZN6Tuple4IiiP6BigStrS1_E10field_maskEv
100
101
 private:
102
  A a_;
103
  B b_;
104
  C c_;
105
  D d_;
106
};
107
108
template <class A, class B, class C, class D, class E>
109
class Tuple5 {
110
  typedef Tuple5<A, B, C, D, E> this_type;
111
112
 public:
113
  Tuple5(A a, B b, C c, D d, E e) : a_(a), b_(b), c_(c), d_(d), e_(e) {
114
  }
115
  A at0() {
116
    return a_;
117
  }
118
  B at1() {
119
    return b_;
120
  }
121
  C at2() {
122
    return c_;
123
  }
124
  D at3() {
125
    return d_;
126
  }
127
  E at4() {
128
    return e_;
129
  }
130
131
  static constexpr ObjHeader obj_header() {
132
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
133
  }
134
135
  static constexpr uint32_t field_mask() {
136
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
137
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
138
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0) |
139
           (std::is_pointer<D>() ? maskbit(offsetof(this_type, d_)) : 0) |
140
           (std::is_pointer<E>() ? maskbit(offsetof(this_type, e_)) : 0);
141
  }
142
143
 private:
144
  A a_;
145
  B b_;
146
  C c_;
147
  D d_;
148
  E e_;
149
};
150
151
#endif  // MYCPP_GC_TUPLE_H