From c78717ca9f2c15072037b94fe8080eaced5f75b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Bueno=20L=C3=B3pez?= <69244257+JLBuenoLopez-eProsima@users.noreply.github.com> Date: Fri, 5 Apr 2024 07:40:13 +0200 Subject: [PATCH] Update to new ReturnCode_t (#74) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo González Moreno Co-authored-by: Ricardo González Moreno --- include/LateJoiner.h | 2 +- src/DiscoveryServerManager.cpp | 34 +++++++++++++++++----------------- src/LateJoiner.cpp | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/LateJoiner.h b/include/LateJoiner.h index a691343b..fbf3fdc2 100644 --- a/include/LateJoiner.h +++ b/include/LateJoiner.h @@ -437,7 +437,7 @@ void DelayedEndpointDestruction::operator ()( // and we removed the endpoint: Domain::removeDataWriter or Domain::removeDataReader ret = (manager.*LateJoinerDataTraits::remove_endpoint_function)(endpoint); - if (ReturnCode_t::RETCODE_OK != ret) + if (RETCODE_OK != ret) { LOG_ERROR("Error deleting Endpoint"); } diff --git a/src/DiscoveryServerManager.cpp b/src/DiscoveryServerManager.cpp index 503e0924..afe3f70e 100644 --- a/src/DiscoveryServerManager.cpp +++ b/src/DiscoveryServerManager.cpp @@ -113,7 +113,7 @@ DiscoveryServerManager::DiscoveryServerManager( tinyxml2::XMLPrinter printer; profiles->Accept(&printer); std::string xmlString = R"(")" + std::string(printer.CStr()) + R"(")"; - if (ReturnCode_t::RETCODE_OK == + if (RETCODE_OK == DomainParticipantFactory::get_instance()->load_XML_profiles_string(xmlString.c_str(), std::string(printer.CStr()).length())) { @@ -427,7 +427,7 @@ ReturnCode_t DiscoveryServerManager::deleteDataReader( { if (dr == nullptr) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } fastdds::dds::Subscriber* sub = nullptr; { @@ -439,7 +439,7 @@ ReturnCode_t DiscoveryServerManager::deleteDataReader( { return sub->delete_datareader(dr); } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } ReturnCode_t DiscoveryServerManager::deleteDataWriter( @@ -447,7 +447,7 @@ ReturnCode_t DiscoveryServerManager::deleteDataWriter( { if (dw == nullptr) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } fastdds::dds::Publisher* pub = nullptr; { @@ -459,7 +459,7 @@ ReturnCode_t DiscoveryServerManager::deleteDataWriter( { return pub->delete_datawriter(dw); } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } ReturnCode_t DiscoveryServerManager::deleteParticipant( @@ -468,7 +468,7 @@ ReturnCode_t DiscoveryServerManager::deleteParticipant( { if (participant == nullptr) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } std::lock_guard lock(management_mutex); @@ -477,7 +477,7 @@ ReturnCode_t DiscoveryServerManager::deleteParticipant( entity_map.erase(participant->guid()); ReturnCode_t ret = participant->delete_contained_entities(); - if (ret != ReturnCode_t::RETCODE_OK) + if (ret != RETCODE_OK) { LOG_ERROR("Error cleaning up participant entities"); } @@ -704,13 +704,13 @@ void DiscoveryServerManager::onTerminate() entity.second->set_listener(nullptr); ReturnCode_t ret = entity.second->delete_contained_entities(); - if (ReturnCode_t::RETCODE_OK != ret) + if (RETCODE_OK != ret) { LOG_ERROR("Error cleaning up client entities"); } ret = DomainParticipantFactory::get_instance()->delete_participant(entity.second); - if (ReturnCode_t::RETCODE_OK != ret) + if (RETCODE_OK != ret) { LOG_ERROR("Error deleting Client"); } @@ -723,13 +723,13 @@ void DiscoveryServerManager::onTerminate() entity.second->set_listener(nullptr); ReturnCode_t ret = entity.second->delete_contained_entities(); - if (ReturnCode_t::RETCODE_OK != ret) + if (RETCODE_OK != ret) { LOG_ERROR("Error cleaning up simple entities"); } ret = DomainParticipantFactory::get_instance()->delete_participant(entity.second); - if (ReturnCode_t::RETCODE_OK != ret) + if (RETCODE_OK != ret) { LOG_ERROR("Error deleting Simple Discovery Entity"); } @@ -741,13 +741,13 @@ void DiscoveryServerManager::onTerminate() entity.second->set_listener(nullptr); ReturnCode_t ret = entity.second->delete_contained_entities(); - if (ReturnCode_t::RETCODE_OK != ret) + if (RETCODE_OK != ret) { LOG_ERROR("Error cleaning up server entities"); } ret = DomainParticipantFactory::get_instance()->delete_participant(entity.second); - if (ReturnCode_t::RETCODE_OK != ret) + if (RETCODE_OK != ret) { LOG_ERROR("Error deleting Server"); } @@ -824,7 +824,7 @@ void DiscoveryServerManager::loadServer( // retrieve profile attributes DomainParticipantQos dpQOS; - if (ReturnCode_t::RETCODE_OK != + if (RETCODE_OK != DomainParticipantFactory::get_instance()->get_participant_qos_from_profile(std::string(profile_name), dpQOS)) { @@ -996,7 +996,7 @@ void DiscoveryServerManager::loadClient( // retrieve profile attributes DomainParticipantQos dpQOS; - if (ReturnCode_t::RETCODE_OK != + if (RETCODE_OK != DomainParticipantFactory::get_instance()->get_participant_qos_from_profile(std::string(profile_name), dpQOS)) { @@ -1270,7 +1270,7 @@ void DiscoveryServerManager::loadSimple( if (profile_name != nullptr) { // retrieve profile attributes - if (ReturnCode_t::RETCODE_OK != + if (RETCODE_OK != DomainParticipantFactory::get_instance()->get_participant_qos_from_profile(std::string(profile_name), dpQOS)) { @@ -1645,7 +1645,7 @@ void DiscoveryServerManager::MapServerInfo( // I must load the prefix from the profile // retrieve profile QOS pqos = std::make_shared(); - if (ReturnCode_t::RETCODE_OK != + if (RETCODE_OK != DomainParticipantFactory::get_instance()->get_participant_qos_from_profile(profile_name, *pqos)) { LOG_ERROR("DiscoveryServerManager::loadServer couldn't load profile " << profile_name); diff --git a/src/LateJoiner.cpp b/src/LateJoiner.cpp index 3289684b..e8e61416 100644 --- a/src/LateJoiner.cpp +++ b/src/LateJoiner.cpp @@ -70,7 +70,7 @@ void DelayedParticipantDestruction::operator ()( std::string name = p->get_qos().name().to_string(); ReturnCode_t ret = manager.deleteParticipant(p); - if (ReturnCode_t::RETCODE_OK != ret) + if (RETCODE_OK != ret) { LOG_ERROR("Error during delayed deletion of Participant"); }