Skip to content

Commit

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

Signed-off-by: EduPonz <[email protected]>

* Refs #20592: Fix for examples

Signed-off-by: EduPonz <[email protected]>

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

Signed-off-by: EduPonz <[email protected]>

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

Signed-off-by: EduPonz <[email protected]>

---------

Signed-off-by: EduPonz <[email protected]>
(cherry picked from commit 63cc242)
  • Loading branch information
EduPonz committed Apr 3, 2024
1 parent 39b3d58 commit a8125c3
Show file tree
Hide file tree
Showing 36 changed files with 258 additions and 82 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 @@ -105,7 +105,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"
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
6 changes: 6 additions & 0 deletions examples/C++/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
31 changes: 25 additions & 6 deletions examples/C++/RTPSTest_persistent/TestReaderPersistent.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
class TestReaderPersistent
{
public:

TestReaderPersistent();
virtual ~TestReaderPersistent();
eprosima::fastrtps::rtps::RTPSParticipant* mp_participant;
Expand All @@ -36,23 +37,41 @@ class TestReaderPersistent
bool init(); //Initialization
bool reg(); //Register
void run(); //Run
class MyListener:public eprosima::fastrtps::rtps::ReaderListener
class MyListener : public eprosima::fastrtps::rtps::ReaderListener
{
public:
MyListener():n_received(0),n_matched(0){};
~MyListener(){};

MyListener()
: n_received(0)
, n_matched(0)
{
}

~MyListener()
{
}

void onNewCacheChangeAdded(
eprosima::fastrtps::rtps::RTPSReader* reader,
const eprosima::fastrtps::rtps::CacheChange_t* const change) override;
void onReaderMatched(
eprosima::fastrtps::rtps::RTPSReader*,
eprosima::fastrtps::rtps::MatchingInfo& info) override
{
if(info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) n_matched++;
};
if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING)
{
n_matched++;
}
}

uint32_t n_received;
uint32_t n_matched;
}m_listener;

private:

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

#endif /* TESTREADERPERSISTENT_H_ */
31 changes: 25 additions & 6 deletions examples/C++/RTPSTest_persistent/TestWriterPersistent.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,49 @@

#include <fastrtps/rtps/writer/WriterListener.h>

class TestWriterPersistent {
class TestWriterPersistent
{
public:

TestWriterPersistent();
virtual ~TestWriterPersistent();
eprosima::fastrtps::rtps::RTPSParticipant* mp_participant;
eprosima::fastrtps::rtps::RTPSWriter* mp_writer;
eprosima::fastrtps::rtps::WriterHistory* mp_history;
bool init(); //Initialize writer
bool reg(); //Register the Writer
void run(uint16_t samples); //Run the Writer
class MyListener :public eprosima::fastrtps::rtps::WriterListener
void run(
uint16_t samples); //Run the Writer
class MyListener : public eprosima::fastrtps::rtps::WriterListener
{
public:
MyListener():n_matched(0){};
~MyListener(){};

MyListener()
: n_matched(0)
{
}

~MyListener()
{
}

void onWriterMatched(
eprosima::fastrtps::rtps::RTPSWriter*,
eprosima::fastrtps::rtps::MatchingInfo& info) override
{
if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING)
{
++n_matched;
}
}

int n_matched;
}m_listener;

private:

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

#endif /* TESTWRITERPERSISTENT_H_ */
31 changes: 25 additions & 6 deletions examples/C++/RTPSTest_registered/TestReaderRegistered.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
class TestReaderRegistered
{
public:

TestReaderRegistered();
virtual ~TestReaderRegistered();
eprosima::fastrtps::rtps::RTPSParticipant* mp_participant;
Expand All @@ -36,23 +37,41 @@ class TestReaderRegistered
bool init(); //Initialization
bool reg(); //Register
void run(); //Run
class MyListener:public eprosima::fastrtps::rtps::ReaderListener
class MyListener : public eprosima::fastrtps::rtps::ReaderListener
{
public:
MyListener():n_received(0),n_matched(0){};
~MyListener(){};

MyListener()
: n_received(0)
, n_matched(0)
{
}

~MyListener()
{
}

void onNewCacheChangeAdded(
eprosima::fastrtps::rtps::RTPSReader* reader,
const eprosima::fastrtps::rtps::CacheChange_t* const change) override;
void onReaderMatched(
eprosima::fastrtps::rtps::RTPSReader*,
eprosima::fastrtps::rtps::MatchingInfo& info) override
{
if(info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) n_matched++;
};
if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING)
{
n_matched++;
}
}

uint32_t n_received;
uint32_t n_matched;
}m_listener;

