changeset 348:75a59f58319e serializedQuery

New branch for serialized queries over SOAP
author mas01mc
date Mon, 27 Oct 2008 11:08:13 +0000
parents 0d02bcd74a40
children d1afecc71781
files audioDBws.h soap.cpp
diffstat 2 files changed, 21 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/audioDBws.h	Wed Oct 08 17:23:15 2008 +0000
+++ b/audioDBws.h	Mon Oct 27 11:08:13 2008 +0000
@@ -47,6 +47,11 @@
   unsigned int *Rlen;
 };
 
+struct adb__queryVector {
+  int __sizeQvector;
+  double *Qvector;
+};
+
 struct adb__lisztResponse {
   struct adb__lisztResult result;
 };
@@ -54,10 +59,14 @@
 // Print the status of an existing adb database
 int adb__status(xsd__string dbName, struct adb__statusResponse &adbStatusResponse);
 
-// Print the status of an existing adb database
+// List the contents of an audioDB database
 int adb__liszt(xsd__string dbName, xsd__int lisztOffset, xsd__int lisztLength, struct adb__lisztResponse &adbLisztResponse);
 
-// Query an existing adb database
+// Query an adb database
 int adb__query(xsd__string dbName, xsd__string qKey, xsd__string keyList, xsd__string timesFileName, xsd__string powerFileName, xsd__int qType, xsd__int qPos, xsd__int pointNN, xsd__int segNN, xsd__int segLen, xsd__double radius, xsd__double absolute_threshold, xsd__double relative_threshold, xsd__int exhaustive, xsd__int lsh_exact, struct adb__queryResponse &adbQueryResponse);
 
+// Query an adb database by key
 int adb__sequenceQueryByKey(xsd__string dbName,xsd__string trackKey, xsd__string featureFileName, xsd__int queryType,xsd__string trackFileName,xsd__string timesFileName,xsd__int queryPoint,xsd__int pointNN,xsd__int trackNN,xsd__int sequenceLength,xsd__double radius,xsd__double absolute_threshold,xsd__int usingQueryPoint,xsd__int lsh_exact,struct adb__queryResponse &adbQueryResponse);
+
+// Query an audioDB database by vector (serialized)
+int adb__shingleQuery(xsd__string dbName, struct adb__queryVector qVector, xsd__int queryType, xsd__int pointNN, xsd__int trackNN, xsd__int sequenceLength, xsd__double radius, xsd__double absolute_threshold, xsd__int lsh_exact, struct adb__queryResponse &adbQueryResponse);
--- a/soap.cpp	Wed Oct 08 17:23:15 2008 +0000
+++ b/soap.cpp	Mon Oct 27 11:08:13 2008 +0000
@@ -320,8 +320,6 @@
   DOUBLESTRINGIFY(absolute_threshold, absolute_thresholdStr);
   DOUBLESTRINGIFY(radius, radiusStr);
 
-  // WS queries only support 1-nearest neighbour point reporting
-  // at the moment, until we figure out how to better serve results
   snprintf(qtypeStr, 256, "nsequence");
   const char *argv[]={
     "./audioDB",
@@ -359,7 +357,16 @@
     return SOAP_FAULT;
   }
 }
-
+
+// Query an audioDB database by vector (serialized)
+int adb__shingleQuery(struct soap* soap, xsd__string dbName, struct adb__queryVector qVector, xsd__int queryType,xsd__int pointNN,xsd__int trackNN,xsd__int sequenceLength,xsd__double radius,xsd__double absolute_threshold,xsd__int lsh_exact,struct adb__queryResponse &adbQueryResponse){
+  cout << "qvector[" << qVector.__sizeQvector << "]: ";
+  for(int k=0; k < qVector.__sizeQvector ; k++)
+    cout << qVector.Qvector[k] << " ";
+  cout.flush();
+  return SOAP_OK;
+}
+
 /* Server loop */
 void audioDB::startServer(){
   struct soap soap;