diff vamp-server/convert.cpp @ 97:427c4c725085

Bring in the Request/Response classes that were in the Vamp SDK, adding them to vamp-support in here instead
author Chris Cannam <c.cannam@qmul.ac.uk>
date Thu, 13 Oct 2016 18:05:35 +0100
parents c897c9a8daf1
children d15cb1151d76
line wrap: on
line diff
--- a/vamp-server/convert.cpp	Thu Oct 13 17:00:06 2016 +0100
+++ b/vamp-server/convert.cpp	Thu Oct 13 18:05:35 2016 +0100
@@ -12,7 +12,7 @@
 
 using namespace std;
 using namespace json11;
-using namespace piper;
+using namespace piper_vamp;
 
 void usage()
 {
@@ -117,13 +117,13 @@
     int number;
     string tag;
     switch (r.getId().which()) {
-    case RpcRequest::Id::Which::NUMBER:
+    case piper::RpcRequest::Id::Which::NUMBER:
         number = r.getId().getNumber();
         return { RequestOrResponse::RpcId::Number, number, "" };
-    case RpcRequest::Id::Which::TAG:
+    case piper::RpcRequest::Id::Which::TAG:
         tag = r.getId().getTag();
         return { RequestOrResponse::RpcId::Tag, 0, tag };
-    case RpcRequest::Id::Which::NONE:
+    case piper::RpcRequest::Id::Which::NONE:
         return { RequestOrResponse::RpcId::Absent, 0, "" };
     }
     return {};
@@ -334,8 +334,8 @@
     RequestOrResponse rr;
     rr.direction = RequestOrResponse::Request;
 
-    ::capnp::InputStreamMessageReader message(buffered);
-    RpcRequest::Reader reader = message.getRoot<RpcRequest>();
+    capnp::InputStreamMessageReader message(buffered);
+    piper::RpcRequest::Reader reader = message.getRoot<piper::RpcRequest>();
     
     rr.type = VampnProto::getRequestResponseType(reader);
     rr.id = readCapnpId(reader);
@@ -368,8 +368,8 @@
 void
 writeRequestCapnp(RequestOrResponse &rr)
 {
-    ::capnp::MallocMessageBuilder message;
-    RpcRequest::Builder builder = message.initRoot<RpcRequest>();
+    capnp::MallocMessageBuilder message;
+    piper::RpcRequest::Builder builder = message.initRoot<piper::RpcRequest>();
 
     buildCapnpId(builder, rr.id);
     
@@ -404,8 +404,8 @@
     RequestOrResponse rr;
     rr.direction = RequestOrResponse::Response;
 
-    ::capnp::InputStreamMessageReader message(buffered);
-    RpcResponse::Reader reader = message.getRoot<RpcResponse>();
+    capnp::InputStreamMessageReader message(buffered);
+    piper::RpcResponse::Reader reader = message.getRoot<piper::RpcResponse>();
     
     rr.type = VampnProto::getRequestResponseType(reader);
     rr.success = true;
@@ -444,8 +444,8 @@
 void
 writeResponseCapnp(RequestOrResponse &rr)
 {
-    ::capnp::MallocMessageBuilder message;
-    RpcResponse::Builder builder = message.initRoot<RpcResponse>();
+    capnp::MallocMessageBuilder message;
+    piper::RpcResponse::Builder builder = message.initRoot<piper::RpcResponse>();
 
     buildCapnpId(builder, rr.id);