@@ -5,14 +5,20 @@ classes:
5
5
subpackage : log
6
6
attributes :
7
7
entry :
8
+ access : readonly
8
9
name :
10
+ access : readonly
9
11
type :
12
+ access : readonly
10
13
metadata :
14
+ access : readonly
11
15
MetadataRecordData :
12
16
subpackage : log
13
17
attributes :
14
18
entry :
19
+ access : readonly
15
20
metadata :
21
+ access : readonly
16
22
DataLogRecord :
17
23
subpackage : log
18
24
methods :
@@ -21,63 +27,243 @@ classes:
21
27
" " :
22
28
ignore : true
23
29
int, int64_t, wpi::span<const uint8_t> :
30
+ ignore : true
24
31
GetEntry :
25
32
GetTimestamp :
26
33
GetSize :
27
34
GetRaw :
35
+ no_release_gil : true
36
+ cpp_code : |
37
+ [](const DataLogRecord *self) {
38
+ auto data = self->GetRaw();
39
+ return py::bytes((char*)data.data(), data.size());
40
+ }
28
41
IsControl :
29
42
IsStart :
30
43
IsFinish :
31
44
IsSetMetadata :
32
45
GetStartData :
46
+ no_release_gil : true
33
47
param_override :
34
48
out :
35
- force_out : true
36
- default :
49
+ ignore : true
50
+ doc : |
51
+ Decodes a start control record. Raises TypeError on error.
52
+ cpp_code : |
53
+ [](const DataLogRecord *self) {
54
+ auto ptr = std::make_unique<wpi::log::StartRecordData>();
55
+ if (!self->GetStartData(ptr.get())) {
56
+ throw py::type_error("not a start record");
57
+ }
58
+ return std::move(ptr);
59
+ }
60
+ return_value_policy : reference_internal
37
61
GetFinishEntry :
62
+ no_release_gil : true
38
63
param_override :
39
64
out :
40
- force_out : true
41
- default :
65
+ ignore : true
66
+ doc : |
67
+ Decodes a finish control record. Raises TypeError on error.
68
+ cpp_code : |
69
+ [](const DataLogRecord *self) {
70
+ int value;
71
+ if (!self->GetFinishEntry(&value)) {
72
+ throw py::type_error("not a finish entry");
73
+ }
74
+ return value;
75
+ }
42
76
GetSetMetadataData :
77
+ no_release_gil : true
43
78
param_override :
44
79
out :
45
- force_out : true
46
- default :
80
+ ignore : true
81
+ doc : |
82
+ Decodes a set metadata control record. Raises TypeError on error.
83
+ cpp_code : |
84
+ [](const DataLogRecord *self) {
85
+ auto ptr = std::make_unique<wpi::log::MetadataRecordData>();
86
+ if (!self->GetSetMetadataData(ptr.get())) {
87
+ throw py::type_error("not a metadata control record");
88
+ }
89
+ return std::move(ptr);
90
+ }
91
+ return_value_policy : reference_internal
47
92
GetBoolean :
93
+ no_release_gil : true
94
+ param_override :
95
+ value :
96
+ ignore : true
97
+ doc : |
98
+ Decodes a data record as a boolean. Note if the data type (as indicated in
99
+ the corresponding start control record for this entry) is not "boolean",
100
+ invalid results may be returned or TypeError will be raised.
101
+ cpp_code : |
102
+ [](const DataLogRecord *self) {
103
+ bool value;
104
+ if (!self->GetBoolean(&value)) {
105
+ throw py::type_error("not a boolean");
106
+ }
107
+ return value;
108
+ }
48
109
GetInteger :
110
+ no_release_gil : true
111
+ param_override :
112
+ value :
113
+ ignore : true
114
+ doc : |
115
+ Decodes a data record as an integer. Note if the data type (as indicated in
116
+ the corresponding start control record for this entry) is not "int64",
117
+ invalid results may be returned or TypeError will be raised.
118
+ cpp_code : |
119
+ [](const DataLogRecord *self) {
120
+ int64_t value;
121
+ if (!self->GetInteger(&value)) {
122
+ throw py::type_error("not an integer");
123
+ }
124
+ return value;
125
+ }
49
126
GetFloat :
127
+ no_release_gil : true
128
+ param_override :
129
+ value :
130
+ ignore : true
131
+ doc : |
132
+ Decodes a data record as a float. Note if the data type (as indicated in
133
+ the corresponding start control record for this entry) is not "float",
134
+ invalid results may be returned or TypeError will be raised.
135
+ cpp_code : |
136
+ [](const DataLogRecord *self) {
137
+ float value;
138
+ if (!self->GetFloat(&value)) {
139
+ throw py::type_error("not a float");
140
+ }
141
+ return value;
142
+ }
50
143
GetDouble :
144
+ no_release_gil : true
145
+ param_override :
146
+ value :
147
+ ignore : true
148
+ doc : |
149
+ Decodes a data record as a double. Note if the data type (as indicated in
150
+ the corresponding start control record for this entry) is not "double",
151
+ invalid results may be returned or TypeError will be raised.
152
+ cpp_code : |
153
+ [](const DataLogRecord *self) {
154
+ double value;
155
+ if (!self->GetDouble(&value)) {
156
+ throw py::type_error("not a double");
157
+ }
158
+ return value;
159
+ }
51
160
GetString :
161
+ no_release_gil : true
52
162
param_override :
53
163
value :
54
- force_out : true
55
- default :
164
+ ignore : true
165
+ doc : |
166
+ Decodes a data record as a string. Note if the data type (as indicated in
167
+ the corresponding start control record for this entry) is not "string",
168
+ invalid results may be returned or TypeError will be raised.
169
+ cpp_code : |
170
+ [](const DataLogRecord *self) {
171
+ std::string_view value;
172
+ if (!self->GetString(&value)) {
173
+ throw py::type_error("not a string");
174
+ }
175
+ return value;
176
+ }
56
177
GetBooleanArray :
178
+ no_release_gil : true
57
179
param_override :
58
180
arr :
59
- force_out : true
60
- default :
181
+ ignore : true
182
+ doc : |
183
+ Decodes a data record as a boolean array. Note if the data type (as
184
+ indicated in the corresponding start control record for this entry) is not
185
+ "boolean[]", invalid results may be returned or a TypeError may be raised.
186
+ cpp_code : |
187
+ [](const DataLogRecord *self) {
188
+ std::vector<int> arr;
189
+ if (!self->GetBooleanArray(&arr)) {
190
+ throw py::type_error("not a boolean array");
191
+ }
192
+ py::list l(arr.size());
193
+ for (size_t i = 0; i < arr.size(); i++) {
194
+ auto b = py::bool_(arr[i]);
195
+ PyList_SET_ITEM(l.ptr(), i, b.release().ptr());
196
+ }
197
+ return std::move(l);
198
+ }
61
199
GetIntegerArray :
200
+ no_release_gil : true
62
201
param_override :
63
202
arr :
64
- force_out : true
65
- default :
203
+ ignore : true
204
+ doc : |
205
+ Decodes a data record as an integer array. Note if the data type (as
206
+ indicated in the corresponding start control record for this entry) is not
207
+ "int64[]", invalid results may be returned or a TypeError may be raised.
208
+ cpp_code : |
209
+ [](const DataLogRecord *self) {
210
+ std::vector<int64_t> arr;
211
+ if (!self->GetIntegerArray(&arr)) {
212
+ throw py::type_error("not an integer array");
213
+ }
214
+ return std::move(arr);
215
+ }
66
216
GetFloatArray :
217
+ no_release_gil : true
67
218
param_override :
68
219
arr :
69
- force_out : true
70
- default :
220
+ ignore : true
221
+ doc : |
222
+ Decodes a data record as a float array. Note if the data type (as
223
+ indicated in the corresponding start control record for this entry) is not
224
+ "float[]", invalid results may be returned or a TypeError may be raised.
225
+ cpp_code : |
226
+ [](const DataLogRecord *self) {
227
+ std::vector<float> arr;
228
+ if (!self->GetFloatArray(&arr)) {
229
+ throw py::type_error("not a float array");
230
+ }
231
+ return std::move(arr);
232
+ }
71
233
GetDoubleArray :
234
+ no_release_gil : true
72
235
param_override :
73
236
arr :
74
- force_out : true
75
- default :
237
+ ignore : true
238
+ doc : |
239
+ Decodes a data record as a double array. Note if the data type (as
240
+ indicated in the corresponding start control record for this entry) is not
241
+ "double[]", invalid results may be returned or a TypeError may be raised.
242
+ cpp_code : |
243
+ [](const DataLogRecord *self) {
244
+ std::vector<double> arr;
245
+ if (!self->GetDoubleArray(&arr)) {
246
+ throw py::type_error("not a double array");
247
+ }
248
+ return std::move(arr);
249
+ }
76
250
GetStringArray :
251
+ no_release_gil : true
77
252
param_override :
78
253
arr :
79
- force_out : true
80
- default :
254
+ ignore : true
255
+ doc : |
256
+ Decodes a data record as a string array. Note if the data type (as
257
+ indicated in the corresponding start control record for this entry) is not
258
+ "string[]", invalid results may be returned or a TypeError may be raised.
259
+ cpp_code : |
260
+ [](const DataLogRecord *self) {
261
+ std::vector<std::string_view> arr;
262
+ if (!self->GetStringArray(&arr)) {
263
+ throw py::type_error("not a string array");
264
+ }
265
+ return std::move(arr);
266
+ }
81
267
DataLogIterator :
82
268
ignore : true
83
269
DataLogReader :
@@ -151,4 +337,3 @@ inline_code: |
151
337
.def("__iter__", [](wpi::log::DataLogReader * that) {
152
338
return py::make_iterator(that->begin(), that->end());
153
339
}, py::keep_alive<0,1>());
154
-
0 commit comments