2
3
4
5
6
7
9#ifndef GIMBAL_BIT_VIEW_H
10#define GIMBAL_BIT_VIEW_H
14#define GBL_BIT_VIEW_BPW (8
*sizeof(uint32_t))
15#define GBL_BIT_VIEW_BYTES(bits) ((((bits) + 8
- 1
)&(~(8
-1
)))/8
)
18#define GBL_SELF_TYPE GblBitView
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
90
91
92
93
94
95
96
97
98
102#define GblBitView_fromBuffer(...) GblBitView_fromBufferDefault_
(__VA_ARGS__)
103#define GblBitView_fromView(...) GblBitView_fromViewDefault_
(__VA_ARGS__)
104#define GblBitView_string(...) GblBitView_stringDefault_
(__VA_ARGS__)
105#define GblBitView_uint64(...) GblBitView_uint64Default_
(__VA_ARGS__)
106#define GblBitView_setString(...) GblBitView_setStringDefault_
(__VA_ARGS__)
107#define GblBitView_setUint64(...) GblBitView_setUUint64Default_(__VA_ARGS__)
108#define GblBitView_count(...) GblBitView_countDefault_
(__VA_ARGS__)
109#define GblBitView_any(...) GblBitView_anyDefault_
(__VA_ARGS__)
110#define GblBitView_all(...) GblBitView_allDefault_
(__VA_ARGS__)
111#define GblBitView_none(...) GblBitView_noneDefault_
(__VA_ARGS__)
112#define GblBitView_assign(...) GblBitView_assignDefault_
(__VA_ARGS__)
113#define GblBitView_set(...) GblBitView_setDefault_
(__VA_ARGS__)
114#define GblBitView_reset(...) GblBitView_resetDefault_
(__VA_ARGS__)
115#define GblBitView_flip(...) GblBitView_flipDefault_
(__VA_ARGS__)
116#define GblBitView_rotate(...) GblBitView_rotateDefault_
(__VA_ARGS__)
118#define GblBitView_fromBufferDefault_(...)
119 GblBitView_fromBufferDefault__
(__VA_ARGS__, 0
)
120#define GblBitView_fromBufferDefault__(self, buffer, count, offset, ...)
121 (GblBitView_fromBuffer
)(self, buffer, count, offset)
123#define GblBitView_fromViewDefault_(...)
124 GblBitView_fromViewDefault__
(__VA_ARGS__, GBL_TUPLE_FIRST(__VA_ARGS__)->length, 0
)
125#define GblBitView_fromViewDefault__(self, view, count, offset, ...)
126 (GblBitView_fromView
)(self, view, count, offset)
128#define GblBitView_stringDefault_(...)
129 GblBitView_stringDefault__
(__VA_ARGS__, 0
, (GBL_TUPLE_FIRST(__VA_ARGS__))->length)
130#define GblBitView_stringDefault__(self, buffer, index, count, ...)
131 (GblBitView_string
)(self, buffer, index, count)
133#define GblBitView_uint64Default_(...)
134 GblBitView_uint64Default__
(__VA_ARGS__, 0
, (GBL_TUPLE_FIRST(__VA_ARGS__))->length)
135#define GblBitView_uint64Default__(self, index, count, ...)
136 (GblBitView_uint64
)(self, index, count)
138#define GblBitView_setStringDefault_(...)
139 GblBitView_setStringDefault__
(__VA_ARGS__, 0
, 0
)
140#define GblBitView_setStringDefault__(self, string, index, count, ...)
141 (GblBitView_fromString)(self, string, index, count)
143#define GblBitView_countDefault_(...)
144 GblBitView_countDefault__
(__VA_ARGS__, 0
, 0
)
145#define GblBitView_countDefault__(self, index, count, ...)
146 (GblBitView_count
)(self, index, count)
148#define GblBitView_anyDefault_(...)
149 GblBitView_anyDefault__
(__VA_ARGS__, 0
, 0
)
150#define GblBitView_anyDefault__(self, index, count, ...)
151 (GblBitView_any
)(self, index, count)
153#define GblBitView_allDefault_(...)
154 GblBitView_allDefault__
(__VA_ARGS__, 0
, 0
)
155#define GblBitView_allDefault__(self, index, count, ...)
156 (GblBitView_all
)(self, index, count)
158#define GblBitView_noneDefault_(...)
159 GblBitView_noneDefault__
(__VA_ARGS__, 0
, 0
)
160#define GblBitView_noneDefault__(self, index, count, ...)
161 (GblBitView_none
)(self, index, count)
163#define GblBitView_assignDefault_(...)
164 GblBitView_assignDefault__
(__VA_ARGS__, 0
, 0
)
165#define GblBitView_assignDefault__(self, value, index, count, ...)
166 (GblBitView_assign
)(self, value, index, count)
168#define GblBitView_setDefault_(...)
169 GblBitView_setDefault__
(__VA_ARGS__, 0
, 0
)
170#define GblBitView_setDefault__(self, index, count, ...)
171 (GblBitView_set
)(self, index, count)
173#define GblBitView_resetDefault_(...)
174 GblBitView_resetDefault__
(__VA_ARGS__, 0
, 0
)
175#define GblBitView_resetDefault__(self, index, count, ...)
176 (GblBitView_reset
)(self, index, count)
178#define GblBitView_flipDefault_(...)
179 GblBitView_filpDefault__(__VA_ARGS__, 0
, 0
)
180#define GblBitView_flipDefault__(self, index, count, ...)
181 (GblBitView_flip
)(self, index, count)
183#define GblBitView_rotateDefault_(...)
184 GblBitView_rotateDefault__
(__VA_ARGS__, 0
, 0
)
185#define GblBitView_rotateDefault__(self, offset, index, count, ...)
186 (GblBitView_rotate
)(self, offset, index, count)
#define GBL_FORWARD_DECLARE_STRUCT(S)
#define GBL_TUPLE_FIRST(...)
uint8_t GblBool
Basic boolean type, standardized to sizeof(char)
Mutable view to a field of bits within some block of memory.