Skip to content

Commit

Permalink
RTPS reader APIs refactor (#791)
Browse files Browse the repository at this point in the history
* Refs #21120. Adapt to changes in RTPSReader.

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

* Refs #21120. Use `expects_inline_qos` in XML.

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

* Refs #21120. Add method name to spelling wordlist.

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

* Refs #21120. Snake case for `ReaderTimes`.

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

---------

Signed-off-by: Miguel Company <[email protected]>
  • Loading branch information
MiguelCompany authored Jun 11, 2024
1 parent 34067fa commit ac2911b
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 40 deletions.
2 changes: 1 addition & 1 deletion code/CodeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class MyReaderListener : public ReaderListener
// The incoming message is enclosed within the `change` in the function parameters
printf("%s\n", change->serializedPayload.data);
// Once done, remove the change
reader->getHistory()->remove_change((CacheChange_t*)change);
reader->get_history()->remove_change((CacheChange_t*)change);
}

};
Expand Down
12 changes: 6 additions & 6 deletions code/DDSCodeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4312,12 +4312,12 @@ void dds_qos_examples()
{
//DDS_CHANGE_RTPS_RELIABLE_READER_QOS
RTPSReliableReaderQos reliable_reader_qos;
//The RTPSReliableReaderQos is default constructed with initialAcknackDelay = 70 ms
//Change the initialAcknackDelay to 70 nanoseconds
reliable_reader_qos.times.initialAcknackDelay = {0, 70};
//The RTPSReliableWriterQos is default constructed with heartbeatResponseDelay = 5 ms
//Change the heartbeatResponseDelay to 5 nanoseconds
reliable_reader_qos.times.heartbeatResponseDelay = {0, 5};
//The RTPSReliableReaderQos is default constructed with initial_acknack_delay = 70 ms
//Change the initial_acknack_delay to 70 nanoseconds
reliable_reader_qos.times.initial_acknack_delay = {0, 70};
//The RTPSReliableWriterQos is default constructed with heartbeat_response_delay = 5 ms
//Change the heartbeat_response_delay to 5 nanoseconds
reliable_reader_qos.times.heartbeat_response_delay = {0, 5};
//You can also change the DisablePositiveACKsQosPolicy. For further details see DisablePositiveACKsQosPolicy section.
reliable_reader_qos.disable_positive_ACKs.enabled = true;
//!--
Expand Down
2 changes: 1 addition & 1 deletion code/StaticTester.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<reader>
<userId>3</userId>
<entityID>4</entityID>
<expectsInlineQos>true</expectsInlineQos>
<expects_inline_qos>true</expects_inline_qos>
<topicName>HelloWorldTopic</topicName>
<topicDataType>HelloWorld</topicDataType>
<topicKind>WITH_KEY</topicKind>
Expand Down
18 changes: 9 additions & 9 deletions code/XMLTester.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1791,13 +1791,13 @@
</qos>

<times> <!-- readerTimesType -->
<initialAcknackDelay>
<initial_acknack_delay>
<nanosec>70</nanosec>
</initialAcknackDelay>
</initial_acknack_delay>

<heartbeatResponseDelay>
<heartbeat_response_delay>
<nanosec>5</nanosec>
</heartbeatResponseDelay>
</heartbeat_response_delay>
</times>

<unicastLocatorList>
Expand Down Expand Up @@ -1828,7 +1828,7 @@

<ignore_non_matching_locators>true</ignore_non_matching_locators>

<expectsInlineQos>true</expectsInlineQos>
<expects_inline_qos>true</expects_inline_qos>

<historyMemoryPolicy>DYNAMIC</historyMemoryPolicy>

Expand Down Expand Up @@ -3799,12 +3799,12 @@
<!-->XML_RTPS_RELIABLE_READER_QOS<-->
<data_reader profile_name="sub_profile_name">
<times> <!-- readerTimesType -->
<initialAcknackDelay> <!-- DURATION -->
<initial_acknack_delay> <!-- DURATION -->
<nanosec>70</nanosec>
</initialAcknackDelay>
<heartbeatResponseDelay> <!-- DURATION -->
</initial_acknack_delay>
<heartbeat_response_delay> <!-- DURATION -->
<nanosec>5</nanosec>
</heartbeatResponseDelay>
</heartbeat_response_delay>
</times>
<!--You can also change the values of DisablePositiveACKsQosPolicy.-->
<!--See DisablePositiveACKsQosPolicy section for further details-->
Expand Down
10 changes: 5 additions & 5 deletions code/XMLTesterExample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -772,14 +772,14 @@
</qos>

<times>
<initialAcknackDelay>
<initial_acknack_delay>
<sec>1</sec>
<nanosec>856000</nanosec>
</initialAcknackDelay>
<heartbeatResponseDelay>
</initial_acknack_delay>
<heartbeat_response_delay>
<sec>1</sec>
<nanosec>856000</nanosec>
</heartbeatResponseDelay>
</heartbeat_response_delay>
</times>

<unicastLocatorList>
Expand Down Expand Up @@ -842,7 +842,7 @@
</external_unicast_locators>

<ignore_non_matching_locators>true</ignore_non_matching_locators>
<expectsInlineQos>true</expectsInlineQos>
<expects_inline_qos>true</expects_inline_qos>
<historyMemoryPolicy>DYNAMIC</historyMemoryPolicy>

<propertiesPolicy>
Expand Down
4 changes: 2 additions & 2 deletions docs/03-exports/aliases-api.include
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@
.. |SendBuffersAllocationAttributes::dynamic-api| replace:: :cpp:member:`dynamic<eprosima::fastrtps::rtps::SendBuffersAllocationAttributes::dynamic>`

.. |ReaderTimes-api| replace:: :cpp:class:`ReaderTimes<eprosima::fastrtps::rtps::ReaderTimes>`
.. |ReaderTimes::initialAcknackDelay-api| replace:: :cpp:member:`initialAcknackDelay<eprosima::fastrtps::rtps::ReaderTimes::initialAcknackDelay>`
.. |ReaderTimes::heartbeatResponseDelay-api| replace:: :cpp:member:`heartbeatResponseDelay<eprosima::fastrtps::rtps::ReaderTimes::heartbeatResponseDelay>`
.. |ReaderTimes::initial_acknack_delay-api| replace:: :cpp:member:`initial_acknack_delay<eprosima::fastrtps::rtps::ReaderTimes::initial_acknack_delay>`
.. |ReaderTimes::heartbeat_response_delay-api| replace:: :cpp:member:`heartbeat_response_delay<eprosima::fastrtps::rtps::ReaderTimes::heartbeat_response_delay>`

.. |RTPSReliableWriterQos-api| replace:: :cpp:class:`RTPSReliableWriterQos<eprosima::fastdds::dds::RTPSReliableWriterQos>`
.. |RTPSReliableWriterQos::times-api| replace:: :cpp:member:`times<eprosima::fastdds::dds::RTPSReliableWriterQos::times>`
Expand Down
7 changes: 4 additions & 3 deletions docs/fastdds/api_reference/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ config
const
ContentFilteredTopic
Contructs
createRTPSReader
datareader
DataReader
DataReaderListener
Expand Down Expand Up @@ -103,7 +104,7 @@ Endianness
entityId
Enum
eprosima
expectsInlineQos
expects_inline_qos
ExtendedAnnotationParameterValuePubSubType
ExtendedTypeDefnPubSubType
fastdds
Expand All @@ -120,12 +121,12 @@ GuidPrefix
hashid
Hashid
heartbeatPeriod
heartbeatResponseDelay
heartbeat_response_delay
HistoryQosPolicy
InconsistentTopicStatus
Implementers
infos
initialAcknackDelay
initial_acknack_delay
initialHeartbeatDelay
inlined
instanceHandle
Expand Down
8 changes: 4 additions & 4 deletions docs/fastdds/dds_layer/core/policy/eprosimaExtensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -760,14 +760,14 @@ List of structure members:
+-----------------------------------------------------------------------------------+------------------+---------------+
| Member Name | Type | Default Value |
+===================================================================================+==================+===============+
| |ReaderTimes::initialAcknackDelay-api| | |Duration_t-api| | 70 ms |
| |ReaderTimes::initial_acknack_delay-api| | |Duration_t-api| | 70 ms |
+-----------------------------------------------------------------------------------+------------------+---------------+
| |ReaderTimes::heartbeatResponseDelay-api| | |Duration_t-api| | 5 ms |
| |ReaderTimes::heartbeat_response_delay-api| | |Duration_t-api| | 5 ms |
+-----------------------------------------------------------------------------------+------------------+---------------+

* |ReaderTimes::initialAcknackDelay-api|:
* |ReaderTimes::initial_acknack_delay-api|:
Defines the duration of the initial acknack delay.
* |ReaderTimes::heartbeatResponseDelay-api|:
* |ReaderTimes::heartbeat_response_delay-api|:
Establishes the duration of the delay applied when a heartbeat message is received.

Example
Expand Down
2 changes: 1 addition & 1 deletion docs/fastdds/discovery/static.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ A full example of such file can be found in :ref:`static_xml_example`.
- EntityId of the DataReader/DataWriter.
- ``uint16_t``
- 0
* - ``<expectsInlineQos>``
* - ``<expects_inline_qos>``
- It indicates if QOS is expected inline |br|
(DataReader **only**).
- ``bool``
Expand Down
16 changes: 8 additions & 8 deletions docs/fastdds/xml_configuration/datareader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The DataReader configuration is performed through the XML elements listed in the
announced by this DataReader.
- ``bool``
- false
* - ``<expectsInlineQos>``
* - ``<expects_inline_qos>``
- It indicates if QoS is expected inline.
- ``bool``
- ``false``
Expand Down Expand Up @@ -136,10 +136,10 @@ ReaderTimes

These parameters are included within :ref:`rtpsreliablereaderqos` in the :ref:`readertimes` structure.

+------------------------------+-------------------------------------------------------+---------------------+---------+
| Name | Description | Values | Default |
+==============================+=======================================================+=====================+=========+
| ``<initialAcknackDelay>`` | Initial ACKNACK delay. | :ref:`DurationType` | 70 ms |
+------------------------------+-------------------------------------------------------+---------------------+---------+
| ``<heartbeatResponseDelay>`` | Response time delay when receiving a Heartbeat. | :ref:`DurationType` | 5 ms |
+------------------------------+-------------------------------------------------------+---------------------+---------+
+--------------------------------+-----------------------------------------------------+---------------------+---------+
| Name | Description | Values | Default |
+================================+=====================================================+=====================+=========+
| ``<initial_acknack_delay>`` | Initial ACKNACK delay. | :ref:`DurationType` | 70 ms |
+--------------------------------+-----------------------------------------------------+---------------------+---------+
| ``<heartbeat_response_delay>`` | Response time delay when receiving a Heartbeat. | :ref:`DurationType` | 5 ms |
+--------------------------------+-----------------------------------------------------+---------------------+---------+

0 comments on commit ac2911b

Please sign in to comment.