diff --git a/Modules/CppRestSdk/files.cmake b/Modules/CppRestSdk/files.cmake index 77a843d01a..04ce6da514 100644 --- a/Modules/CppRestSdk/files.cmake +++ b/Modules/CppRestSdk/files.cmake @@ -1,12 +1,11 @@ file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*") set(CPP_FILES mitkRESTClientMicroService.cpp mitkRESTServerMicroService.cpp mitkCppRestSdkActivator.cpp mitkIRESTManager.cpp mitkRESTManager.cpp mitkIRESTObserver.cpp mitkCppRestSdk.cpp - mitkIRESTServerMicroService.cpp ) \ No newline at end of file diff --git a/Modules/CppRestSdk/include/mitkIRESTManager.h b/Modules/CppRestSdk/include/mitkIRESTManager.h index ab2171b378..a238e2720b 100644 --- a/Modules/CppRestSdk/include/mitkIRESTManager.h +++ b/Modules/CppRestSdk/include/mitkIRESTManager.h @@ -1,95 +1,95 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkIRESTManager_h #define mitkIRESTManager_h #include "cpprest/json.h" #include "cpprest/uri.h" #include #include #include #include #include namespace mitk { - class IRESTServerMicroService; + class RESTServerMicroService; class MITKCPPRESTSDK_EXPORT IRESTManager { public: virtual ~IRESTManager(); /** * @brief request type for client requests by calling SendRequest */ enum RequestType { get, post, put }; /** * @brief Executes a HTTP request in the mitkRESTClientMicroService class * * @param uri defines the URI the request is send to * @param type the RequestType of the HTTP request (optional) * @param body the body for the request (optional) * @return task to wait for */ virtual pplx::task SendRequest(const web::uri &uri, const RequestType &type = get, const web::json::value &body = NULL, const utility::string_t &filePath = L"") = 0; /** * @brief starts listening for requests if there isn't another observer listening and the port is free * * @param uri defines the URI for which incoming requests should be send to the observer * @param observer the observer which handles the incoming requests */ virtual void ReceiveRequest(const web::uri &uri, IRESTObserver *observer) = 0; /** * @brief Handles incoming requests by notifying the observer which should receive it * * @param uri defines the URI of the request * @param body the body of the request * @return the data which is modified by the notified observer */ virtual web::json::value Handle(const web::uri &uri, web::json::value &body) = 0; /** * @brief Handles the deletion of an observer for all or a specific uri * * @param observer the observer which shouldn't receive requests anymore * @param uri the uri for which the observer doesn't handle requests anymore (optional) */ virtual void HandleDeleteObserver(IRESTObserver *observer, const web::uri &uri = L"") = 0; - virtual std::map GetM_ServerMap() = 0; + virtual std::map GetM_ServerMap() = 0; virtual std::map, IRESTObserver *> GetM_Observers() = 0; }; } // namespace mitk MITK_DECLARE_SERVICE_INTERFACE(mitk::IRESTManager, "org.mitk.IRESTManager") #endif diff --git a/Modules/CppRestSdk/include/mitkIRESTServerMicroService.h b/Modules/CppRestSdk/include/mitkIRESTServerMicroService.h deleted file mode 100644 index 3117e707cb..0000000000 --- a/Modules/CppRestSdk/include/mitkIRESTServerMicroService.h +++ /dev/null @@ -1,85 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#ifndef mitkIRESTServerMicroService_h -#define mitkIRESTServerMicroService_h - -#include "cpprest/http_listener.h" - - -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4251) -#endif - -typedef web::http::experimental::listener::http_listener MitkListener; -typedef web::http::http_request MitkRequest; -typedef web::http::http_response MitkResponse; -typedef web::http::methods MitkRESTMethods; -typedef web::http::status_codes MitkRestStatusCodes; -typedef web::json::json_exception MitkJsonException; - -namespace mitk -{ - class MITKCPPRESTSDK_EXPORT IRESTServerMicroService - { - - public: - //** - // * @brief Creates an server listening to the given URI - // * - // * @param uri the URI at which the server is listening for requests - // */ - IRESTServerMicroService(); - ~IRESTServerMicroService(); - - virtual web::uri GetUri() = 0; - - /** - * @brief Opens the listener and starts the listening process - */ - virtual void OpenListener() = 0; - - /** - * @brief Closes the listener and stops the listening process - */ - virtual void CloseListener() = 0; - - private: - /** - * @brief Handle for incoming GET requests - * - * @param MitkRequest incoming request object - */ - virtual void HandleGet(MitkRequest request) = 0; - - protected: - MitkListener m_Listener; - web::uri m_Uri; - }; -} // namespace mitk - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -#endif \ No newline at end of file diff --git a/Modules/CppRestSdk/include/mitkRESTManager.h b/Modules/CppRestSdk/include/mitkRESTManager.h index 43657d5569..c869b150ea 100644 --- a/Modules/CppRestSdk/include/mitkRESTManager.h +++ b/Modules/CppRestSdk/include/mitkRESTManager.h @@ -1,117 +1,117 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkRESTManager_h #define mitkRESTManager_h #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4251) #endif #include #include #include #include namespace mitk { class MITKCPPRESTSDK_EXPORT RESTManager : public IRESTManager { public: RESTManager(); ~RESTManager() override; /** * @brief Executes a HTTP request in the mitkRESTClientMicroService class * * @param uri defines the URI the request is send to * @param type the RequestType of the HTTP request (optional) * @param body the body for the request (optional) * @param filePath the file path to store the request to * @return task to wait for */ pplx::task SendRequest(const web::uri &uri, const RequestType &type = get, const web::json::value &body= NULL, const utility::string_t &filePath = L"") override; /** * @brief starts listening for requests if there isn't another observer listening and the port is free * * @param uri defines the URI for which incoming requests should be send to the observer * @param observer the observer which handles the incoming requests */ void ReceiveRequest(const web::uri &uri, IRESTObserver *observer) override; /** * @brief Handles incoming requests by notifying the observer which should receive it * * @param uri defines the URI of the request * @param body the body of the request * @return the data which is modified by the notified observer */ web::json::value Handle(const web::uri &uri, web::json::value &body) override; /** * @brief Handles the deletion of an observer for all or a specific uri * * @param observer the observer which shouldn't receive requests anymore * @param uri the uri for which the observer doesn't handle requests anymore (optional) */ virtual void HandleDeleteObserver(IRESTObserver *observer, const web::uri &uri) override; - virtual std::map GetM_ServerMap() override; + virtual std::map GetM_ServerMap() override; virtual std::map, IRESTObserver *> GetM_Observers() override; /** * @brief adds an observer if a port is free, called by ReceiveRequest method * * @param uri the uri which builds the key for the observer map * @param observer the observer which is added */ void AddObserver(const web::uri &uri, IRESTObserver *observer); /** * @brief handles server management if there is already a server under a port, called by ReceiveRequest method * * @param uri the uri which which is requested to be added * @param observer the observer which proceeds the request */ void ServerUnderPort(const web::uri &uri, IRESTObserver *observer); /** * @brief deletes an observer, called by HandleDeleteObserver method * * @param it the iterator comparing the observers in HandleDeleteObserver method * @param the uri for which the observer doesn't want to receive requests anymore * @return bool if there is another observer under the port */ bool DeleteObserver(std::map < std::pair, IRESTObserver *>::iterator &it, const web::uri &uri); protected: - std::map m_ServerMap; // Map with port server pairs + std::map m_ServerMap; // Map with port server pairs std::map, IRESTObserver *> m_Observers; // Map with all observers }; } // namespace mitk #ifdef _MSC_VER #pragma warning(pop) #endif #endif // !mitkRESTManager_h diff --git a/Modules/CppRestSdk/include/mitkRESTServerMicroService.h b/Modules/CppRestSdk/include/mitkRESTServerMicroService.h index 3e9581ac90..e96082cf04 100644 --- a/Modules/CppRestSdk/include/mitkRESTServerMicroService.h +++ b/Modules/CppRestSdk/include/mitkRESTServerMicroService.h @@ -1,71 +1,82 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkRESTServerMicroService_h #define mitkRESTServerMicroService_h +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4251) +#endif + #include "cpprest/http_listener.h" #include "MitkCppRestSdkExports.h" #include #include #include #include #include -#include typedef web::http::experimental::listener::http_listener MitkListener; typedef web::http::http_request MitkRequest; typedef web::http::http_response MitkResponse; typedef web::http::methods MitkRESTMethods; typedef web::http::status_codes MitkRestStatusCodes; typedef web::json::json_exception MitkJsonException; namespace mitk { - class MITKCPPRESTSDK_EXPORT RESTServerMicroService : public IRESTServerMicroService + class MITKCPPRESTSDK_EXPORT RESTServerMicroService { public: /** * @brief Creates an server listening to the given URI * * @param uri the URI at which the server is listening for requests */ RESTServerMicroService(web::uri uri); ~RESTServerMicroService(); - web::uri GetUri() override; + web::uri GetUri(); /** * @brief Opens the listener and starts the listening process */ - void OpenListener() override; + void OpenListener(); /** * @brief Closes the listener and stops the listening process */ - void CloseListener() override; + void CloseListener(); private: /** * @brief Handle for incoming GET requests * * @param MitkRequest incoming request object */ - void HandleGet(MitkRequest request) override; + void HandleGet(MitkRequest request); + + protected: + MitkListener m_Listener; + web::uri m_Uri; }; } // namespace mitk +#ifdef _MSC_VER +#pragma warning(pop) +#endif #endif \ No newline at end of file diff --git a/Modules/CppRestSdk/src/mitkIRESTServerMicroService.cpp b/Modules/CppRestSdk/src/mitkIRESTServerMicroService.cpp deleted file mode 100644 index 3f478adc55..0000000000 --- a/Modules/CppRestSdk/src/mitkIRESTServerMicroService.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "mitkIRESTServerMicroService.h" - -mitk::IRESTServerMicroService::IRESTServerMicroService() {} - -mitk::IRESTServerMicroService::~IRESTServerMicroService() {} diff --git a/Modules/CppRestSdk/src/mitkRESTManager.cpp b/Modules/CppRestSdk/src/mitkRESTManager.cpp index ea7ac285fd..708e5979fe 100644 --- a/Modules/CppRestSdk/src/mitkRESTManager.cpp +++ b/Modules/CppRestSdk/src/mitkRESTManager.cpp @@ -1,221 +1,221 @@ #include "mitkRESTManager.h" #include mitk::RESTManager::RESTManager() {} mitk::RESTManager::~RESTManager() {} pplx::task mitk::RESTManager::SendRequest(const web::uri &uri, const RequestType &type, const web::json::value &content, const utility::string_t &filePath) { pplx::task answer; auto client = new RESTClientMicroService(); //according to the RequestType, different HTTP requests are made switch (type) { case get: { if (filePath == L"") { //no file path specified, starts a normal get request returning the normal json result answer = client->Get(uri); } else { //file path ist specified, the result of the get request ist stored in this file //and an empty json object is returned answer = client->Get(uri, filePath); } break; } case post: { if (content == NULL) { //warning because normally you won't create an empty ressource MITK_WARN << "Content for put is empty, this will create an empty ressource"; } answer = client->POST(uri, content); break; } break; case put: { if (content == NULL) { //warning because normally you won't empty a ressource MITK_WARN << "Content for put is empty, this will empty the ressource"; } answer = client->PUT(uri,content); break; } } return answer; } void mitk::RESTManager::ReceiveRequest(const web::uri &uri, mitk::IRESTObserver *observer) { // New instance of RESTServerMicroservice in m_ServerMap, key is port of the request int port = uri.port(); // Checking if port is free to add a new Server if (m_ServerMap.count(port) == 0) { this->AddObserver(uri, observer); // creating server instance RESTServerMicroService *server = new RESTServerMicroService(uri.authority()); // add reference to server instance to map m_ServerMap[port] = server; //start Server server->OpenListener(); utility::string_t host = uri.authority().to_string(); std::string hoststring(host.begin(), host.end()); MITK_INFO << "new server" << hoststring << " at port" << port; } // If there is already a server under this port else { this->ServerUnderPort(uri, observer); } } web::json::value mitk::RESTManager::Handle(const web::uri &uri, web::json::value &body) { // Checking if there is an observer for the port and path std::pair key(uri.port(), uri.path()); if (m_Observers.count(key) != 0) { MITK_INFO << "Manager: Data send to observer"; return m_Observers[key]->Notify(body,uri); } //No observer under this port, return null which results in status code 404 (s. RESTServerMicroService) else { MITK_WARN << "No Observer can handle the data"; return NULL; } } void mitk::RESTManager::HandleDeleteObserver(IRESTObserver *observer, const web::uri &uri= L"") { for (auto it = m_Observers.begin(); it != m_Observers.end();) { mitk::IRESTObserver *obsMap = it->second; // Check wether observer is at this place in map if (obsMap == observer) { //Check wether it is the right uri to be deleted if (uri==L""||it->first.second == uri.path()) { int port = it->first.first; bool noObserverForPort = this->DeleteObserver(it, uri); if (noObserverForPort) { // there isn't an observer at this port, delete m_ServerMap entry for this port // close listener m_ServerMap[port]->CloseListener(); dynamic_cast(m_ServerMap[port])->~RESTServerMicroService(); // delete server from map m_ServerMap.erase(port); } } else { ++it; } } else { ++it; } } } -std::map mitk::RESTManager::GetM_ServerMap() +std::map mitk::RESTManager::GetM_ServerMap() { return m_ServerMap; } std::map, mitk::IRESTObserver *> mitk::RESTManager::GetM_Observers() { return m_Observers; } void mitk::RESTManager::AddObserver(const web::uri &uri, IRESTObserver *observer) { // new observer has to be added std::pair key(uri.port(), uri.path()); m_Observers[key] = observer; // testing if entry has been added to observer map utility::string_t uristringt = uri.path(); std::string uristring(uristringt.begin(), uristringt.end()); MITK_INFO << "[" << uri.port() << ", " << uristring << "] : Number of elements in map: " << m_Observers.count(key); } void mitk::RESTManager::ServerUnderPort(const web::uri &uri, IRESTObserver *observer) { // Same host, means new observer but not a new server instance if (m_ServerMap[uri.port()]->GetUri() == uri.authority()) { // new observer has to be added std::pair key(uri.port(), uri.path()); // only add a new observer if there isn't already an observer for this uri if (m_Observers.count(key) == 0) { m_Observers[key] = observer; // testing if entry has been added to map utility::string_t uristringt = uri.path(); std::string uristring(uristringt.begin(), uristringt.end()); MITK_INFO << "[" << uri.port() << ", " << uristring << "] : Number of elements in map: " << m_Observers.count(key); // info output MITK_INFO << "started listening, no new server instance has been created"; } else { MITK_ERROR << "Threre is already a observer handeling this data"; } } // Error, since another server can't be added under this port else { MITK_ERROR << "There is already another server listening under this port"; } } bool mitk::RESTManager::DeleteObserver(std::map, IRESTObserver *>::iterator &it, const web::uri &uri) { // if yes // 1. store port and path in a temporary variable // (path is only needed to create a key for info output) int port = it->first.first; utility::string_t path = it->first.second; std::pair key(port, path); MITK_INFO << "Number of elements at key [ " << port << ", " << std::string(key.second.begin(), key.second.end()) << "]: " << m_Observers.count(key); // 2. delete map entry it = m_Observers.erase(it); MITK_INFO << "Number of elements at key [ " << port << ", " << std::string(key.second.begin(), key.second.end()) << "]: " << m_Observers.count(key); // 3. check, if there is another observer under this port in observer map (with bool flag) bool noObserverForPort = true; for (auto o : m_Observers) { if (o.first.first == port) { // there still exists an observer for this port noObserverForPort = false; } } return noObserverForPort; } diff --git a/Modules/CppRestSdkQt/include/mitkRESTManagerQt.h b/Modules/CppRestSdkQt/include/mitkRESTManagerQt.h index 2d6b9c990b..6e79d71420 100644 --- a/Modules/CppRestSdkQt/include/mitkRESTManagerQt.h +++ b/Modules/CppRestSdkQt/include/mitkRESTManagerQt.h @@ -1,89 +1,89 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkRESTManagerQt_h #define mitkRESTManagerQt_h #include #include #include #include #include #include #include namespace mitk { class MITKCPPRESTSDKQT_EXPORT RESTManagerQt : public QObject, public RESTManager { Q_OBJECT public: RESTManagerQt(); ~RESTManagerQt() override; /** * @brief Executes a HTTP request in the mitkRESTClientMicroService class * * @param uri defines the URI the request is send to * @param type the RequestType of the HTTP request (optional) * @param body the body for the request (optional) * @param filePath the file path to store the request to * @return task to wait for */ pplx::task SendRequest(const web::uri &uri, const RequestType &type = get, const web::json::value &body = NULL, const utility::string_t &filePath = L"") override; /** * @brief starts listening for requests if there isn't another observer listening and the port is free * * @param uri defines the URI for which incoming requests should be send to the observer * @param observer the observer which handles the incoming requests */ void ReceiveRequest(const web::uri &uri, IRESTObserver *observer) override; /** * @brief Handles incoming requests by notifying the observer which should receive it * * @param uri defines the URI of the request * @param body the body of the request * @return the data which is modified by the notified observer */ web::json::value Handle(const web::uri &uri, web::json::value &body) override; /** * @brief Handles the deletion of an observer for all or a specific uri * * @param observer the observer which shouldn't receive requests anymore * @param uri the uri for which the observer doesn't handle requests anymore (optional) */ virtual void HandleDeleteObserver(IRESTObserver *observer, const web::uri &uri) override; - virtual std::map GetM_ServerMap() override; + virtual std::map GetM_ServerMap() override; virtual std::map, IRESTObserver *> GetM_Observers() override; private: - //std::map m_ServerMap; // Map with port server pairs + //std::map m_ServerMap; // Map with port server pairs std::map m_ServerThreadMap; // Map with threads for servers //std::map, IRESTObserver *> m_Observers; // Map with all observers }; } // namespace mitk #endif // !mitkRESTManager_h \ No newline at end of file diff --git a/Modules/CppRestSdkQt/include/mitkRESTServerMicroServiceQt.h b/Modules/CppRestSdkQt/include/mitkRESTServerMicroServiceQt.h index 48ec102207..2cf397e0c0 100644 --- a/Modules/CppRestSdkQt/include/mitkRESTServerMicroServiceQt.h +++ b/Modules/CppRestSdkQt/include/mitkRESTServerMicroServiceQt.h @@ -1,51 +1,51 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkRESTServerMicroServiceQt_h #define mitkRESTServerMicroServiceQt_h #include #include namespace mitk { class RESTServerMicroServiceQt : public QObject, public RESTServerMicroService { Q_OBJECT public: /** * @brief Creates an server listening to the given URI * * @param uri the URI at which the server is listening for requests */ RESTServerMicroServiceQt(web::uri uri); ~RESTServerMicroServiceQt(); public slots: /** * @brief Opens the listener and starts the listening process */ - void OpenListener() override; + void OpenListener(); /** * @brief Closes the listener and stops the listening process */ - void CloseListener() override; + void CloseListener(); }; } // namespace mitk #endif \ No newline at end of file diff --git a/Modules/CppRestSdkQt/src/mitkRESTManagerQt.cpp b/Modules/CppRestSdkQt/src/mitkRESTManagerQt.cpp index b7cca8440e..9f3cd66e0d 100644 --- a/Modules/CppRestSdkQt/src/mitkRESTManagerQt.cpp +++ b/Modules/CppRestSdkQt/src/mitkRESTManagerQt.cpp @@ -1,105 +1,105 @@ #include "mitkRESTManagerQt.h" #include #include mitk::RESTManagerQt::RESTManagerQt() {} mitk::RESTManagerQt::~RESTManagerQt() {} pplx::task mitk::RESTManagerQt::SendRequest(const web::uri &uri, const RequestType &type, const web::json::value &content, const utility::string_t &filePath) { return mitk::RESTManager::SendRequest(uri, type, content, filePath); } void mitk::RESTManagerQt::ReceiveRequest(const web::uri &uri, mitk::IRESTObserver *observer) { // New instance of RESTServerMicroservice in m_ServerMap, key is port of the request int port = uri.port(); // Checking if port is free to add a new Server if (m_ServerMap.count(port) == 0) { mitk::RESTManager::AddObserver(uri, observer); // creating server instance RESTServerMicroServiceQt *server = new RESTServerMicroServiceQt(uri.authority()); // add reference to server instance to map m_ServerMap[port] = server; // Move server to seperate Thread and create connections between threads m_ServerThreadMap[port] = new QThread; server->moveToThread(m_ServerThreadMap[port]); connect(m_ServerThreadMap[port], &QThread::finished, server, &QObject::deleteLater); // starting Server m_ServerThreadMap[port]->start(); QMetaObject::invokeMethod(server, "OpenListener"); utility::string_t host = uri.authority().to_string(); std::string hoststring(host.begin(), host.end()); MITK_INFO << "new server" << hoststring << " at port" << port; } // If there is already a server under this port else { mitk::RESTManager::ServerUnderPort(uri, observer); } } web::json::value mitk::RESTManagerQt::Handle(const web::uri &uri, web::json::value &body) { return mitk::RESTManager::Handle(uri, body); } void mitk::RESTManagerQt::HandleDeleteObserver(IRESTObserver *observer, const web::uri &uri = L"") { for (auto it = m_Observers.begin(); it != m_Observers.end();) { mitk::IRESTObserver *obsMap = it->second; // Check wether observer is at this place in map if (obsMap == observer) { // Check wether it is the right uri to be deleted if (uri == L"" || it->first.second == uri.path()) { int port = it->first.first; bool noObserverForPort = mitk::RESTManager::DeleteObserver(it, uri); if (noObserverForPort) { // there isn't an observer at this port, delete m_ServerMap entry for this port // close listener - QMetaObject::invokeMethod(dynamic_cast(m_ServerMap[port]), "CloseListener"); + QMetaObject::invokeMethod(static_cast(m_ServerMap[port]), "CloseListener"); // end thread m_ServerThreadMap[port]->quit(); m_ServerThreadMap[port]->wait(); // delete server from map m_ServerMap.erase(port); } } else { ++it; } } else { ++it; } } } -std::map mitk::RESTManagerQt::GetM_ServerMap() +std::map mitk::RESTManagerQt::GetM_ServerMap() { return mitk::RESTManager::GetM_ServerMap(); } std::map, mitk::IRESTObserver *> mitk::RESTManagerQt::GetM_Observers() { return mitk::RESTManager::GetM_Observers(); } \ No newline at end of file