Skip to content

Commit

Permalink
Fix hidden overloaded virtual methods (#4516)
Browse files Browse the repository at this point in the history
* Refs #20592: Fix for test

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20592: Fix for examples

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20592: Add more warning flags to Ubuntu CI

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20592: Remove default values on overloaded PDPClient::announceParticipantState

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz authored Mar 20, 2024
1 parent bdef74e commit 63cc242
Show file tree
Hide file tree
Showing 41 changed files with 146 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reusable-ubuntu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.meta
colcon_build_args: ${{ inputs.colcon-args }}
cmake_args: ${{ inputs.cmake-args }}
cmake_args_default: -DCMAKE_CXX_FLAGS="-Werror -Wall" -DFASTDDS_EXAMPLE_TESTS=ON
cmake_args_default: -DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-value -Woverloaded-virtual" -DFASTDDS_EXAMPLE_TESTS=ON
cmake_build_type: ${{ matrix.cmake-build-type }}
workspace: ${{ github.workspace }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ class HelloWorldPublisher

private:

using eprosima::fastdds::dds::DomainParticipantListener::on_participant_discovery;

//! Number of DataReaders matched to the associated DataWriter
std::atomic<std::uint32_t> matched_;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ class DiscoveryServer
void on_participant_discovery(
eprosima::fastdds::dds::DomainParticipant* /*participant*/,
eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override;

private:

using eprosima::fastdds::dds::DomainParticipantListener::on_participant_discovery;
}
listener_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class HelloWorldSubscriber

private:

using eprosima::fastdds::dds::DomainParticipantListener::on_participant_discovery;

HelloWorld hello_;

//! Number of DataWriters matched to the associated DataReader
Expand Down
6 changes: 6 additions & 0 deletions examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,15 @@ class LivelinessSubscriber

class PartListener : public eprosima::fastdds::dds::DomainParticipantListener
{
public:

virtual void on_participant_discovery(
eprosima::fastdds::dds::DomainParticipant* participant,
eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override;

private:

using eprosima::fastdds::dds::DomainParticipantListener::on_participant_discovery;
};

PartListener part_listener_;
Expand Down
4 changes: 4 additions & 0 deletions examples/cpp/rtps/Persistent/TestReaderPersistent.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class TestReaderPersistent

uint32_t n_received;
uint32_t n_matched;

private:

using eprosima::fastrtps::rtps::ReaderListener::onReaderMatched;
}
m_listener;
};
Expand Down
4 changes: 4 additions & 0 deletions examples/cpp/rtps/Persistent/TestWriterPersistent.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class TestWriterPersistent
}

int n_matched;

private:

using eprosima::fastrtps::rtps::WriterListener::onWriterMatched;
}
m_listener;
};
Expand Down
4 changes: 4 additions & 0 deletions examples/cpp/rtps/Registered/TestReaderRegistered.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class TestReaderRegistered

uint32_t n_received;
uint32_t n_matched;

private:

using eprosima::fastrtps::rtps::ReaderListener::onReaderMatched;
}
m_listener;
};
Expand Down
4 changes: 4 additions & 0 deletions examples/cpp/rtps/Registered/TestWriterRegistered.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class TestWriterRegistered
}

int n_matched;

private:

using eprosima::fastrtps::rtps::WriterListener::onWriterMatched;
}
m_listener;
};
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/rtps/builtin/discovery/participant/PDPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class PDPClient : public PDP
*/
void announceParticipantState(
bool new_change,
bool dispose = false,
WriteParams& wparams = WriteParams::WRITE_PARAM_DEFAULT) override;
bool dispose,
WriteParams& wparams) override;

