Command proxy (#25)

* added cmd proxy

* minor

* minor

* WIP

* clean up

* added comment
This commit is contained in:
Erik Fröjdh
2019-05-28 18:01:26 +02:00
committed by Dhanya Thattil
parent 85d4dfc7c8
commit 788ad8d3b6
4 changed files with 114 additions and 3 deletions

View File

@ -3,6 +3,7 @@
#include <string>
#include "CmdLineParser.h"
#include "CmdProxy.h"
#include "container_utils.h"
#include "string_utils.h"
#include "multiSlsDetector.h"
@ -88,6 +89,18 @@ class multiSlsDetectorClient {
return;
}
//Call CmdProxy which execute the command if it exists, on success returns an empty string
//If the command is not in CmdProxy but deprecated the new command is returned
sls::CmdProxy<multiSlsDetector> proxy(detPtr);
auto cmd = proxy.Call(parser.command(), parser.arguments(), parser.detector_id());
if (cmd.empty())
return;
else
parser.setCommand(cmd);
// call multi detector command line
slsDetectorCommand myCmd(detPtr);
std::string answer = myCmd.executeLine(parser.n_arguments()+1, parser.argv().data(), action_, parser.detector_id());