/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 | 24 | Tuple2(A a, B b) : a_(a), b_(b) { |
14 | 24 | } _ZN6Tuple2IP6BigStriEC2ES1_i Line | Count | Source | 13 | 5 | Tuple2(A a, B b) : a_(a), b_(b) { | 14 | 5 | } |
_ZN6Tuple2IP6BigStrS1_EC2ES1_S1_ Line | Count | Source | 13 | 5 | Tuple2(A a, B b) : a_(a), b_(b) { | 14 | 5 | } |
Line | Count | Source | 13 | 2 | Tuple2(A a, B b) : a_(a), b_(b) { | 14 | 2 | } |
Line | Count | Source | 13 | 8 | Tuple2(A a, B b) : a_(a), b_(b) { | 14 | 8 | } |
_ZN6Tuple2IiP6BigStrEC2EiS1_ Line | Count | Source | 13 | 3 | Tuple2(A a, B b) : a_(a), b_(b) { | 14 | 3 | } |
_ZN6Tuple2IiPS_IiP6BigStrEEC2EiS3_ Line | Count | Source | 13 | 1 | Tuple2(A a, B b) : a_(a), b_(b) { | 14 | 1 | } |
|
15 | | |
16 | 40 | A at0() { |
17 | 40 | return a_; |
18 | 40 | } Line | Count | Source | 16 | 16 | A at0() { | 17 | 16 | return a_; | 18 | 16 | } |
_ZN6Tuple2IP6BigStriE3at0Ev Line | Count | Source | 16 | 14 | A at0() { | 17 | 14 | return a_; | 18 | 14 | } |
_ZN6Tuple2IP6BigStrS1_E3at0Ev Line | Count | Source | 16 | 5 | A at0() { | 17 | 5 | return a_; | 18 | 5 | } |
_ZN6Tuple2IiP6BigStrE3at0Ev Line | Count | Source | 16 | 4 | A at0() { | 17 | 4 | return a_; | 18 | 4 | } |
_ZN6Tuple2IiPS_IiP6BigStrEE3at0Ev Line | Count | Source | 16 | 1 | A at0() { | 17 | 1 | return a_; | 18 | 1 | } |
|
19 | 39 | B at1() { |
20 | 39 | return b_; |
21 | 39 | } Line | Count | Source | 19 | 16 | B at1() { | 20 | 16 | return b_; | 21 | 16 | } |
_ZN6Tuple2IP6BigStriE3at1Ev Line | Count | Source | 19 | 12 | B at1() { | 20 | 12 | return b_; | 21 | 12 | } |
_ZN6Tuple2IP6BigStrS1_E3at1Ev Line | Count | Source | 19 | 5 | B at1() { | 20 | 5 | return b_; | 21 | 5 | } |
_ZN6Tuple2IiP6BigStrE3at1Ev Line | Count | Source | 19 | 4 | B at1() { | 20 | 4 | return b_; | 21 | 4 | } |
_ZN6Tuple2IiPS_IiP6BigStrEE3at1Ev Line | Count | Source | 19 | 2 | B at1() { | 20 | 2 | return b_; | 21 | 2 | } |
|
22 | | |
23 | 17 | static constexpr ObjHeader obj_header() { |
24 | 17 | return ObjHeader::Tuple(field_mask(), sizeof(this_type)); |
25 | 17 | } _ZN6Tuple2IP6BigStriE10obj_headerEv Line | Count | Source | 23 | 5 | static constexpr ObjHeader obj_header() { | 24 | 5 | return ObjHeader::Tuple(field_mask(), sizeof(this_type)); | 25 | 5 | } |
_ZN6Tuple2IiiE10obj_headerEv Line | Count | Source | 23 | 8 | static constexpr ObjHeader obj_header() { | 24 | 8 | return ObjHeader::Tuple(field_mask(), sizeof(this_type)); | 25 | 8 | } |
_ZN6Tuple2IiP6BigStrE10obj_headerEv Line | Count | Source | 23 | 3 | static constexpr ObjHeader obj_header() { | 24 | 3 | return ObjHeader::Tuple(field_mask(), sizeof(this_type)); | 25 | 3 | } |
_ZN6Tuple2IiPS_IiP6BigStrEE10obj_headerEv Line | Count | Source | 23 | 1 | static constexpr ObjHeader obj_header() { | 24 | 1 | return ObjHeader::Tuple(field_mask(), sizeof(this_type)); | 25 | 1 | } |
Unexecuted instantiation: _ZN6Tuple2IP6BigStrS1_E10obj_headerEv |
26 | | |
27 | 17 | static constexpr uint32_t field_mask() { |
28 | 17 | return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) | |
29 | 17 | (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0); |
30 | 17 | } _ZN6Tuple2IP6BigStriE10field_maskEv Line | Count | Source | 27 | 5 | static constexpr uint32_t field_mask() { | 28 | 5 | return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) | | 29 | 5 | (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0); | 30 | 5 | } |
_ZN6Tuple2IiiE10field_maskEv Line | Count | Source | 27 | 8 | static constexpr uint32_t field_mask() { | 28 | 8 | return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) | | 29 | 8 | (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0); | 30 | 8 | } |
_ZN6Tuple2IiP6BigStrE10field_maskEv Line | Count | Source | 27 | 3 | static constexpr uint32_t field_mask() { | 28 | 3 | return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) | | 29 | 3 | (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0); | 30 | 3 | } |
_ZN6Tuple2IiPS_IiP6BigStrEE10field_maskEv Line | Count | Source | 27 | 1 | static constexpr uint32_t field_mask() { | 28 | 1 | return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) | | 29 | 1 | (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0); | 30 | 1 | } |
Unexecuted instantiation: _ZN6Tuple2IP6BigStrS1_E10field_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 | 1 | Tuple3(A a, B b, C c) : a_(a), b_(b), c_(c) { |
43 | 1 | } |
44 | 1 | A at0() { |
45 | 1 | return a_; |
46 | 1 | } |
47 | 1 | B at1() { |
48 | 1 | return b_; |
49 | 1 | } |
50 | 1 | C at2() { |
51 | 1 | return c_; |
52 | 1 | } |
53 | | |
54 | 1 | static constexpr ObjHeader obj_header() { |
55 | 1 | return ObjHeader::Tuple(field_mask(), sizeof(this_type)); |
56 | 1 | } _ZN6Tuple3IiP6BigStrS1_E10obj_headerEv Line | Count | Source | 54 | 1 | static constexpr ObjHeader obj_header() { | 55 | 1 | return ObjHeader::Tuple(field_mask(), sizeof(this_type)); | 56 | 1 | } |
Unexecuted instantiation: _ZN6Tuple3IP6BigStrS1_S1_E10obj_headerEv |
57 | | |
58 | 1 | static constexpr uint32_t field_mask() { |
59 | 1 | return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) | |
60 | 1 | (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) | |
61 | 1 | (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0); |
62 | 1 | } _ZN6Tuple3IiP6BigStrS1_E10field_maskEv Line | Count | Source | 58 | 1 | static constexpr uint32_t field_mask() { | 59 | 1 | return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) | | 60 | 1 | (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) | | 61 | 1 | (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0); | 62 | 1 | } |
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 | 1 | Tuple4(A a, B b, C c, D d) : a_(a), b_(b), c_(c), d_(d) { |
76 | 1 | } |
77 | 1 | A at0() { |
78 | 1 | return a_; |
79 | 1 | } |
80 | 1 | B at1() { |
81 | 1 | return b_; |
82 | 1 | } |
83 | 1 | C at2() { |
84 | 1 | return c_; |
85 | 1 | } |
86 | 1 | D at3() { |
87 | 1 | return d_; |
88 | 1 | } |
89 | | |
90 | 1 | static constexpr ObjHeader obj_header() { |
91 | 1 | return ObjHeader::Tuple(field_mask(), sizeof(this_type)); |
92 | 1 | } _ZN6Tuple4IiP6BigStrS1_iE10obj_headerEv Line | Count | Source | 90 | 1 | static constexpr ObjHeader obj_header() { | 91 | 1 | return ObjHeader::Tuple(field_mask(), sizeof(this_type)); | 92 | 1 | } |
Unexecuted instantiation: _ZN6Tuple4IiiP6BigStrS1_E10obj_headerEv |
93 | | |
94 | 1 | static constexpr uint32_t field_mask() { |
95 | 1 | return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) | |
96 | 1 | (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) | |
97 | 1 | (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0) | |
98 | 1 | (std::is_pointer<D>() ? maskbit(offsetof(this_type, d_)) : 0); |
99 | 1 | } _ZN6Tuple4IiP6BigStrS1_iE10field_maskEv Line | Count | Source | 94 | 1 | static constexpr uint32_t field_mask() { | 95 | 1 | return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) | | 96 | 1 | (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) | | 97 | 1 | (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0) | | 98 | 1 | (std::is_pointer<D>() ? maskbit(offsetof(this_type, d_)) : 0); | 99 | 1 | } |
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 |