Skip to content

Commit

Permalink
Refs #22056: Review - Doxydoc & minor fixes
Browse files Browse the repository at this point in the history
Signed-off-by: cferreiragonz <[email protected]>
  • Loading branch information
cferreiragonz committed Nov 12, 2024
1 parent 2e4f6e0 commit 6bbd2cd
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 11 deletions.
23 changes: 20 additions & 3 deletions src/cpp/rtps/builtin/data/ReaderProxyData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/builtin/data/WriterProxyData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
30 changes: 26 additions & 4 deletions src/cpp/rtps/builtin/data/WriterProxyData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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);
Expand All @@ -475,9 +500,6 @@ class WriterProxyData
//!GUID
GUID_t m_guid;

//!HOST ID
fastcdr::string_255 machine_id;

//!Network configuration
NetworkConfigSet_t m_networkConfiguration;

Expand Down
10 changes: 10 additions & 0 deletions src/cpp/rtps/builtin/discovery/participant/PDPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/utils/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 6bbd2cd

Please sign in to comment.