/**
* These methods wouldn't be needed under perfect server operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ bool DSClientEvent::event()
// This marks to announceParticipantState that the announcement is only meant for missing servers,
// so it is not a periodic announcement
mp_PDP->_serverPing = true;
mp_PDP->announceParticipantState(false);
WriteParams __wp = WriteParams::write_params_default();
mp_PDP->announceParticipantState(false, false, __wp);
EPROSIMA_LOG_INFO(CLIENT_PDP_THREAD,
"Client " << mp_PDP->getRTPSParticipant()->getGuid() << " PDP announcement");
}
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox/api/dds-pim/PubSubParticipant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ class PubSubParticipant

private:

using eprosima::fastdds::dds::DomainParticipantListener::on_participant_discovery;

ParticipantListener& operator =(
const ParticipantListener&) = delete;
PubSubParticipant* participant_;
Expand Down
3 changes: 3 additions & 0 deletions test/blackbox/api/dds-pim/PubSubReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ class PubSubReader

private:

using eprosima::fastdds::dds::DomainParticipantListener::on_participant_discovery;
using eprosima::fastdds::dds::DomainParticipantListener::on_publisher_discovery;

ParticipantListener& operator =(
const ParticipantListener&) = delete;
PubSubReader& reader_;
Expand Down
4 changes: 4 additions & 0 deletions test/blackbox/api/dds-pim/PubSubWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ class PubSubWriter

private:

using eprosima::fastdds::dds::DomainParticipantListener::on_participant_discovery;
using eprosima::fastdds::dds::DomainParticipantListener::on_publisher_discovery;
using eprosima::fastdds::dds::DomainParticipantListener::on_subscriber_discovery;

ParticipantListener& operator =(
const ParticipantListener&) = delete;

Expand Down
4 changes: 4 additions & 0 deletions test/blackbox/api/dds-pim/PubSubWriterReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ class PubSubWriterReader

private:

using eprosima::fastdds::dds::DomainParticipantListener::on_participant_discovery;
using eprosima::fastdds::dds::DomainParticipantListener::on_publisher_discovery;
using eprosima::fastdds::dds::DomainParticipantListener::on_subscriber_discovery;

//! Mutex guarding all info collections
mutable std::mutex info_mutex_;
//! The discovered participants excluding the participant this listener is listening to
Expand Down
7 changes: 6 additions & 1 deletion test/blackbox/common/DDSBlackboxTestsBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,10 @@ TEST(DDSBasic, PidRelatedSampleIdentity)
TEST(DDSBasic, IgnoreParticipant)
{

struct IgnoringDomainParticipantListener : public DomainParticipantListener
class IgnoringDomainParticipantListener : public DomainParticipantListener
{
public:

std::atomic_int num_matched{0};
std::atomic_int num_ignored{0};

Expand All @@ -505,6 +507,9 @@ TEST(DDSBasic, IgnoreParticipant)
}
}

private:

using DomainParticipantListener::on_participant_discovery;
};
// Set DomainParticipantFactory to create disabled entities
DomainParticipantFactoryQos factory_qos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class MockHelloWorldPubSubType : public HelloWorldPubSubType
static eprosima::fastcdr::EncodingAlgorithmFlag last_encoding;

static DataRepresentationId_t last_data_representation;

private:

using HelloWorldPubSubType::serialize;
};

eprosima::fastcdr::EncodingAlgorithmFlag
Expand Down
6 changes: 6 additions & 0 deletions test/blackbox/common/DDSBlackboxTestsDiscovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ TEST(DDSDiscovery, ParticipantProxyPhysicalData)

private:

using DomainParticipantListener::on_participant_discovery;

std::condition_variable* cv_;

std::mutex* mtx_;
Expand Down Expand Up @@ -598,6 +600,8 @@ TEST(DDSDiscovery, DDSDiscoveryDoesNotDropUDPLocator)

struct CustomDomainParticipantListener : public DomainParticipantListener
{
using DomainParticipantListener::on_participant_discovery;

std::mutex mtx;
std::condition_variable cv;
GUID_t guid;
Expand Down Expand Up @@ -1653,6 +1657,8 @@ TEST(DDSDiscovery, DataracePDP)
{
public:

using DomainParticipantListener::on_participant_discovery;

CustomDomainParticipantListener()
: DomainParticipantListener()
, discovery_future(discovery_promise.get_future())
Expand Down
8 changes: 7 additions & 1 deletion test/blackbox/common/DDSBlackboxTestsFindTopic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ class DDSFindTopicTest : public testing::Test
/**
* A dummy type support class.
*/
struct TestType : public TopicDataType
class TestType : public TopicDataType
{
public:

TestType()
: TopicDataType()
{
Expand Down Expand Up @@ -96,6 +98,10 @@ class DDSFindTopicTest : public testing::Test
return false;
}

private:

using TopicDataType::getSerializedSizeProvider;
using TopicDataType::serialize;
};

public:
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox/common/RTPSWithRegistrationReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ class RTPSWithRegistrationReader

private:

using eprosima::fastrtps::rtps::ReaderListener::onReaderMatched;

