From 01f05feb16c5f2e3c02d896fe4f1d4858eca19cc Mon Sep 17 00:00:00 2001 From: Alex Harker Date: Sun, 17 Mar 2019 17:21:09 +0000 Subject: [PATCH] Move checkParameters() to the right place --- include/FluidSCWrapper.hpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/include/FluidSCWrapper.hpp b/include/FluidSCWrapper.hpp index 281c253..5df9d3d 100644 --- a/include/FluidSCWrapper.hpp +++ b/include/FluidSCWrapper.hpp @@ -286,19 +286,16 @@ public: Wrapper *w = new Wrapper( world, args); // this has to be on the heap, because it doesn't get destroyed until the async command is done - int argsPosition = args->count; - auto argsRdPos = args->rdpos; - Result result = validateParameters(w, world, args); + Wrapper::setParams(w->mParams, false, world, args); + + Result result = validateParameters(w); if (!result.ok()) { - std::cout << "ERROR: " << Wrapper::getName() << ": " << result.message().c_str() << std::endl; - delete w; - return; + std::cout << "ERROR: " << Wrapper::getName() << ": " << result.message().c_str() << std::endl; + delete w; + return; } - args->count = argsPosition; - args->rdpos = argsRdPos; - Wrapper::setParams(w->mParams, false, world, args); - + size_t msgSize = args->getbsize(); std::vector completionMessage(msgSize); // char * completionMsgData = 0; @@ -318,9 +315,10 @@ protected: Client mClient; private: - static Result validateParameters(NonRealTime *w, World *world, sc_msg_iter *args) + + static Result validateParameters(NonRealTime *w) { - auto results = w->mParams.template checkParameterValues();//(world, args); + auto results = w->mParams.template checkParameterValues(); for (auto &r : results) { if (!r.ok()) return r;