private:

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

#endif /* TESTREADER_H_ */
31 changes: 25 additions & 6 deletions examples/C++/RTPSTest_registered/TestWriterRegistered.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,49 @@

#include "fastrtps/rtps/writer/WriterListener.h"

class TestWriterRegistered {
class TestWriterRegistered
{
public:

TestWriterRegistered();
virtual ~TestWriterRegistered();
eprosima::fastrtps::rtps::RTPSParticipant* mp_participant;
eprosima::fastrtps::rtps::RTPSWriter* mp_writer;
eprosima::fastrtps::rtps::WriterHistory* mp_history;
bool init(); //Initialize writer
bool reg(); //Register the Writer
void run(uint16_t samples); //Run the Writer
class MyListener :public eprosima::fastrtps::rtps::WriterListener
void run(
uint16_t samples); //Run the Writer
class MyListener : public eprosima::fastrtps::rtps::WriterListener
{
public:
MyListener():n_matched(0){};
~MyListener(){};

MyListener()
: n_matched(0)
{
}

~MyListener()
{
}

void onWriterMatched(
eprosima::fastrtps::rtps::RTPSWriter*,
eprosima::fastrtps::rtps::MatchingInfo& info) override
{
if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING)
{
++n_matched;
}
}

int n_matched;
}m_listener;

private:

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

#endif /* TESTWRITER_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,49 @@
#include <string>
#include <list>

class my_ReaderListener: public eprosima::fastrtps::rtps::ReaderListener
class my_ReaderListener : public eprosima::fastrtps::rtps::ReaderListener
{
public:
int n_received;
my_ReaderListener();
~my_ReaderListener() override;
void onNewCacheChangeAdded(
eprosima::fastrtps::rtps::RTPSReader* reader,
const eprosima::fastrtps::rtps::CacheChange_t* const change) override;
public:

void onReaderMatched(
eprosima::fastrtps::rtps::RTPSReader* reader,
eprosima::fastrtps::rtps::MatchingInfo& info) override;
int n_received;
my_ReaderListener();
~my_ReaderListener() override;
void onNewCacheChangeAdded(
eprosima::fastrtps::rtps::RTPSReader* reader,
const eprosima::fastrtps::rtps::CacheChange_t* const change) override;

void onReaderMatched(
eprosima::fastrtps::rtps::RTPSReader* reader,
eprosima::fastrtps::rtps::MatchingInfo& info) override;

private:

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

class UserDefinedTransportExampleReader
{
private:
my_ReaderListener *my_listener;
public:
UserDefinedTransportExampleReader();
~UserDefinedTransportExampleReader();
void init();
bool isInitialized();
bool read();
private:
eprosima::fastrtps::rtps::RTPSParticipantAttributes pattr;
eprosima::fastrtps::rtps::RTPSParticipant *my_participant;
eprosima::fastrtps::rtps::ReaderAttributes rattr;
eprosima::fastrtps::rtps::RTPSReader *my_reader;
eprosima::fastrtps::rtps::HistoryAttributes hattr;
eprosima::fastrtps::ReaderQos rqos;
eprosima::fastrtps::TopicAttributes tattr;
eprosima::fastrtps::rtps::ReaderHistory *my_history;
bool initialized_;
private:

my_ReaderListener* my_listener;

public:

UserDefinedTransportExampleReader();
~UserDefinedTransportExampleReader();
void init();
bool isInitialized();
bool read();

private:

eprosima::fastrtps::rtps::RTPSParticipantAttributes pattr;
eprosima::fastrtps::rtps::RTPSParticipant* my_participant;
eprosima::fastrtps::rtps::ReaderAttributes rattr;
eprosima::fastrtps::rtps::RTPSReader* my_reader;
eprosima::fastrtps::rtps::HistoryAttributes hattr;
eprosima::fastrtps::ReaderQos rqos;
eprosima::fastrtps::TopicAttributes tattr;
eprosima::fastrtps::rtps::ReaderHistory* my_history;
bool initialized_;
};
Loading

0 comments on commit a8125c3

Please sign in to comment.