Listener& operator =(
const Listener&) = delete;

Expand Down
2 changes: 2 additions & 0 deletions test/blackbox/common/RTPSWithRegistrationWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ class RTPSWithRegistrationWriter

private:

using eprosima::fastrtps::rtps::WriterListener::onWriterMatched;

Listener& operator =(
const Listener&) = delete;

Expand Down
2 changes: 2 additions & 0 deletions test/dds/communication/PublisherDynamic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class ParListener : public DomainParticipantListener

private:

using DomainParticipantListener::on_participant_discovery;

bool exit_on_lost_liveliness_;
};

Expand Down
2 changes: 2 additions & 0 deletions test/dds/communication/PublisherModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class PublisherModule

private:

using DomainParticipantListener::on_participant_discovery;

std::mutex mutex_;
std::condition_variable cv_;
unsigned int matched_ = 0;
Expand Down
2 changes: 2 additions & 0 deletions test/dds/communication/SubscriberDynamic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class ParListener : public DomainParticipantListener

private:

using DomainParticipantListener::on_participant_discovery;

std::promise<topic_type_names> is_worth_a_type_;
};

Expand Down
2 changes: 2 additions & 0 deletions test/dds/communication/SubscriberModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class SubscriberModule

private:

using DomainParticipantListener::on_participant_discovery;

std::mutex mutex_;
std::condition_variable cv_;
const uint32_t publishers_ = 0;
Expand Down
2 changes: 2 additions & 0 deletions test/dds/communication/security/PublisherModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class PublisherModule

private:

using DomainParticipantListener::on_participant_discovery;

std::mutex mutex_;
std::condition_variable cv_;
unsigned int matched_ = 0;
Expand Down
2 changes: 2 additions & 0 deletions test/dds/communication/security/SubscriberModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class SubscriberModule

private:

using DomainParticipantListener::on_participant_discovery;

std::mutex mutex_;
std::condition_variable cv_;
const uint32_t publishers_ = 0;
Expand Down
2 changes: 2 additions & 0 deletions test/dds/discovery/ParticipantModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class ParticipantModule : public DomainParticipantListener

private:

using DomainParticipantListener::on_participant_discovery;

unsigned int matched_ = 0;
DomainParticipant* participant_ = nullptr;
DiscoveryProtocol_t discovery_protocol_;
Expand Down
4 changes: 4 additions & 0 deletions test/performance/latency/LatencyTestTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ class LatencyDataType : public eprosima::fastdds::dds::TopicDataType

// Name
static const std::string type_name_;

private:

using eprosima::fastrtps::TopicDataType::is_plain;
};

enum TESTCOMMAND : uint32_t
Expand Down
4 changes: 4 additions & 0 deletions test/performance/throughput/ThroughputTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ class ThroughputDataType : public eprosima::fastrtps::TopicDataType

// Name
static const std::string type_name_;

private:

using eprosima::fastrtps::TopicDataType::is_plain;
};

enum e_Command : uint32_t
Expand Down
5 changes: 5 additions & 0 deletions test/unittest/dds/participant/ParticipantTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ class LoanableTopicDataTypeMock : public TopicDataType
return true;
}

private:

using TopicDataType::is_plain;
};

class BarType
Expand Down Expand Up @@ -2479,6 +2482,8 @@ class CustomListener2 : public DomainParticipantListener
{
public:

using DomainParticipantListener::on_participant_discovery;

CustomListener2()
: future_(promise_.get_future())
{
Expand Down
7 changes: 7 additions & 0 deletions test/unittest/dds/publisher/DataWriterTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ TEST(DataWriterTests, get_guid)
fastrtps::rtps::GUID_t guid;
std::mutex mutex;
std::condition_variable cv;

private:

using DomainParticipantListener::on_publisher_discovery;
}
discovery_listener;

Expand Down Expand Up @@ -1320,6 +1324,7 @@ class LoanableTypeSupport : public TopicDataType
public:

typedef LoanableType type;
using TopicDataType::is_plain;

LoanableTypeSupport()
: TopicDataType()
Expand Down Expand Up @@ -1494,6 +1499,8 @@ class LoanableTypeSupportTesting : public LoanableTypeSupport
{
public:

using LoanableTypeSupport::is_plain;

bool is_plain_result = true;
bool construct_sample_result = true;

Expand Down
Loading

0 comments on commit 63cc242

Please sign in to comment.