diff --git a/Migration.md b/Migration.md index ab56740f1..35a913a88 100644 --- a/Migration.md +++ b/Migration.md @@ -17,19 +17,24 @@ release will remove the deprecated code. Use the `GZ_` prefixed versions instead! 1. `IGN_TRANSPORT_USERNAME` -> `GZ_TRANSPORT_USERNAME` - 1. `IGN_TRANSPORT_PASSWORD` -> `GZ_TRANSPORT_PASSWORD` - 1. `IGN_PARTITION` -> `GZ_PARTITION` - 1. `IGN_IP` -> `GZ_IP` - 1. `IGN_TRANSPORT_TOPIC_STATISTICS` -> `GZ_TRANSPORT_TOPIC_STATISTICS` - 1. `IGN_DISCOVERY_MSG_PORT` -> `GZ_DISCOVERY_MSG_PORT` - 1. `IGN_DISCOVERY_MULTICAST_IP` -> `GZ_DISCOVERY_MULTICAST_IP` - 1. `IGN_DISCOVERY_SRV_PORT` -> `GZ_DISCOVERY_SRV_PORT` - 1. `IGN_RELAY` -> `GZ_RELAY` - 1. `IGN_TRANSPORT_LOG_SQL_PATH` -> `GZ_TRANSPORT_LOG_SQL_PATH` - 1. `IGN_TRANSPORT_RCVHWM` -> `GZ_TRANSPORT_RCVHWM` - 1. `IGN_TRANSPORT_SNDHWM` -> `GZ_TRANSPORT_SNDHWM` - 1. `IGN_VERBOSE` -> `GZ_VERBOSE` - + 1. `IGN_TRANSPORT_PASSWORD` -> `GZ_TRANSPORT_PASSWORD` + 1. `IGN_PARTITION` -> `GZ_PARTITION` + 1. `IGN_IP` -> `GZ_IP` + 1. `IGN_TRANSPORT_TOPIC_STATISTICS` -> `GZ_TRANSPORT_TOPIC_STATISTICS` + 1. `IGN_DISCOVERY_MSG_PORT` -> `GZ_DISCOVERY_MSG_PORT` + 1. `IGN_DISCOVERY_MULTICAST_IP` -> `GZ_DISCOVERY_MULTICAST_IP` + 1. `IGN_DISCOVERY_SRV_PORT` -> `GZ_DISCOVERY_SRV_PORT` + 1. `IGN_RELAY` -> `GZ_RELAY` + 1. `IGN_TRANSPORT_LOG_SQL_PATH` -> `GZ_TRANSPORT_LOG_SQL_PATH` + 1. `IGN_TRANSPORT_RCVHWM` -> `GZ_TRANSPORT_RCVHWM` + 1. `IGN_TRANSPORT_SNDHWM` -> `GZ_TRANSPORT_SNDHWM` + 1. `IGN_VERBOSE` -> `GZ_VERBOSE` +1. The following `IGN_` prefixed macros are deprecated and will be removed in future versions. + Additionally, they will only be available when including the corresponding `ignition/...` header. + Use the `GZ_` prefix instead. + 1. `IGN_ZMQ_POST_4_3_1` + 1. `IGN_CPPZMQ_POST_4_7_0` + 1. `ign_strcat`, `ign_strcpy`, `ign_sprintf`, `ign_strdup` ## Gazebo Transport 9.X to 10.X diff --git a/include/gz/transport/CIface.h b/include/gz/transport/CIface.h index ace845611..9c5d92e00 100644 --- a/include/gz/transport/CIface.h +++ b/include/gz/transport/CIface.h @@ -121,5 +121,5 @@ extern "C" { } #endif -// INCLUDE_IGNITION_TRANSPORT_CIFACE_H_ +// INCLUDE_GZ_TRANSPORT_CIFACE_H_ #endif diff --git a/include/gz/transport/Clock.hh b/include/gz/transport/Clock.hh index ee729d6bb..4155ff268 100644 --- a/include/gz/transport/Clock.hh +++ b/include/gz/transport/Clock.hh @@ -89,9 +89,9 @@ namespace gz private: class Implementation; /// \internal Pointer to the implementation of this class - IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING private: std::unique_ptr dataPtr; - IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING }; ////////////////////////////////////////////////// @@ -118,9 +118,9 @@ namespace gz private: class Implementation; /// \internal Pointer to the implementation of this class - IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING private: std::unique_ptr dataPtr; - IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING }; } } diff --git a/include/gz/transport/Discovery.hh b/include/gz/transport/Discovery.hh index e3e4035e1..55cffd997 100644 --- a/include/gz/transport/Discovery.hh +++ b/include/gz/transport/Discovery.hh @@ -834,7 +834,7 @@ namespace gz // words, the frame_delimiter contains a value that represents // the total size of only the frame_body. // - // It is possible that two incompatible versions of Ignition + // It is possible that two incompatible versions of Gazebo // Transport exist on the same network. If we receive an // unexpected size, then we ignore the message. diff --git a/include/gz/transport/Helpers.hh b/include/gz/transport/Helpers.hh index b300dea55..1a4d46dc3 100644 --- a/include/gz/transport/Helpers.hh +++ b/include/gz/transport/Helpers.hh @@ -32,14 +32,14 @@ // Avoid using deprecated message send/receive function when possible. #if ZMQ_VERSION > ZMQ_MAKE_VERSION(4, 3, 1) - #define IGN_ZMQ_POST_4_3_1 + #define GZ_ZMQ_POST_4_3_1 #endif // Avoid using deprecated set function when possible #if CPPZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 7, 0) // Ubuntu Focal (20.04) packages a different "4.7.0" #ifndef UBUNTU_FOCAL - #define IGN_CPPZMQ_POST_4_7_0 + #define GZ_CPPZMQ_POST_4_7_0 #endif #endif @@ -74,15 +74,15 @@ namespace gz // Use safer functions on Windows #ifdef _MSC_VER - #define ign_strcat strcat_s - #define ign_strcpy strcpy_s - #define ign_sprintf sprintf_s - #define ign_strdup _strdup + #define gz_strcat strcat_s + #define gz_strcpy strcpy_s + #define gz_sprintf sprintf_s + #define gz_strdup _strdup #else - #define ign_strcat std::strcat - #define ign_strcpy std::strcpy - #define ign_sprintf std::sprintf - #define ign_strdup strdup + #define gz_strcat std::strcat + #define gz_strcpy std::strcpy + #define gz_sprintf std::sprintf + #define gz_strdup strdup #endif } } diff --git a/include/ignition/transport/Helpers.hh b/include/ignition/transport/Helpers.hh index 724d1e66b..8785d3bb4 100644 --- a/include/ignition/transport/Helpers.hh +++ b/include/ignition/transport/Helpers.hh @@ -17,3 +17,21 @@ #include #include + +// Avoid using deprecated message send/receive function when possible. +#if ZMQ_VERSION > ZMQ_MAKE_VERSION(4, 3, 1) + #define IGN_ZMQ_POST_4_3_1 GZ_ZMQ_POST_4_3_1 +#endif + +// Avoid using deprecated set function when possible +#if CPPZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 7, 0) + // Ubuntu Focal (20.04) packages a different "4.7.0" + #ifndef UBUNTU_FOCAL + #define IGN_CPPZMQ_POST_4_7_0 GZ_CPPZMQ_POST_4_7_0 + #endif +#endif + +#define ign_strcat gz_strcat +#define ign_strcpy gz_strcpy +#define ign_sprintf gz_sprintf +#define ign_strdup gz_strdup diff --git a/log/include/gz/transport/log/Playback.hh b/log/include/gz/transport/log/Playback.hh index f3e240e8d..dfd5ba531 100644 --- a/log/include/gz/transport/log/Playback.hh +++ b/log/include/gz/transport/log/Playback.hh @@ -40,7 +40,7 @@ namespace gz using PlaybackHandlePtr = std::shared_ptr; ////////////////////////////////////////////////// - /// \brief Initiates playback of ignition transport topics + /// \brief Initiates playback of Gazebo Transport topics /// This class makes it easy to play topics from a log file /// /// Responsibilities: topic name matching and initiating the playback @@ -153,7 +153,7 @@ namespace gz }; ////////////////////////////////////////////////// - /// \brief Handles the playback of ignition transport topics. + /// \brief Handles the playback of Gazebo Transport topics. /// This class allows you to manage a log playback once it has started. /// You must hang onto the PlaybackHandle or else the playback will end /// early. diff --git a/log/include/gz/transport/log/Recorder.hh b/log/include/gz/transport/log/Recorder.hh index 982d906bc..ab8891f0b 100644 --- a/log/include/gz/transport/log/Recorder.hh +++ b/log/include/gz/transport/log/Recorder.hh @@ -47,7 +47,7 @@ namespace gz ALREADY_SUBSCRIBED_TO_TOPIC = -6, }; - /// \brief Records ignition transport topics + /// \brief Records Gazebo Transport topics /// This class makes it easy to record topics to a log file. /// Responsibilities: topic name matching, time received tracking, /// multiple thread safety, subscribing to topics diff --git a/log/test/integration/playback.cc b/log/test/integration/playback.cc index 7a649ceb5..7ad283fa5 100644 --- a/log/test/integration/playback.cc +++ b/log/test/integration/playback.cc @@ -95,7 +95,7 @@ bool ExpectSameMessages( ////////////////////////////////////////////////// /// \brief Record a log and then play it back. Verify that the playback matches /// the original. -TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplayLog)) +TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLog)) { std::vector topics = {"/foo", "/bar", "/baz"}; @@ -176,7 +176,7 @@ TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplayLog)) ////////////////////////////////////////////////// -TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplayNoSuchTopic)) +TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayNoSuchTopic)) { gz::transport::log::Recorder recorder; const std::string logName = @@ -195,7 +195,7 @@ TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplayNoSuchTopic)) ////////////////////////////////////////////////// /// \brief Record a log and then play it back. Verify that the playback matches /// the original. -TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplayLogRegex)) +TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLogRegex)) { std::vector topics = {"/foo", "/bar", "/baz"}; @@ -262,7 +262,7 @@ TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplayLogRegex)) ////////////////////////////////////////////////// /// \brief Record a log and then play it back after removing some topics. Verify /// that the playback matches the original. -TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(RemoveTopic)) +TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(RemoveTopic)) { std::vector topics = {"/foo", "/bar", "/baz"}; @@ -371,7 +371,7 @@ TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(RemoveTopic)) ////////////////////////////////////////////////// /// \brief Record a log and then play it back. Verify that the playback matches /// the original. -TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplayLogMoveInstances)) +TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLogMoveInstances)) { std::vector topics = {"/foo", "/bar", "/baz"}; @@ -441,7 +441,7 @@ TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplayLogMoveInstances)) ////////////////////////////////////////////////// /// \brief Record a log and then play it back calling the Pause and Resume /// methods to control the playback flow. -TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplayPauseResume)) +TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayPauseResume)) { std::vector topics = {"/foo", "/bar", "/baz"}; @@ -563,7 +563,7 @@ TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplayPauseResume)) ////////////////////////////////////////////////// /// \brief Record a log and then play it back calling the Step method to control /// the playback workflow. -TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplayStep)) +TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayStep)) { std::vector topics = {"/foo", "/bar", "/baz"}; @@ -679,7 +679,7 @@ TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplayStep)) ////////////////////////////////////////////////// /// \brief Record a log and then play it back calling the Seek method to control /// the playback workflow. -TEST(playback, IGN_UTILS_TEST_DISABLED_ON_MAC(ReplaySeek)) +TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplaySeek)) { std::vector topics = {"/foo", "/bar", "/baz"}; diff --git a/log/test/integration/recorder.cc b/log/test/integration/recorder.cc index d6bb9aafe..a064747bc 100644 --- a/log/test/integration/recorder.cc +++ b/log/test/integration/recorder.cc @@ -69,7 +69,7 @@ void VerifyMessage(const gz::transport::log::Message &_msg, /// \brief Begin recording a set of topics before those topics are advertised /// or published to. TEST(recorder, - IGN_UTILS_TEST_DISABLED_ON_MAC(BeginRecordingTopicsBeforeAdvertisement)) + GZ_UTILS_TEST_DISABLED_ON_MAC(BeginRecordingTopicsBeforeAdvertisement)) { // Remember to include a leading slash so that the VerifyTopic lambda below // will work correctly. ign-transport automatically adds a leading slash to diff --git a/src/NetUtils.cc b/src/NetUtils.cc index a19ef7456..6f7f7c536 100644 --- a/src/NetUtils.cc +++ b/src/NetUtils.cc @@ -306,7 +306,7 @@ inline namespace GZ_TRANSPORT_VERSION_NAMESPACE reinterpret_cast(unicast->Address.lpSockaddr); // Make it a dotted quad char ipv4_str[3*4+3+1]; - ign_sprintf(ipv4_str, "%d.%d.%d.%d", + gz_sprintf(ipv4_str, "%d.%d.%d.%d", sockaddress->sin_addr.S_un.S_un_b.s_b1, sockaddress->sin_addr.S_un.S_un_b.s_b2, sockaddress->sin_addr.S_un.S_un_b.s_b3, diff --git a/src/Node.cc b/src/Node.cc index b8ebc4ed6..1e5a8a75a 100644 --- a/src/Node.cc +++ b/src/Node.cc @@ -620,7 +620,7 @@ bool Node::Unsubscribe(const std::string &_topic) if (!this->dataPtr->shared->localSubscribers .HasSubscriber(fullyQualifiedTopic)) { -#ifdef IGN_CPPZMQ_POST_4_7_0 +#ifdef GZ_CPPZMQ_POST_4_7_0 this->dataPtr->shared->dataPtr->subscriber->set( zmq::sockopt::unsubscribe, fullyQualifiedTopic); #else diff --git a/src/NodeShared.cc b/src/NodeShared.cc index b6d757f6d..bab381471 100644 --- a/src/NodeShared.cc +++ b/src/NodeShared.cc @@ -109,7 +109,7 @@ bool userPass(std::string &_user, std::string &_pass) ////////////////////////////////////////////////// // Helper to send messages -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 int sendHelper(zmq::socket_t &_pub, const std::string &_data, const zmq::send_flags &_type) { @@ -127,7 +127,7 @@ int sendHelper(zmq::socket_t &_pub, const std::string &_data, int _type) { zmq::message_t msg(_data.data(), _data.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 zmq::send_flags flags = zmq::send_flags::none; switch (_type) { @@ -154,7 +154,7 @@ std::string receiveHelper(zmq::socket_t &_socket) { zmq::message_t msg(0); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!_socket.recv(msg)) #else if (!_socket.recv(&msg, 0)) @@ -170,7 +170,7 @@ std::string receiveHelper(zmq::socket_t &_socket) void sendAuthErrorHelper(zmq::socket_t &_socket, const std::string &_err) { std::cerr << _err << std::endl; -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 sendHelper(_socket, "400", zmq::send_flags::sndmore); sendHelper(_socket, _err, zmq::send_flags::sndmore); sendHelper(_socket, "", zmq::send_flags::sndmore); @@ -459,7 +459,7 @@ bool NodeShared::Publish( // Send the messages std::lock_guard lock(this->mutex); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->publisher->send(msg0, zmq::send_flags::sndmore); this->dataPtr->publisher->send(msg1, zmq::send_flags::sndmore); this->dataPtr->publisher->send(msg2, zmq::send_flags::sndmore); @@ -480,7 +480,7 @@ bool NodeShared::Publish( meta.stamp = std::chrono::duration_cast( std::chrono::steady_clock::now().time_since_epoch()).count(); zmq::message_t msg4(&meta, sizeof(meta)); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->publisher->send(msg3, zmq::send_flags::sndmore); this->dataPtr->publisher->send(msg4, zmq::send_flags::none); #else @@ -490,7 +490,7 @@ bool NodeShared::Publish( } else { -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->publisher->send(msg3, zmq::send_flags::none); #else this->dataPtr->publisher->send(msg3, 0); @@ -521,7 +521,7 @@ void NodeShared::RecvMsgUpdate() try { -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->subscriber->recv(msg)) #else if (!this->dataPtr->subscriber->recv(&msg, 0)) @@ -530,7 +530,7 @@ void NodeShared::RecvMsgUpdate() topic = std::string(reinterpret_cast(msg.data()), msg.size()); // TODO(caguero): Use this as extra metadata for the subscriber. -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->subscriber->recv(msg)) #else if (!this->dataPtr->subscriber->recv(&msg, 0)) @@ -538,7 +538,7 @@ void NodeShared::RecvMsgUpdate() return; sender = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->subscriber->recv(msg)) #else if (!this->dataPtr->subscriber->recv(&msg, 0)) @@ -546,7 +546,7 @@ void NodeShared::RecvMsgUpdate() return; data = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->subscriber->recv(msg)) #else if (!this->dataPtr->subscriber->recv(&msg, 0)) @@ -556,7 +556,7 @@ void NodeShared::RecvMsgUpdate() if (this->dataPtr->topicStatsEnabled) { -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->subscriber->recv(msg)) #else if (!this->dataPtr->subscriber->recv(&msg, 0)) @@ -736,14 +736,14 @@ void NodeShared::RecvSrvRequest() try { -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->replier->recv(msg)) #else if (!this->dataPtr->replier->recv(&msg, 0)) #endif return; -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->replier->recv(msg)) #else if (!this->dataPtr->replier->recv(&msg, 0)) @@ -751,7 +751,7 @@ void NodeShared::RecvSrvRequest() return; topic = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->replier->recv(msg)) #else if (!this->dataPtr->replier->recv(&msg, 0)) @@ -759,7 +759,7 @@ void NodeShared::RecvSrvRequest() return; sender = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->replier->recv(msg)) #else if (!this->dataPtr->replier->recv(&msg, 0)) @@ -767,7 +767,7 @@ void NodeShared::RecvSrvRequest() return; dstId = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->replier->recv(msg)) #else if (!this->dataPtr->replier->recv(&msg, 0)) @@ -775,7 +775,7 @@ void NodeShared::RecvSrvRequest() return; nodeUuid = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->replier->recv(msg)) #else if (!this->dataPtr->replier->recv(&msg, 0)) @@ -783,7 +783,7 @@ void NodeShared::RecvSrvRequest() return; reqUuid = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->replier->recv(msg)) #else if (!this->dataPtr->replier->recv(&msg, 0)) @@ -791,7 +791,7 @@ void NodeShared::RecvSrvRequest() return; req = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->replier->recv(msg)) #else if (!this->dataPtr->replier->recv(&msg, 0)) @@ -799,7 +799,7 @@ void NodeShared::RecvSrvRequest() return; reqType = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->replier->recv(msg)) #else if (!this->dataPtr->replier->recv(&msg, 0)) @@ -862,7 +862,7 @@ void NodeShared::RecvSrvRequest() response.rebuild(dstId.size()); memcpy(response.data(), dstId.data(), dstId.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->replier->send(response, zmq::send_flags::sndmore); #else this->dataPtr->replier->send(response, ZMQ_SNDMORE); @@ -870,7 +870,7 @@ void NodeShared::RecvSrvRequest() response.rebuild(topic.size()); memcpy(response.data(), topic.data(), topic.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->replier->send(response, zmq::send_flags::sndmore); #else this->dataPtr->replier->send(response, ZMQ_SNDMORE); @@ -878,7 +878,7 @@ void NodeShared::RecvSrvRequest() response.rebuild(nodeUuid.size()); memcpy(response.data(), nodeUuid.data(), nodeUuid.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->replier->send(response, zmq::send_flags::sndmore); #else this->dataPtr->replier->send(response, ZMQ_SNDMORE); @@ -886,7 +886,7 @@ void NodeShared::RecvSrvRequest() response.rebuild(reqUuid.size()); memcpy(response.data(), reqUuid.data(), reqUuid.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->replier->send(response, zmq::send_flags::sndmore); #else this->dataPtr->replier->send(response, ZMQ_SNDMORE); @@ -894,7 +894,7 @@ void NodeShared::RecvSrvRequest() response.rebuild(rep.size()); memcpy(response.data(), rep.data(), rep.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->replier->send(response, zmq::send_flags::sndmore); #else this->dataPtr->replier->send(response, ZMQ_SNDMORE); @@ -902,7 +902,7 @@ void NodeShared::RecvSrvRequest() response.rebuild(resultStr.size()); memcpy(response.data(), resultStr.data(), resultStr.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->replier->send(response, zmq::send_flags::none); #else this->dataPtr->replier->send(response, 0); @@ -942,14 +942,14 @@ void NodeShared::RecvSrvResponse() try { -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->responseReceiver->recv(msg)) #else if (!this->dataPtr->responseReceiver->recv(&msg, 0)) #endif return; -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->responseReceiver->recv(msg)) #else if (!this->dataPtr->responseReceiver->recv(&msg, 0)) @@ -957,7 +957,7 @@ void NodeShared::RecvSrvResponse() return; topic = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->responseReceiver->recv(msg)) #else if (!this->dataPtr->responseReceiver->recv(&msg, 0)) @@ -965,7 +965,7 @@ void NodeShared::RecvSrvResponse() return; nodeUuid = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->responseReceiver->recv(msg)) #else if (!this->dataPtr->responseReceiver->recv(&msg, 0)) @@ -973,7 +973,7 @@ void NodeShared::RecvSrvResponse() return; reqUuid = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->responseReceiver->recv(msg)) #else if (!this->dataPtr->responseReceiver->recv(&msg, 0)) @@ -981,7 +981,7 @@ void NodeShared::RecvSrvResponse() return; rep = std::string(reinterpret_cast(msg.data()), msg.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 if (!this->dataPtr->responseReceiver->recv(msg)) #else if (!this->dataPtr->responseReceiver->recv(&msg, 0)) @@ -1115,7 +1115,7 @@ void NodeShared::SendPendingRemoteReqs(const std::string &_topic, msg.rebuild(responserId.size()); memcpy(msg.data(), responserId.data(), responserId.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->requester->send(msg, zmq::send_flags::sndmore); #else this->dataPtr->requester->send(msg, ZMQ_SNDMORE); @@ -1123,7 +1123,7 @@ void NodeShared::SendPendingRemoteReqs(const std::string &_topic, msg.rebuild(_topic.size()); memcpy(msg.data(), _topic.data(), _topic.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->requester->send(msg, zmq::send_flags::sndmore); #else this->dataPtr->requester->send(msg, ZMQ_SNDMORE); @@ -1132,7 +1132,7 @@ void NodeShared::SendPendingRemoteReqs(const std::string &_topic, msg.rebuild(this->myRequesterAddress.size()); memcpy(msg.data(), this->myRequesterAddress.data(), this->myRequesterAddress.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->requester->send(msg, zmq::send_flags::sndmore); #else this->dataPtr->requester->send(msg, ZMQ_SNDMORE); @@ -1141,7 +1141,7 @@ void NodeShared::SendPendingRemoteReqs(const std::string &_topic, std::string myId = this->responseReceiverId.ToString(); msg.rebuild(myId.size()); memcpy(msg.data(), myId.data(), myId.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->requester->send(msg, zmq::send_flags::sndmore); #else this->dataPtr->requester->send(msg, ZMQ_SNDMORE); @@ -1149,7 +1149,7 @@ void NodeShared::SendPendingRemoteReqs(const std::string &_topic, msg.rebuild(nodeUuid.size()); memcpy(msg.data(), nodeUuid.data(), nodeUuid.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->requester->send(msg, zmq::send_flags::sndmore); #else this->dataPtr->requester->send(msg, ZMQ_SNDMORE); @@ -1157,7 +1157,7 @@ void NodeShared::SendPendingRemoteReqs(const std::string &_topic, msg.rebuild(reqUuid.size()); memcpy(msg.data(), reqUuid.data(), reqUuid.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->requester->send(msg, zmq::send_flags::sndmore); #else this->dataPtr->requester->send(msg, ZMQ_SNDMORE); @@ -1165,7 +1165,7 @@ void NodeShared::SendPendingRemoteReqs(const std::string &_topic, msg.rebuild(data.size()); memcpy(msg.data(), data.data(), data.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->requester->send(msg, zmq::send_flags::sndmore); #else this->dataPtr->requester->send(msg, ZMQ_SNDMORE); @@ -1173,7 +1173,7 @@ void NodeShared::SendPendingRemoteReqs(const std::string &_topic, msg.rebuild(_reqType.size()); memcpy(msg.data(), _reqType.data(), _reqType.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->requester->send(msg, zmq::send_flags::sndmore); #else this->dataPtr->requester->send(msg, ZMQ_SNDMORE); @@ -1181,7 +1181,7 @@ void NodeShared::SendPendingRemoteReqs(const std::string &_topic, msg.rebuild(_repType.size()); memcpy(msg.data(), _repType.data(), _repType.size()); -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 this->dataPtr->requester->send(msg, zmq::send_flags::none); #else this->dataPtr->requester->send(msg, 0); @@ -1230,7 +1230,7 @@ void NodeShared::OnNewConnection(const MessagePublisher &_pub) this->dataPtr->subscriber->connect(addr.c_str()); // Add a new filter for the topic. -#ifdef IGN_CPPZMQ_POST_4_7_0 +#ifdef GZ_CPPZMQ_POST_4_7_0 this->dataPtr->subscriber->set(zmq::sockopt::subscribe, topic); #else this->dataPtr->subscriber->setsockopt(ZMQ_SUBSCRIBE, @@ -1424,7 +1424,7 @@ bool NodeShared::InitializeSockets() this->dataPtr->SecurityInit(); int lingerVal = 0; -#ifdef IGN_CPPZMQ_POST_4_7_0 +#ifdef GZ_CPPZMQ_POST_4_7_0 this->dataPtr->publisher->set(zmq::sockopt::linger, lingerVal); #else this->dataPtr->publisher->setsockopt(ZMQ_LINGER, @@ -1447,7 +1447,7 @@ bool NodeShared::InitializeSockets() } } -#ifdef IGN_CPPZMQ_POST_4_7_0 +#ifdef GZ_CPPZMQ_POST_4_7_0 this->dataPtr->subscriber->set(zmq::sockopt::rcvhwm, rcvQueueVal); #else this->dataPtr->subscriber->setsockopt(ZMQ_RCVHWM, @@ -1470,7 +1470,7 @@ bool NodeShared::InitializeSockets() } } -#ifdef IGN_CPPZMQ_POST_4_7_0 +#ifdef GZ_CPPZMQ_POST_4_7_0 this->dataPtr->publisher->set(zmq::sockopt::sndhwm, sndQueueVal); this->dataPtr->publisher->bind(anyTcpEp.c_str()); @@ -1570,7 +1570,7 @@ int NodeShared::RcvHwm() int rcvHwm; try { -#ifdef IGN_CPPZMQ_POST_4_7_0 +#ifdef GZ_CPPZMQ_POST_4_7_0 rcvHwm = this->dataPtr->subscriber->get(zmq::sockopt::rcvhwm); #else size_t rcvHwmSize = sizeof(rcvHwm); @@ -1591,7 +1591,7 @@ int NodeShared::SndHwm() int sndHwm; try { -#ifdef IGN_CPPZMQ_POST_4_7_0 +#ifdef GZ_CPPZMQ_POST_4_7_0 sndHwm = this->dataPtr->publisher->get(zmq::sockopt::sndhwm); #else size_t sndHwmSize = sizeof(sndHwm); @@ -1692,7 +1692,7 @@ void NodeSharedPrivate::SecurityOnNewConnection() // See issue #74 if (userPass(user, pass)) { -#ifdef IGN_CPPZMQ_POST_4_7_0 +#ifdef GZ_CPPZMQ_POST_4_7_0 this->subscriber->set(zmq::sockopt::plain_username, user); this->subscriber->set(zmq::sockopt::plain_password, pass); #else @@ -1717,7 +1717,7 @@ void NodeSharedPrivate::SecurityInit() int asPlainSecurityServer = static_cast( ZmqPlainSecurityServerOptions::ZMQ_PLAIN_SECURITY_SERVER_ENABLED); -#ifdef IGN_CPPZMQ_POST_4_7_0 +#ifdef GZ_CPPZMQ_POST_4_7_0 this->publisher->set(zmq::sockopt::plain_server, asPlainSecurityServer); this->publisher->set(zmq::sockopt::zap_domain, kIgnAuthDomain); #else @@ -1837,7 +1837,7 @@ void NodeSharedPrivate::AccessControlHandler() continue; } -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 sendHelper(*sock, version, zmq::send_flags::sndmore); sendHelper(*sock, sequence, zmq::send_flags::sndmore); #else @@ -1848,7 +1848,7 @@ void NodeSharedPrivate::AccessControlHandler() // Check the username and password if (givenUsername == user && givenPassword == pass) { -#ifdef IGN_ZMQ_POST_4_3_1 +#ifdef GZ_ZMQ_POST_4_3_1 sendHelper(*sock, "200", zmq::send_flags::sndmore); sendHelper(*sock, "OK", zmq::send_flags::sndmore); sendHelper(*sock, "anonymous", zmq::send_flags::sndmore); diff --git a/src/cmd/ign.cc b/src/cmd/ign.cc index 575a41dbc..e80fa3dfe 100644 --- a/src/cmd/ign.cc +++ b/src/cmd/ign.cc @@ -316,7 +316,7 @@ extern "C" void cmdTopicEcho(const char *_topic, } ////////////////////////////////////////////////// -extern "C" const char *ignitionVersion() +extern "C" const char *gzVersion() { return GZ_TRANSPORT_VERSION_FULL; } diff --git a/src/cmd/ign.hh b/src/cmd/ign.hh index 385c5b8fb..57925b1b0 100644 --- a/src/cmd/ign.hh +++ b/src/cmd/ign.hh @@ -92,6 +92,6 @@ extern "C" void cmdTopicEcho(const char *_topic, const double _duration, /// \brief External hook to read the library version. /// \return C-string representing the version. Ex.: 0.1.2 -extern "C" const char *ignitionVersion(); +extern "C" const char *gzVersion(); #endif diff --git a/src/cmd/ign_TEST.cc b/src/cmd/ign_TEST.cc index f8ea30462..df357724c 100644 --- a/src/cmd/ign_TEST.cc +++ b/src/cmd/ign_TEST.cc @@ -75,7 +75,7 @@ void topicCB(const gz::msgs::StringMsg &_msg) ////////////////////////////////////////////////// /// \brief Check 'ign topic -l' running the advertiser on a different process. -TEST(ignTest, IGN_UTILS_TEST_DISABLED_ON_MAC(TopicList)) +TEST(ignTest, GZ_UTILS_TEST_DISABLED_ON_MAC(TopicList)) { // Launch a new publisher process that advertises a topic. std::string publisher_path = testing::portablePathUnion( @@ -473,7 +473,7 @@ int main(int argc, char **argv) // Save the current value of LD_LIBRARY_PATH. std::string value = ""; gz::transport::env("LD_LIBRARY_PATH", value); - // Add the directory where ignition transport has been built. + // Add the directory where Gazebo Transport has been built. value = std::string(GZ_TEST_LIBRARY_PATH) + ":" + value; setenv("LD_LIBRARY_PATH", value.c_str(), 1); diff --git a/test/test_config.h.in b/test/test_config.h.in index 143b20799..f058564be 100644 --- a/test/test_config.h.in +++ b/test/test_config.h.in @@ -118,7 +118,7 @@ namespace testing /// Windows (CreateProcess) and the execution of the command provided. /// \param[in] _command The full system path to the binary to run into the /// new process. - /// \param[in] _partition Name of the ignition partition (GZ_PARTITION) + /// \param[in] _partition Name of the Gazebo partition (GZ_PARTITION) /// \param[in] _username Username for authentication /// (GZ_TRANSPORT_USERNAME) /// \param[in] _password Password for authentication @@ -136,18 +136,18 @@ namespace testing char cmd[500]; // We should put quotes around the _command string to make sure we are // robust to file paths that contain spaces. - ign_strcpy(cmd, "\""); - ign_strcat(cmd, _command); - ign_strcat(cmd, "\""); - ign_strcat(cmd, " "); - ign_strcat(cmd, _partition); + gz_strcpy(cmd, "\""); + gz_strcat(cmd, _command); + gz_strcat(cmd, "\""); + gz_strcat(cmd, " "); + gz_strcat(cmd, _partition); if (_username && _password) { - ign_strcat(cmd, " "); - ign_strcat(cmd, _username); - ign_strcat(cmd, " "); - ign_strcat(cmd, _password); + gz_strcat(cmd, " "); + gz_strcat(cmd, _username); + gz_strcat(cmd, " "); + gz_strcat(cmd, _password); } // We set the first argument to NULL, because we want the behavior that