diff --git a/src/cpp/rtps/builtin/data/ReaderProxyData.hpp b/src/cpp/rtps/builtin/data/ReaderProxyData.hpp index c832cace9f7..80b44b0c893 100644 --- a/src/cpp/rtps/builtin/data/ReaderProxyData.hpp +++ b/src/cpp/rtps/builtin/data/ReaderProxyData.hpp @@ -125,6 +125,12 @@ class ReaderProxyData void set_announced_unicast_locators( const LocatorList_t& locators); + /** + * Set the remote unicast locators from @param locators. + * @param locators List of locators to be used + * @param network NetworkFactory to check if the locators are allowed + * @param from_this_host Whether the server is from this host or not + */ void set_remote_unicast_locators( const LocatorList_t& locators, const NetworkFactory& network, @@ -133,6 +139,12 @@ class ReaderProxyData void add_multicast_locator( const Locator_t& locator); + /** + * Set the remote multicast locators from @param locators. + * @param locators List of locators to be used + * @param network NetworkFactory to check if the locators are allowed + * @param from_this_host Whether the server is from this host or not + */ void set_multicast_locators( const LocatorList_t& locators, const NetworkFactory& network, @@ -141,6 +153,13 @@ class ReaderProxyData void set_locators( const RemoteLocatorList& locators); + /** + * Set the remote multicast and unicast locators from @param locators. + * @param locators List of locators to be used + * @param network NetworkFactory to check if the locators are allowed + * @param use_multicast_locators Whether to set multicast locators or not + * @param from_this_host Whether the server is from this host or not + */ void set_remote_locators( const RemoteLocatorList& locators, const NetworkFactory& network, @@ -436,7 +455,7 @@ class ReaderProxyData /** * Transform and set the remote locators from the remote_locators_ of another ReaderProxyData. - * If the received WriterProxyData has no locators, remote locators will be extracted from the + * If the received ReaderProxyData has no locators, remote locators will be extracted from the * ParticipantProxyData. * @param rdata ReaderProxyData to get the locators from * @param network NetworkFactory to transform locators @@ -491,8 +510,6 @@ class ReaderProxyData //!GUID GUID_t m_guid; - //!HOST ID - fastcdr::string_255 machine_id; //!Network configuration NetworkConfigSet_t m_networkConfiguration; //!Holds locator information diff --git a/src/cpp/rtps/builtin/data/WriterProxyData.cpp b/src/cpp/rtps/builtin/data/WriterProxyData.cpp index 71371303327..0b1115d7e4c 100644 --- a/src/cpp/rtps/builtin/data/WriterProxyData.cpp +++ b/src/cpp/rtps/builtin/data/WriterProxyData.cpp @@ -1099,7 +1099,7 @@ void WriterProxyData::setup_locators( if (wdata.has_locators()) { - // Get the transformed remote locators for the ReaderProxyData received + // Get the transformed remote locators for the WriterProxyData received remote_locators_.unicast.clear(); remote_locators_.multicast.clear(); for (const Locator_t& locator : wdata.remote_locators_.unicast) diff --git a/src/cpp/rtps/builtin/data/WriterProxyData.hpp b/src/cpp/rtps/builtin/data/WriterProxyData.hpp index c199b262a6c..8a5c53c3d1c 100644 --- a/src/cpp/rtps/builtin/data/WriterProxyData.hpp +++ b/src/cpp/rtps/builtin/data/WriterProxyData.hpp @@ -151,6 +151,12 @@ class WriterProxyData void set_announced_unicast_locators( const LocatorList_t& locators); + /** + * Set the remote unicast locators from @param locators. + * @param locators List of locators to be used + * @param network NetworkFactory to check if the locators are allowed + * @param from_this_host Whether the server is from this host or not + */ void set_remote_unicast_locators( const LocatorList_t& locators, const NetworkFactory& network, @@ -159,6 +165,12 @@ class WriterProxyData void add_multicast_locator( const Locator_t& locator); + /** + * Set the remote multicast locators from @param locators. + * @param locators List of locators to be used + * @param network NetworkFactory to check if the locators are allowed + * @param from_this_host Whether the server is from this host or not + */ void set_multicast_locators( const LocatorList_t& locators, const NetworkFactory& network, @@ -167,6 +179,13 @@ class WriterProxyData void set_locators( const RemoteLocatorList& locators); + /** + * Set the remote multicast and unicast locators from @param locators. + * @param locators List of locators to be used + * @param network NetworkFactory to check if the locators are allowed + * @param use_multicast_locators Whether to set multicast locators or not + * @param from_this_host Whether the server is from this host or not + */ void set_remote_locators( const RemoteLocatorList& remote_locators, const NetworkFactory& network, @@ -452,7 +471,13 @@ class WriterProxyData CDRMessage_t* msg, bool write_encapsulation) const; - //!Read a parameter list from a CDRMessage_t. + /** + * Read the information from a CDRMessage_t. The position of the message must be in the beginning on the + * parameter list. + * @param msg Pointer to the message. + * @param source_vendor_id VendorId of the source participant from which the message was received + * @return true on success + */ bool readFromCDRMessage( CDRMessage_t* msg, fastdds::rtps::VendorId_t source_vendor_id = c_VendorId_eProsima); @@ -475,9 +500,6 @@ class WriterProxyData //!GUID GUID_t m_guid; - //!HOST ID - fastcdr::string_255 machine_id; - //!Network configuration NetworkConfigSet_t m_networkConfiguration; diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPClient.h b/src/cpp/rtps/builtin/discovery/participant/PDPClient.h index e0b1705fdf7..7a81fb93ee8 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPClient.h +++ b/src/cpp/rtps/builtin/discovery/participant/PDPClient.h @@ -167,6 +167,8 @@ class PDPClient : public PDP * Manually match the local PDP reader with the PDP writer of a given server. The function is * not thread safe (nts) in the sense that it does not take the PDP mutex. It does however take * temp_data_lock_ + * @param server_att Remote server attributes + * @param from_this_host Whether the server is from this host or not */ void match_pdp_writer_nts_( const eprosima::fastdds::rtps::RemoteServerAttributes& server_att, @@ -176,6 +178,8 @@ class PDPClient : public PDP * Manually match the local PDP writer with the PDP reader of a given server. The function is * not thread safe (nts) in the sense that it does not take the PDP mutex. It does however take * temp_data_lock_ + * @param server_att Remote server attributes + * @param from_this_host Whether the server is from this host or not */ void match_pdp_reader_nts_( const eprosima::fastdds::rtps::RemoteServerAttributes& server_att, @@ -189,6 +193,9 @@ class PDPClient : public PDP * Manually match the local PDP reader with the PDP writer of a given server. The function is * not thread safe (nts) in the sense that it does not take the PDP mutex. It does however take * temp_data_lock_ + * @param server_att Remote server attributes + * @param prefix_override GUID prefix of the server + * @param from_this_host Whether the server is from this host or not */ void match_pdp_writer_nts_( const eprosima::fastdds::rtps::RemoteServerAttributes& server_att, @@ -199,6 +206,9 @@ class PDPClient : public PDP * Manually match the local PDP writer with the PDP reader of a given server. The function is * not thread safe (nts) in the sense that it does not take the PDP mutex. It does however take * temp_data_lock_ + * @param server_att Remote server attributes + * @param prefix_override GUID prefix of the server + * @param from_this_host Whether the server is from this host or not */ void match_pdp_reader_nts_( const eprosima::fastdds::rtps::RemoteServerAttributes& server_att, diff --git a/src/cpp/utils/Host.cpp b/src/cpp/utils/Host.cpp index ba76ed16e5d..92729d53281 100644 --- a/src/cpp/utils/Host.cpp +++ b/src/cpp/utils/Host.cpp @@ -42,7 +42,7 @@ fastcdr::string_255 Host::compute_machine_id() NULL, machine_id, &BufferSize); if (res == 0) { - return std::string(machine_id); + return machine_id; } return ""; #elif defined(__APPLE__) @@ -65,7 +65,7 @@ fastcdr::string_255 Host::compute_machine_id() return ""; } CFRelease(uuidCf); - return std::string(buf, sizeof(buf)); + return fastcdr::string_255(buf, sizeof(buf)); #elif defined(_POSIX_SOURCE) int fd = open("/etc/machine-id", O_RDONLY); if (fd == -1) @@ -82,7 +82,7 @@ fastcdr::string_255 Host::compute_machine_id() return ""; } - return std::string(buffer, 32); + return fastcdr::string_255(buffer, 32); #else return ""; #endif // if defined(_WIN32)