Mercurial > hg > audiodb
comparison soap.cpp @ 548:e18843dc0aea
Implement a rudimentary API for audioDB::liszt
The API is rudimentary because we've dropped support for the incremental
retrieval of tracks and their number of vectors (at the API level; the
SOAP and command-line support is still there -- no changes should be
visible). This is potentially bad for the large-scale databases, of
course; one million tracks will take of the order of 16MB of RAM, more
if I'm unlucky about how std::string.c_str() is implemented.
Both this liszt operation and querying (and sampling, forthcoming...)
would benefit from a `cursor-like' interface to retrieval results: for
an API like that, instead of getting a struct with the data there, you
get a cookie with which you can ask the database for successive results.
This would be neat for all sorts of reasons. In the meantime, at least
this change fixes SOAP memory leaks related to liszt.
Make liszt.o part of LIBOBJS rather than ordinary OBJS, so that the
liszt functionality is actually compiled into the library.
Add a test for this library functionality; also modify the command-line
test file to run the SOAP server on its own port.
author | mas01cr |
---|---|
date | Wed, 11 Feb 2009 12:38:03 +0000 |
parents | cc2b97d020b1 |
children | d5ada9532a40 |
comparison
equal
deleted
inserted
replaced
547:5a248cedd3e9 | 548:e18843dc0aea |
---|---|
162 INTSTRINGIFY(lisztLength, lisztLengthStr); | 162 INTSTRINGIFY(lisztLength, lisztLengthStr); |
163 | 163 |
164 const char *argv[] = {"./audioDB", COM_LISZT, "-d",dbName, "--lisztOffset", lisztOffsetStr, "--lisztLength", lisztLengthStr}; | 164 const char *argv[] = {"./audioDB", COM_LISZT, "-d",dbName, "--lisztOffset", lisztOffsetStr, "--lisztLength", lisztLengthStr}; |
165 const unsigned argc = 8; | 165 const unsigned argc = 8; |
166 try{ | 166 try{ |
167 audioDB(argc, argv, &adbLisztResponse); | 167 audioDB(argc, argv, soap, &adbLisztResponse); |
168 return SOAP_OK; | 168 return SOAP_OK; |
169 } catch(char *err) { | 169 } catch(char *err) { |
170 soap_receiver_fault(soap, err, ""); | 170 soap_receiver_fault(soap, err, ""); |
171 return SOAP_FAULT; | 171 return SOAP_FAULT; |
172 } | 172 } |