Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21120] RTPS reader APIs refactor #4875

Merged
merged 79 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
9fd534f
Refs #21082. Add `BaseReader` alias.
MiguelCompany May 28, 2024
b02afe5
Refs #21082. Refactor on `StatefulReader`.
MiguelCompany May 28, 2024
4ada7ea
Refs #21082. Refactor on `StatelessReader`.
MiguelCompany May 28, 2024
7cee807
Refs #21082. Refactor on `ListenerTests`.
MiguelCompany May 28, 2024
bc47259
Refs #21082. Refactor on `MessageReceiver`.
MiguelCompany May 28, 2024
511df83
Refs #21082. Refactor on `RTPSMessageGroup`.
MiguelCompany May 28, 2024
596874f
Refs #21082. Refactor on `StatisticsReaderImpl`.
MiguelCompany May 28, 2024
6fbbfc5
Refs #21082. Refactor on writers (intraprocess).
MiguelCompany May 28, 2024
84eeb7f
Refs #21082. Turn `BaseReader` into a class.
MiguelCompany May 28, 2024
632e29f
Refs #21082. Move `BaseReader` into its own private header.
MiguelCompany May 28, 2024
7f0d1fc
Refs #21082. Move `StatisticsReaderImpl` to `BaseReader`.
MiguelCompany May 28, 2024
301c463
Refs #21082. Move `BaseReader` implementation to source file.
MiguelCompany May 28, 2024
adf574e
Refs #21082. Refactor on `DataSharingListener`.
MiguelCompany May 28, 2024
34a691a
Refs #21082. Move submessage processing to `BaseReader`.
MiguelCompany May 28, 2024
1539a1f
Refs #21082. Remove friend `MessageReceiver`.
MiguelCompany May 29, 2024
7ff4add
Refs #21082. Remove friend `RTPSParticipantImpl`.
MiguelCompany May 29, 2024
7e22876
Refs #21082. Remove friend `EDP`.
MiguelCompany May 29, 2024
7775696
Refs #21082. Remove friend `WLP`.
MiguelCompany May 29, 2024
a28b12f
Refs #21082. Remove friend `ReaderHistory`.
MiguelCompany May 29, 2024
43412f3
Refs #21082. Use `BaseReader` on `forEachUserReader`.
MiguelCompany May 29, 2024
131f44e
Refs #21082. Move protected methods to `BaseReader`.
MiguelCompany May 29, 2024
63f4970
Refs #21082. Move unread related methods to `BaseReader`.
MiguelCompany May 29, 2024
442d68d
Refs #21082. Move destructor actions to `BaseReader`.
MiguelCompany May 29, 2024
d42fd0d
Refs #21082. Move some protected fields to `BaseReader`.
MiguelCompany May 29, 2024
5fd92a4
Refs #21082. Move data-sharing related fields to `BaseReader`.
MiguelCompany May 29, 2024
824a5b7
Refs #21082. Remove unnecessary forward declarations.
MiguelCompany May 29, 2024
add23ce
Refs #21082. Move `liveliness_changed_status_` to `BaseReader`.
MiguelCompany May 30, 2024
8c0eb7c
Refs #21082. Rearrange inline methods.
MiguelCompany May 30, 2024
3d73816
Refs #21082. Add `downcast` methods.
MiguelCompany May 30, 2024
4df827d
Refs #21082. Expose `assert_writer_liveliness`.
MiguelCompany May 30, 2024
dd39a9b
Refs #21082. Move history related methods to `BaseReader`.
MiguelCompany May 30, 2024
19a2401
Refs #21082. Expose `isInCleanState`.
MiguelCompany May 30, 2024
fbf6a31
Refs #21082. Refactor `nextXxxCache` methods.
MiguelCompany May 30, 2024
a370630
Refs #21082. Move sample access related methods to `BaseReader`.
MiguelCompany May 30, 2024
b55f470
Refs #21082. Minor improvements.
MiguelCompany May 30, 2024
2e38638
Refs #21082. Snake case for public methods.
MiguelCompany May 30, 2024
7ce1142
Refs #21082. Use correct names for attributes.
MiguelCompany May 30, 2024
c3497fb
Refs #21120. Uncrustify.
MiguelCompany May 30, 2024
0f3855a
Refs #21120. Suggestions on MessageReceiver.
MiguelCompany Jun 3, 2024
98a1987
Refs #21120. Using alias for BaseReader.
MiguelCompany Jun 4, 2024
ec0b985
Refs #21120. Snake case for `expects_inline_qos`.
MiguelCompany Jun 4, 2024
7ee8bbb
Refs #21120. Correct name for `ReaderAttributes::liveliness_kind`.
MiguelCompany Jun 4, 2024
7a06a39
Refs #21120. Refactor on ReaderAttributes.
MiguelCompany Jun 4, 2024
d9a5d41
Refs #21120. Getters on `RTPSReader` made const.
MiguelCompany Jun 4, 2024
e7a9a39
Refs #21120. Initialize `accept_messages_from_unkown_writers_` from n…
MiguelCompany Jun 4, 2024
cd7846b
Refs #21120. Method `init` moved to `BaseReader`.
MiguelCompany Jun 4, 2024
7b17a4b
Refs #21120. Naming style on BaseReader.
MiguelCompany Jun 4, 2024
52d4bd5
Refs #21120. Naming style on BaseReader (`reserve_cache` / `release_c…
MiguelCompany Jun 4, 2024
0998ea9
Refs #21120. Naming style on BaseReader (submessages).
MiguelCompany Jun 4, 2024
3ef816a
Refs #21120. Naming style on BaseReader (`find_cache_in_fragmented_pr…
MiguelCompany Jun 4, 2024
9b1ad28
Refs #21120. Move `find_cache_in_fragmented_process` to `StatefulRead…
MiguelCompany Jun 4, 2024
4ffc272
Refs #21120. Naming style on BaseReader (fields).
MiguelCompany Jun 4, 2024
5c5717c
Refs #21120. Suggestions on RTPSReader.
MiguelCompany Jun 4, 2024
072ea3f
Refs #21120. Remove `change_read_by_user` references.
MiguelCompany Jun 4, 2024
85e8cbd
Refs #21120. Made all API in `RTPSReader` pure virtual.
MiguelCompany Jun 4, 2024
0aab115
Refs #21120. Includes in `RTPSReader`.
MiguelCompany Jun 4, 2024
4816243
Refs #21120. Declaration order on BaseReader.
MiguelCompany Jun 4, 2024
36b490f
Refs #21120. Refactor `persist_last_notified_nts`.
MiguelCompany Jun 4, 2024
7b959bc
Refs #21120. Remove `onReaderMatched` overload.
MiguelCompany Jun 4, 2024
129eea4
Refs #21120. Rename to `on_reader_matched`.
MiguelCompany Jun 4, 2024
0998f21
Refs #21120. Rename to `on_new_cache_change_added`.
MiguelCompany Jun 4, 2024
fb0d898
Refs #21120. Uncrustify.
MiguelCompany Jun 4, 2024
d4a0b63
Refs #21120. Refactor of mocks.
MiguelCompany Jun 4, 2024
77e692d
Refs #21120. Add StatefulReader unit test.
MiguelCompany Jun 5, 2024
30c1d02
Refs #21120. Remove RTPS blackbox test.
MiguelCompany Jun 5, 2024
adeb3cd
Refs #21120. Uncrustify.
MiguelCompany Jun 5, 2024
473ab82
Refs #21120. Fix discovery server tests.
MiguelCompany Jun 6, 2024
4b17c6f
Refs #21120. Improve test `sample_lost_be_dw_be_dr_fragments`.
MiguelCompany Jun 7, 2024
bbd4537
Refs #21120. Improve `find_cache_in_fragmented_process`.
MiguelCompany Jun 10, 2024
33967bc
Refs #21120. Doxygen motivated refactor.
MiguelCompany Jun 10, 2024
8125001
Refs #21120. Refactor `reserve_cache`.
MiguelCompany Jun 10, 2024
0a6ad26
Refs #21120. Refactor `allow_unknown_writers`.
MiguelCompany Jun 10, 2024
9aa0e12
Refs #21120. Refactor `change_removed_by_history`.
MiguelCompany Jun 10, 2024
72072d2
Refs #21120. Improve `update_liveliness_changed_status`.
MiguelCompany Jun 10, 2024
2728ef9
Refs #21120. More doxygen improvements.
MiguelCompany Jun 10, 2024
9878d9a
Refs #21120. Remove `accept_messages_to_unknown_readers`.
MiguelCompany Jun 10, 2024
a3aeec0
Refs #21120. More doxygen improvements.
MiguelCompany Jun 10, 2024
abad6a1
Refs #21120. Snake case for `ReaderTimes`.
MiguelCompany Jun 10, 2024
6e2d89f
Refs #21120. Update versions.md.
MiguelCompany Jun 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/cpp/rtps/AsSocket/TestReaderSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ bool TestReaderSocket::init(
IPLocator::setIPv4(loc, ip);
loc.port = static_cast<uint16_t>(port);
ratt.endpoint.multicastLocatorList.push_back(loc);
ratt.accept_messages_from_unkown_writers = true;
mp_reader = RTPSDomain::createRTPSReader(mp_participant, ratt, mp_history, &m_listener);
mp_reader->enableMessagesFromUnkownWriters(true);
if (mp_reader == nullptr)
{
return false;
Expand All @@ -88,11 +88,11 @@ void TestReaderSocket::run()
std::cin >> aux;
}

void TestReaderSocket::MyListener::onNewCacheChangeAdded(
void TestReaderSocket::MyListener::on_new_cache_change_added(
RTPSReader* reader,
const CacheChange_t* const change)
{
printf("Received: %s\n", change->serializedPayload.data);
reader->getHistory()->remove_change((CacheChange_t*)change);
reader->get_history()->remove_change((CacheChange_t*)change);
m_received++;
}
2 changes: 1 addition & 1 deletion examples/cpp/rtps/AsSocket/TestReaderSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class TestReaderSocket
{
}

void onNewCacheChangeAdded(
void on_new_cache_change_added(
eprosima::fastrtps::rtps::RTPSReader* reader,
const eprosima::fastrtps::rtps::CacheChange_t* const change) override;
uint32_t m_received;
Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/rtps/Persistent/TestReaderPersistent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ void TestReaderPersistent::run()
std::cin.ignore();
}

void TestReaderPersistent::MyListener::onNewCacheChangeAdded(
void TestReaderPersistent::MyListener::on_new_cache_change_added(
RTPSReader* reader,
const CacheChange_t* const change)
{
printf("Received: %s\n", change->serializedPayload.data);
reader->getHistory()->remove_change((CacheChange_t*)change);
reader->get_history()->remove_change((CacheChange_t*)change);
n_received++;
}
9 changes: 3 additions & 6 deletions examples/cpp/rtps/Persistent/TestReaderPersistent.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ class TestReaderPersistent
{
}

void onNewCacheChangeAdded(
void on_new_cache_change_added(
eprosima::fastrtps::rtps::RTPSReader* reader,
const eprosima::fastrtps::rtps::CacheChange_t* const change) override;
void onReaderMatched(
void on_reader_matched(
eprosima::fastrtps::rtps::RTPSReader*,
eprosima::fastrtps::rtps::MatchingInfo& info) override
const eprosima::fastrtps::rtps::MatchingInfo& info) override
{
if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING)
{
Expand All @@ -74,9 +74,6 @@ class TestReaderPersistent
uint32_t n_received;
uint32_t n_matched;

private:

using eprosima::fastrtps::rtps::ReaderListener::onReaderMatched;
}
m_listener;
};
Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/rtps/Registered/TestReaderRegistered.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ void TestReaderRegistered::run()
std::cin.ignore();
}

void TestReaderRegistered::MyListener::onNewCacheChangeAdded(
void TestReaderRegistered::MyListener::on_new_cache_change_added(
RTPSReader* reader,
const CacheChange_t* const change)
{
printf("Received: %s\n", change->serializedPayload.data);
reader->getHistory()->remove_change((CacheChange_t*)change);
reader->get_history()->remove_change((CacheChange_t*)change);
n_received++;
}
9 changes: 3 additions & 6 deletions examples/cpp/rtps/Registered/TestReaderRegistered.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ class TestReaderRegistered
{
}

void onNewCacheChangeAdded(
void on_new_cache_change_added(
eprosima::fastrtps::rtps::RTPSReader* reader,
const eprosima::fastrtps::rtps::CacheChange_t* const change) override;
void onReaderMatched(
void on_reader_matched(
eprosima::fastrtps::rtps::RTPSReader*,
eprosima::fastrtps::rtps::MatchingInfo& info) override
const eprosima::fastrtps::rtps::MatchingInfo& info) override
{
if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING)
{
Expand All @@ -75,9 +75,6 @@ class TestReaderRegistered
uint32_t n_received;
uint32_t n_matched;

private:

using eprosima::fastrtps::rtps::ReaderListener::onReaderMatched;
}
m_listener;
};
Expand Down
8 changes: 4 additions & 4 deletions include/fastdds/dds/subscriber/qos/DataReaderQos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,19 +703,19 @@ class DataReaderQos
}

/**
* Getter for expectsInlineQos
* Getter for expects_inline_qos
*
* @return expectsInlineQos
* @return expects_inline_qos
*/
FASTDDS_EXPORTED_API bool expects_inline_qos() const
{
return expects_inline_qos_;
}

/**
* Setter for expectsInlineQos
* Setter for expects_inline_qos
*
* @param new_value new value for the expectsInlineQos
* @param new_value new value for the expects_inline_qos
*/
FASTDDS_EXPORTED_API void expects_inline_qos(
bool new_value)
Expand Down
56 changes: 21 additions & 35 deletions include/fastdds/rtps/attributes/ReaderAttributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,17 @@ class ReaderTimes
{
public:

ReaderTimes()
{
initialAcknackDelay.nanosec = 70 * 1000 * 1000;
heartbeatResponseDelay.nanosec = 5 * 1000 * 1000;
}

virtual ~ReaderTimes()
{
}

bool operator ==(
const ReaderTimes& b) const
{
return (this->initialAcknackDelay == b.initialAcknackDelay) &&
(this->heartbeatResponseDelay == b.heartbeatResponseDelay);
return (initial_acknack_delay == b.initial_acknack_delay) &&
(heartbeat_response_delay == b.heartbeat_response_delay);
}

//!Initial AckNack delay. Default value 70ms.
Duration_t initialAcknackDelay;
//!Delay to be applied when a HEARTBEAT message is received, default value 5ms.
Duration_t heartbeatResponseDelay;
//! Initial AckNack delay. Default value 70ms.
Duration_t initial_acknack_delay {0, 70 * 1000 * 1000};
//! Delay to be applied when a HEARTBEAT message is received, default value 5ms.
Duration_t heartbeat_response_delay {0, 5 * 1000 * 1000};
};

/**
Expand All @@ -70,43 +60,39 @@ class ReaderAttributes
public:

ReaderAttributes()
: liveliness_kind_(fastdds::dds::LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS)
, liveliness_lease_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
, expectsInlineQos(false)
, disable_positive_acks(false)
{
endpoint.endpointKind = READER;
endpoint.durabilityKind = VOLATILE;
endpoint.reliabilityKind = BEST_EFFORT;
}

virtual ~ReaderAttributes()
{
}
//! Attributes of the associated endpoint.
EndpointAttributes endpoint {};

//!Attributes of the associated endpoint.
EndpointAttributes endpoint;

//!Times associated with this reader (only for stateful readers)
ReaderTimes times;
//! Times associated with this reader (only for stateful readers)
ReaderTimes times {};

//! Liveliness kind
fastdds::dds::LivelinessQosPolicyKind liveliness_kind_;
fastdds::dds::LivelinessQosPolicyKind liveliness_kind =
fastdds::dds::LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS;

//! Liveliness lease duration
Duration_t liveliness_lease_duration;
Duration_t liveliness_lease_duration {TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS};

//!Indicates if the reader expects Inline qos, default value 0.
bool expectsInlineQos;
//! Indicates if the reader expects Inline qos, default value false.
bool expects_inline_qos = false;

//! Disable positive ACKs
bool disable_positive_acks;
bool disable_positive_acks = false;

//! Enable or disable the reception of messages from unknown writers.
bool accept_messages_from_unkown_writers = false;

//! Define the allocation behaviour for matched-writer-dependent collections.
ResourceLimitedContainerConfig matched_writers_allocation;
ResourceLimitedContainerConfig matched_writers_allocation {};

//! Thread settings for the data-sharing listener thread
fastdds::rtps::ThreadSettings data_sharing_listener_thread;
fastdds::rtps::ThreadSettings data_sharing_listener_thread {};
};

} /* namespace rtps */
Expand Down
Loading
Loading