Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion applications/plugins/Communication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for sure it´s working with 11

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(HEADER_FILES
config.h
Expand Down Expand Up @@ -135,4 +138,4 @@ install(TARGETS ${PROJECT_NAME}
COMPONENT Communication_libraries
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
ARCHIVE DESTINATION lib)
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void ServerCommunicationVRPN::createVRPNMessage(CommunicationSubscriber* subscri
void ServerCommunicationVRPN::receiveData()
{
std::string address = d_address.getValueString();
std::vector<vrpn_BaseClass*> receivers;
std::vector<std::unique_ptr<vrpn_BaseClass>> receivers;

std::map<std::string, CommunicationSubscriber*> subscribersMap = getSubscribers();
if (subscribersMap.size() == 0)
Expand All @@ -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<vrpn_Text_Receiver> vrpnText = std::make_unique<vrpn_Text_Receiver>(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<vrpn_Analog_Remote> vrpnAnalog = std::make_unique<vrpn_Analog_Remote>(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<vrpn_Tracker_Remote> *vrpnTracker = std::make_unique<vrpn_Tracker_Remote>(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<vrpn_BaseClass>&rec : receivers )
{
rec->mainloop();
}
Expand Down Expand Up @@ -426,4 +426,4 @@ std::string ServerCommunicationVRPN::getArgumentType(std::string value)
}
} //communication
} //component
} //sofa
} //sofa