Move checkParameters() to the right place

nix
Alex Harker 7 years ago
parent 09a049f38f
commit 01f05feb16

@ -286,19 +286,16 @@ public:
Wrapper *w = new Wrapper( 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 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; Wrapper::setParams(w->mParams, false, world, args);
auto argsRdPos = args->rdpos;
Result result = validateParameters(w, world, args); Result result = validateParameters(w);
if (!result.ok()) if (!result.ok())
{ {
std::cout << "ERROR: " << Wrapper::getName() << ": " << result.message().c_str() << std::endl; std::cout << "ERROR: " << Wrapper::getName() << ": " << result.message().c_str() << std::endl;
delete w; delete w;
return; return;
} }
args->count = argsPosition;
args->rdpos = argsRdPos;
Wrapper::setParams(w->mParams, false, world, args);
size_t msgSize = args->getbsize(); size_t msgSize = args->getbsize();
std::vector<char> completionMessage(msgSize); std::vector<char> completionMessage(msgSize);
// char * completionMsgData = 0; // char * completionMsgData = 0;
@ -318,9 +315,10 @@ protected:
Client mClient; Client mClient;
private: private:
static Result validateParameters(NonRealTime *w, World *world, sc_msg_iter *args)
static Result validateParameters(NonRealTime *w)
{ {
auto results = w->mParams.template checkParameterValues();//<ArgumentGetter>(world, args); auto results = w->mParams.template checkParameterValues();
for (auto &r : results) for (auto &r : results)
{ {
if (!r.ok()) return r; if (!r.ok()) return r;

Loading…
Cancel
Save