Skip to content

Commit

Permalink
Remove WriterProxyData from public APIs (#95)
Browse files Browse the repository at this point in the history
* Refs #21301. Remove `WriterProxyData` from public APIs.

Signed-off-by: Miguel Company <[email protected]>

* Refs #21301. Rename enum to `WriterDiscoveryStatus`.

Signed-off-by: Miguel Company <[email protected]>

* Refs #21301. Rename header to `WriterDiscoveryStatus.hpp`.

Signed-off-by: Miguel Company <[email protected]>

* Refs #21301. Use `fastcdr::string_255`.

Signed-off-by: Miguel Company <[email protected]>

---------

Signed-off-by: Miguel Company <[email protected]>
  • Loading branch information
MiguelCompany authored Jul 17, 2024
1 parent f30ceca commit 1cebd03
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
5 changes: 3 additions & 2 deletions include/DiscoveryServerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ class DiscoveryServerManager

void on_data_writer_discovery(
DomainParticipant* participant,
WriterDiscoveryInfo&& info,
rtps::WriterDiscoveryStatus reason,
const PublicationBuiltinTopicData& info,
bool& should_be_ignored) override;

// callback liveliness functions
Expand Down Expand Up @@ -343,7 +344,7 @@ std::ostream& operator <<(
ReaderDiscoveryInfo::DISCOVERY_STATUS);
std::ostream& operator <<(
std::ostream&,
WriterDiscoveryInfo::DISCOVERY_STATUS);
WriterDiscoveryStatus);

} // namespace discovery_server
} // namespace eprosima
Expand Down
27 changes: 15 additions & 12 deletions src/DiscoveryServerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@

#include <tinyxml2.h>

#include <fastdds/dds/builtin/topic/PublicationBuiltinTopicData.hpp>
#include <fastdds/dds/domain/DomainParticipant.hpp>
#include <fastdds/rtps/RTPSDomain.hpp>
#include <fastdds/rtps/transport/UDPv4TransportDescriptor.hpp>
#include <fastdds/rtps/transport/TCPv4TransportDescriptor.hpp>
#include <fastdds/rtps/transport/TCPv6TransportDescriptor.hpp>
#include <fastdds/rtps/writer/WriterDiscoveryStatus.hpp>

#include "DiscoveryServerManager.h"
#include "IDs.h"
Expand Down Expand Up @@ -1720,11 +1722,12 @@ void DiscoveryServerManager::on_data_reader_discovery(

void DiscoveryServerManager::on_data_writer_discovery(
DomainParticipant* participant,
WriterDiscoveryInfo&& info,
rtps::WriterDiscoveryStatus reason,
const PublicationBuiltinTopicData& info,
bool& should_be_ignored)
{
static_cast<void>(should_be_ignored);
typedef WriterDiscoveryInfo::DISCOVERY_STATUS DS;
should_be_ignored = false;
typedef WriterDiscoveryStatus DS;

// if the callback origin was removed ignore
GUID_t srcGuid = participant->guid();
Expand All @@ -1735,8 +1738,8 @@ void DiscoveryServerManager::on_data_writer_discovery(
return;
}

const GUID_t& pubsid = info.info.guid();
GUID_t partid = iHandle2GUID(info.info.RTPSParticipantKey());
const GUID_t& pubsid = info.guid;
GUID_t partid = info.participant_guid;

// non reported info
std::string part_name;
Expand Down Expand Up @@ -1781,16 +1784,16 @@ void DiscoveryServerManager::on_data_writer_discovery(
part_name = ss.str();
}

switch (info.status)
switch (reason)
{
case DS::DISCOVERED_WRITER:

state.AddDataWriter(srcGuid,
srcName,
partid,
pubsid,
info.info.typeName().to_string(),
info.info.topicName().to_string(),
info.type_name.to_string(),
info.topic_name.to_string(),
callback_time);
break;
case DS::REMOVED_WRITER:
Expand All @@ -1802,8 +1805,8 @@ void DiscoveryServerManager::on_data_writer_discovery(
}

LOG_INFO("Participant " << participant->get_qos().name().to_string() << " reports a publisher of participant "
<< part_name << " is " << info.status << " with typename: " << info.info.typeName()
<< " topic: " << info.info.topicName() << " GUID: " << pubsid);
<< part_name << " is " << reason << " with typename: " << info.type_name
<< " topic: " << info.topic_name << " GUID: " << pubsid);
}

void DiscoveryServerManager::on_liveliness_changed(
Expand Down Expand Up @@ -1859,9 +1862,9 @@ std::ostream& eprosima::discovery_server::operator <<(

std::ostream& eprosima::discovery_server::operator <<(
std::ostream& o,
WriterDiscoveryInfo::DISCOVERY_STATUS s)
WriterDiscoveryStatus s)
{
typedef WriterDiscoveryInfo::DISCOVERY_STATUS DS;
typedef WriterDiscoveryStatus DS;

switch (s)
{
Expand Down

0 comments on commit 1cebd03

Please sign in to comment.