diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorClient.h b/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorClient.h index a6f5c3d24..28f9da73f 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorClient.h +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorClient.h @@ -1,3 +1,4 @@ +#pragma once #include #include @@ -9,7 +10,7 @@ #include #include -int dummyCallback(detectorData *d, int p, void *) { +inline int dummyCallback(detectorData *d, int p, void *) { std::cout << "got data " << p << std::endl; return 0; }; @@ -17,8 +18,6 @@ int dummyCallback(detectorData *d, int p, void *) { class multiSlsDetectorClient { public: multiSlsDetectorClient(int argc, char *argv[], int action, multiSlsDetector *myDetector = nullptr) { - std::string answer; - int id = -1, pos = -1, iv = 0; bool verify = true, update = true; char cmd[100] = ""; @@ -71,9 +70,11 @@ class multiSlsDetectorClient { if (iv != 2) { pos = -1; } // remove the %d- and %d: - if (!strlen(cmd)) { + if (strlen(cmd) == 0u) { strcpy(cmd, argv[0]); - } // special commands + } + + // special commands std::string scmd = cmd; // free without calling multiSlsDetector constructor if (scmd == "free") { multiSlsDetector::freeSharedMemory(id, pos); @@ -106,11 +107,11 @@ class multiSlsDetectorClient { // call multi detector command line multiSlsDetectorCommand myCmd(myDetector); - answer = myCmd.executeLine(argc, argv, action, pos); + std::string answer = myCmd.executeLine(argc, argv, action, pos); if (action != slsDetectorDefs::READOUT_ACTION) { std::cout << argv[0] << " "; } std::cout << answer << std::endl; - }; + } }; diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorCommand.h b/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorCommand.h index 7e95d2728..435aeb217 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorCommand.h +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetectorCommand.h @@ -15,11 +15,7 @@ class multiSlsDetectorCommand : public slsDetectorCommand { public: - - - multiSlsDetectorCommand(multiSlsDetector *det) : slsDetectorCommand(det) {myDet=det;}; - - + explicit multiSlsDetectorCommand(multiSlsDetector *det) : slsDetectorCommand(det) {myDet=det;}; /* /\** */ /* executes a set of string arguments according to a given format. It is used to read/write configuration file, dump and retrieve detector settings and for the command line interface command parsing */ /* \param narg number of arguments */ @@ -28,10 +24,8 @@ public: /* \returns answer string */ /* *\/ */ - std::string executeLine(int narg, char *args[], int action, int id=-1) { \ - std::string s; \ - s=slsDetectorCommand::executeLine(narg,args,action, id); \ - return s; + std::string executeLine(int narg, char *args[], int action, int id=-1) override { + return slsDetectorCommand::executeLine(narg,args,action, id); }; /** @@ -48,11 +42,7 @@ public: }; private: - - multiSlsDetector *myDet; - - };