diff --git a/applications/plugins/Communication/CMakeLists.txt b/applications/plugins/Communication/CMakeLists.txt index b5ce21444fc..f042711b8c7 100755 --- a/applications/plugins/Communication/CMakeLists.txt +++ b/applications/plugins/Communication/CMakeLists.txt @@ -8,6 +8,9 @@ option(PLUGIN_COMMUNICATION_VRPN "Make use of the VRPN protocol" OFF) set(COMMUNICATION_MAJOR_VERSION 1) set(COMMUNICATION_MINOR_VERSION 0) set(COMMUNICATION_VERSION ${COMMUNICATION_MAJOR_VERSION}.${COMMUNICATION_MINOR_VERSION}) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) set(HEADER_FILES config.h @@ -135,4 +138,4 @@ install(TARGETS ${PROJECT_NAME} COMPONENT Communication_libraries RUNTIME DESTINATION bin LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) + ARCHIVE DESTINATION lib) \ No newline at end of file diff --git a/applications/plugins/Communication/components/serverCommunicationVRPN.inl b/applications/plugins/Communication/components/serverCommunicationVRPN.inl index f6d719ddcc6..0d0c1fb697e 100644 --- a/applications/plugins/Communication/components/serverCommunicationVRPN.inl +++ b/applications/plugins/Communication/components/serverCommunicationVRPN.inl @@ -218,7 +218,7 @@ void ServerCommunicationVRPN::createVRPNMessage(CommunicationSubscriber* subscri void ServerCommunicationVRPN::receiveData() { std::string address = d_address.getValueString(); - std::vector receivers; + std::vector> receivers; std::map subscribersMap = getSubscribers(); if (subscribersMap.size() == 0) @@ -236,24 +236,24 @@ void ServerCommunicationVRPN::receiveData() const char *device = str.c_str(); //Recieving Text via VRPN - vrpn_Text_Receiver *vrpnText = new vrpn_Text_Receiver(device); + std::unique_ptr vrpnText = std::make_unique(device); vrpnText->register_message_handler( (void*) this, processTextMessage ); - receivers.push_back(vrpnText); + receivers.push_back(std::move(vrpnText)); //Receiving Analog via VRPN - vrpn_Analog_Remote *vrpnAnalog = new vrpn_Analog_Remote(device); + std::unique_ptr vrpnAnalog = std::make_unique(device); vrpnAnalog->register_change_handler( (void*) this, processAnalogMessage); - receivers.push_back(vrpnAnalog); + receivers.push_back(std::move(vrpnAnalog)); //Receiving Tracker via VRPN - // vrpn_Tracker_Remote *vrpnTracker = new vrpn_Tracker_Remote(device); + // std::unique_ptr *vrpnTracker = std::make_unique(device); // vrpnTracker->register_change_handler( (void*) this, processTrackerMessage); - // receivers.push_back(vrpnTracker); + // receivers.push_back(std::move(vrpnTracker)); } while(this->m_running) { - for(auto rec : receivers ) + for(std::unique_ptr&rec : receivers ) { rec->mainloop(); } @@ -426,4 +426,4 @@ std::string ServerCommunicationVRPN::getArgumentType(std::string value) } } //communication } //component -} //sofa +} //sofa \ No newline at end of file