diff --git a/slsDetectorSoftware/include/slsDetector.h b/slsDetectorSoftware/include/slsDetector.h index 7dcc0cd87..99de817d6 100755 --- a/slsDetectorSoftware/include/slsDetector.h +++ b/slsDetectorSoftware/include/slsDetector.h @@ -6,7 +6,7 @@ #include "sls_detector_defs.h" #include "network_utils.h" #include "FixedCapacityContainer.h" -class ClientInterface; + #include #include diff --git a/slsDetectorSoftware/src/slsDetector.cpp b/slsDetectorSoftware/src/slsDetector.cpp index c3eb439a2..1e4f62fb0 100755 --- a/slsDetectorSoftware/src/slsDetector.cpp +++ b/slsDetectorSoftware/src/slsDetector.cpp @@ -1,5 +1,4 @@ #include "slsDetector.h" -#include "ClientInterface.h" #include "ClientSocket.h" #include "ServerInterface.h" #include "SharedMemory.h" diff --git a/slsSupportLib/CMakeLists.txt b/slsSupportLib/CMakeLists.txt index 7616de574..f9a0134ac 100755 --- a/slsSupportLib/CMakeLists.txt +++ b/slsSupportLib/CMakeLists.txt @@ -1,5 +1,4 @@ set(SOURCES - src/ClientInterface.cpp src/CmdLineParser.cpp src/string_utils.cpp src/file_utils.cpp @@ -22,7 +21,6 @@ set(PUBLICHEADERS include/file_utils.h include/container_utils.h include/string_utils.h - include/ClientInterface.h include/MySocketTCP.h include/genericSocket.h include/logger.h diff --git a/slsSupportLib/include/ClientInterface.h b/slsSupportLib/include/ClientInterface.h deleted file mode 100755 index 19f3cd5e3..000000000 --- a/slsSupportLib/include/ClientInterface.h +++ /dev/null @@ -1,70 +0,0 @@ -#pragma once - - -#include "sls_detector_defs.h" -#include "ClientSocket.h" - - -/** - * @short the ClientInterface class is the interface between the client and the server - */ -// Do not overload to make it easier for manual comparison between client and server functions - -class ClientInterface: public virtual slsDetectorDefs{ - -public: - - /** - * (default) constructor - * @param socket tcp socket between client and receiver - * @param n for debugging purposes (useful only for client side) - * @param t string to identify type (Detector, Receiver) for printouts (useful only for client side) - */ - ClientInterface(sls::ClientSocket* socket, int n); - - /** - * destructor - */ - virtual ~ClientInterface() = default; - - void SetSocket(sls::ClientSocket *socket){ - socket_ = socket; - } - - /** - * Receive ret, mess or retval from Server - * @param ret result of operation - * @param mess pointer to message - * @param retval pointer to retval - * @param sizeOfRetval size of retval - */ - void Client_Receive(int& ret, char* mess, void* retval, int sizeOfRetval); - - /** - * Send Arguments to server and receives result back - * @param fnum function enum to determine what parameter - * @param args pointer to arguments - * @param sizeOfArgs argument size - * @param retval pointer to return value - * @param sizeOfRetval return value size - * @param mess pointer to message if message required externally - * @returns success of operation - */ - int Client_Send(int fnum, - void* args, int sizeOfArgs, - void* retval, int sizeOfRetval, - char* mess = 0); - - - - -private: - - /** - * socket for data acquisition - */ - sls::ClientSocket* socket_; - -}; - - diff --git a/slsSupportLib/src/ClientInterface.cpp b/slsSupportLib/src/ClientInterface.cpp deleted file mode 100755 index 2d5a3c2fb..000000000 --- a/slsSupportLib/src/ClientInterface.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "ClientInterface.h" -#include "ClientSocket.h" -#include - -ClientInterface::ClientInterface(sls::ClientSocket *socket, int n) : socket_(socket){} - -void ClientInterface::Client_Receive(int &ret, char *mess, void *retval, int sizeOfRetval) { - // get result of operation - socket_->receiveData(reinterpret_cast(&ret), sizeof(ret)); - - bool unrecognizedFunction = false; - if (ret == FAIL) { - bool created = false; - // allocate mess if null - if (!mess) { - created = true; - mess = new char[MAX_STR_LENGTH]; - memset(mess, 0, MAX_STR_LENGTH); - } - // get error message - socket_->receiveData(mess, MAX_STR_LENGTH); - // cprintf(RED, "%s %d returned error: %s", type.c_str(), index, mess); - - // unrecognized function, do not ask for retval - if (strstr(mess, "Unrecognized Function") != nullptr) - unrecognizedFunction = true; - // delete allocated mess - if (created) - delete[] mess; - } - // get retval - if (!unrecognizedFunction) - socket_->receiveData(reinterpret_cast(retval), sizeOfRetval); -} - -int ClientInterface::Client_Send(int fnum, void *args, int sizeOfArgs, void *retval, - int sizeOfRetval, char *mess) { - int ret = FAIL; - socket_->sendData(reinterpret_cast(&fnum), sizeof(fnum)); - socket_->sendData(reinterpret_cast(args), sizeOfArgs); - Client_Receive(ret, mess, retval, sizeOfRetval); - return ret; -} \ No newline at end of file diff --git a/slsSupportLib/tests/CMakeLists.txt b/slsSupportLib/tests/CMakeLists.txt index e1a7e7d77..c40c80581 100755 --- a/slsSupportLib/tests/CMakeLists.txt +++ b/slsSupportLib/tests/CMakeLists.txt @@ -1,5 +1,4 @@ target_sources(tests PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/test-ClientInterface.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test-CmdLineParser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test-container_utils.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test-network_utils.cpp diff --git a/slsSupportLib/tests/test-ClientInterface.cpp b/slsSupportLib/tests/test-ClientInterface.cpp deleted file mode 100755 index 831ca51e8..000000000 --- a/slsSupportLib/tests/test-ClientInterface.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "ClientInterface.h" -#include "catch.hpp" - -//tests to add -//help for all docs -//command for all depreciated commands - -TEST_CASE("hopp") { - REQUIRE(true); - -} \ No newline at end of file