Mercurial > hg > piper-cpp
diff vamp-capnp/VampnProto.h @ 95:b6ac26b72b59
Implement list, use request-response classes in loader
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Thu, 13 Oct 2016 14:31:10 +0100 |
parents | 6429a99abcad |
children | 427c4c725085 |
line wrap: on
line diff
--- a/vamp-capnp/VampnProto.h Thu Oct 13 14:10:55 2016 +0100 +++ b/vamp-capnp/VampnProto.h Thu Oct 13 14:31:10 2016 +0100 @@ -496,6 +496,19 @@ } static void + readListResponse(Vamp::HostExt::ListResponse &lr, + const ListResponse::Reader &r) { + + lr.available.clear(); + auto pp = r.getAvailable(); + for (const auto &p: pp) { + Vamp::HostExt::PluginStaticData psd; + readExtractorStaticData(psd, p); + lr.available.push_back(psd); + } + } + + static void buildLoadRequest(LoadRequest::Builder &r, const Vamp::HostExt::LoadRequest &req) { @@ -902,13 +915,7 @@ if (getRequestResponseType(r) != RRType::List) { throw std::logic_error("not a list response"); } - resp.available.clear(); - auto pp = r.getResponse().getList().getAvailable(); - for (const auto &p: pp) { - Vamp::HostExt::PluginStaticData psd; - readExtractorStaticData(psd, p); - resp.available.push_back(psd); - } + readListResponse(resp, r.getResponse().getList()); } static void