| 900 | } |
| 901 | |
| 902 | std::vector<std::pair<image_pair_t, FeatureMatches>> ReadAllMatches() |
| 903 | const override { |
| 904 | Sqlite3StmtContext context(sql_stmt_read_matches_all_); |
| 905 | |
| 906 | std::vector<std::pair<image_pair_t, FeatureMatches>> all_matches; |
| 907 | |
| 908 | int rc; |
| 909 | while ((rc = SQLITE3_CALL(sqlite3_step(sql_stmt_read_matches_all_))) == |
| 910 | SQLITE_ROW) { |
| 911 | const image_pair_t pair_id = static_cast<image_pair_t>( |
| 912 | sqlite3_column_int64(sql_stmt_read_matches_all_, 0)); |
| 913 | const FeatureMatchesBlob blob = ReadDynamicMatrixBlob<FeatureMatchesBlob>( |
| 914 | sql_stmt_read_matches_all_, rc, 1); |
| 915 | all_matches.emplace_back(pair_id, FeatureMatchesFromBlob(blob)); |
| 916 | } |
| 917 | |
| 918 | return all_matches; |
| 919 | } |
| 920 | |
| 921 | std::vector<std::pair<image_pair_t, int>> ReadNumMatches() const override { |
| 922 | Sqlite3StmtContext context(sql_stmt_read_num_matches_); |