| 351 | } |
| 352 | |
| 353 | void ReadFrameRows(sqlite3_stmt* sql_stmt, |
| 354 | const std::function<void(Frame)>& new_frame_callback) { |
| 355 | Frame frame; |
| 356 | while (SQLITE3_CALL(sqlite3_step(sql_stmt)) == SQLITE_ROW) { |
| 357 | const frame_t frame_id = |
| 358 | static_cast<rig_t>(sqlite3_column_int64(sql_stmt, 0)); |
| 359 | if (frame_id != frame.FrameId()) { |
| 360 | if (frame.FrameId() != kInvalidFrameId) { |
| 361 | new_frame_callback(std::move(frame)); |
| 362 | } |
| 363 | frame = Frame(); |
| 364 | frame.SetFrameId(frame_id); |
| 365 | frame.SetRigId(static_cast<rig_t>(sqlite3_column_int64(sql_stmt, 1))); |
| 366 | } |
| 367 | |
| 368 | if (sqlite3_column_type(sql_stmt, 2) == SQLITE_NULL) { |
| 369 | // No data for frame. |
| 370 | continue; |
| 371 | } |
| 372 | |
| 373 | data_t data_id; |
| 374 | data_id.id = static_cast<uint32_t>(sqlite3_column_int64(sql_stmt, 2)); |
| 375 | data_id.sensor_id.id = |
| 376 | static_cast<uint32_t>(sqlite3_column_int64(sql_stmt, 3)); |
| 377 | data_id.sensor_id.type = |
| 378 | static_cast<SensorType>(sqlite3_column_int64(sql_stmt, 4)); |
| 379 | frame.AddDataId(data_id); |
| 380 | } |
| 381 | |
| 382 | if (frame.FrameId() != kInvalidFrameId) { |
| 383 | new_frame_callback(std::move(frame)); |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | Image ReadImageRow(sqlite3_stmt* sql_stmt) { |
| 388 | Image image; |
no test coverage detected