annotate close.cpp @ 453:16a903968d18 api-inversion

Almost finish with audioDB::query_loop. This patch is a little bit noisy, because we rename adb->keys to adb->keymap, introduce a new vector adb->keys (essentially to replace fileTable), and introduce new functionality (both include and exclude keylists in adb_query_refine_t) as well as modifying the query_loop function itself to take advantage of all of these goodies. Oh, and we also fix an embarrassing state bug in adb->track_offsets for insert -- what was I thinking? (Thank you, regression test suites). Since we are on a private branch at the moment, we can take the luxury of renumbering the ADB_REFINE_ flags to include the exclude list at the logical place; once we have an ABI to support, that won't be possible. Now audioDB::query builds up include and exclude lists as appropriate; query_loop does an [O(NlogN) probably] buildup of the keys to consider, and then iterates over tracks sequentially, seeking only if one or more tracks have been excluded. No more trackFile, yay! The only remaining thing to deal with is the accumulator. It's easy enough to pass it around, but I want to read the indexed version before doing so to see how that all fits together.
author mas01cr
date Wed, 24 Dec 2008 10:57:14 +0000
parents 16c5c51a4c32
children 1030664df98c
rev   line source
mas01cr@392 1 #include "audioDB.h"
mas01cr@392 2 extern "C" {
mas01cr@392 3 #include "audioDB_API.h"
mas01cr@402 4 #include "audioDB-internals.h"
mas01cr@392 5 }
mas01cr@392 6
mas01cr@392 7 void audiodb_close(adb_t *adb) {
mas01cr@392 8 free(adb->path);
mas01cr@392 9 free(adb->header);
mas01cr@402 10 delete adb->keys;
mas01cr@453 11 delete adb->keymap;
mas01cr@432 12 delete adb->track_lengths;
mas01cr@442 13 delete adb->track_offsets;
mas01cr@392 14 close(adb->fd);
mas01cr@392 15 free(adb);
mas01cr@392 16 }