Skip to content

Commit

Permalink
RTPS writer APIs refactor (#5028)
Browse files Browse the repository at this point in the history
* Refs #21082. Remove `onWriterMatched` overload.

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

* Refs #21082. Rename to `on_writer_matched`.

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

* Refs #21082. Rename to `on_writer_change_received_by_all`.

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

* Refs #21082. Refactor on WriterTimes.

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

* Refs #21082. Rename protected fields.

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

* Refs #21082. Add empty `BaseReader` class.

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

* Refs #21082. Implementation classes now inherit from `BaseWriter`.

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

* Refs #21082. Method `is_acked_by_all` receives sequence number.

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

* Refs #21082. Writer history keeps pointer to BaseReader.

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

* Refs #21082. Move `StatisticsWriterImpl` inheritance.

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

* Refs #21082. Remove dependency on `WriterPool`.

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

* Refs #21082. Remove unused private member.

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

* Refs #21082. Refactor on `FlowController`.

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

* Refs #21082. Refactor on `LocatorSelectorSender`.

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

* Refs #21082. Header `LocatorSelectorSender.hpp` made private.

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

* Refs #21082. Header `DeliveryRetCode.hpp` made private.

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

* Refs #21082. Participant keeps collection of BaseWriter.

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

* Refs #21082. Method `find_local_writer` returns `BaseWriter`.

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

* Refs #21082. Refactor `MessageReceiver`.

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

* Refs #21082. Add `downcast` methods.

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

* Refs #21082. Remove friend `DataWriterImpl`.

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

* Refs #21082. Remove superfluous namespacing.

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

* Refs #21082. Move `init` method.

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

* Refs #21082. Remove other friends.

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

* Refs #21082. Move non-exported methods to `BaseWriter`.

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

* Refs #21082. Move liveliness_lost update to `BaseWriter`.

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

* Refs #21082. Remove unused private method.

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

* Refs #21082. Move inline methods.

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

* Refs #21082. Move history query methods.

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

* Refs #21082. Move other members.

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

* Refs #21082. Separate sending is now part of `WriterAttributes`.

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

* Refs #21082. Snake case on public methods.

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

* Refs #21082. Method get_history in BaseWriter.

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

* Refs #21082. Fix warning without security.

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

* Refs #21137. Apply suggestions on WLP.

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

* Refs #21137. Remove unused methods from `RTPSParticipantImpl`.

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

* Refs #21137. Move implementations to cpp.

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

* Refs #21137. Method names and doxygen.

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

* Refs #21137. Add space between `@param` and `[`

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

* Refs #21137. Namespace suggestion.

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

* Refs #21137. Uncrustify.

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

* Refs #21137. Rearrange methods.

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

* Refs #21137. Additional rearrange of methods.

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

* Refs #21137. Update versions.md.

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

---------

Signed-off-by: Miguel Company <[email protected]>
  • Loading branch information
MiguelCompany authored Jul 10, 2024
1 parent f5495d4 commit a73448d
Show file tree
Hide file tree
Showing 192 changed files with 3,475 additions and 3,407 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ bool HelloWorldPublisher::init()
wqos.history().depth = 30;
wqos.resource_limits().max_samples = 50;
wqos.resource_limits().allocated_samples = 20;
wqos.reliable_writer_qos().times.heartbeatPeriod.seconds = 2;
wqos.reliable_writer_qos().times.heartbeatPeriod.nanosec = 200 * 1000 * 1000;
wqos.reliable_writer_qos().times.heartbeat_period.seconds = 2;
wqos.reliable_writer_qos().times.heartbeat_period.nanosec = 200 * 1000 * 1000;
wqos.reliability().kind = RELIABLE_RELIABILITY_QOS;
wqos.publish_mode().kind = ASYNCHRONOUS_PUBLISH_MODE;

Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ bool HelloWorldPublisher::init(
wqos.history().depth = 30;
wqos.resource_limits().max_samples = 50;
wqos.resource_limits().allocated_samples = 20;
wqos.reliable_writer_qos().times.heartbeatPeriod.seconds = 2;
wqos.reliable_writer_qos().times.heartbeatPeriod.nanosec = 200 * 1000 * 1000;
wqos.reliable_writer_qos().times.heartbeat_period.seconds = 2;
wqos.reliable_writer_qos().times.heartbeat_period.nanosec = 200 * 1000 * 1000;
wqos.reliability().kind = RELIABLE_RELIABILITY_QOS;

writer_ = publisher_->create_datawriter(topic_, wqos, &listener_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ bool HelloWorldPublisher::init()
wqos.history().depth = 20;
wqos.resource_limits().max_samples = 50;
wqos.resource_limits().max_samples_per_instance = 20;
wqos.reliable_writer_qos().times.heartbeatPeriod.seconds = 2;
wqos.reliable_writer_qos().times.heartbeatPeriod.nanosec = 200 * 1000 * 1000;
wqos.reliable_writer_qos().times.heartbeat_period.seconds = 2;
wqos.reliable_writer_qos().times.heartbeat_period.nanosec = 200 * 1000 * 1000;
writer_ = publisher_->create_datawriter(topic_, wqos, &listener_);

if (writer_ == nullptr)
Expand Down
7 changes: 2 additions & 5 deletions examples/cpp/rtps/Persistent/TestWriterPersistent.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class TestWriterPersistent
{
}

void onWriterMatched(
void on_writer_matched(
eprosima::fastdds::rtps::RTPSWriter*,
eprosima::fastdds::rtps::MatchingInfo& info) override
const eprosima::fastdds::rtps::MatchingInfo& info) override
{
if (info.status == eprosima::fastdds::rtps::MATCHED_MATCHING)
{
Expand All @@ -70,9 +70,6 @@ class TestWriterPersistent

int n_matched;

private:

using eprosima::fastdds::rtps::WriterListener::onWriterMatched;
}
m_listener;
};
Expand Down
7 changes: 2 additions & 5 deletions examples/cpp/rtps/Registered/TestWriterRegistered.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class TestWriterRegistered
{
}

void onWriterMatched(
void on_writer_matched(
eprosima::fastdds::rtps::RTPSWriter*,
eprosima::fastdds::rtps::MatchingInfo& info) override
const eprosima::fastdds::rtps::MatchingInfo& info) override
{
if (info.status == eprosima::fastdds::rtps::MATCHED_MATCHING)
{
Expand All @@ -69,9 +69,6 @@ class TestWriterRegistered

int n_matched;

private:

using eprosima::fastdds::rtps::WriterListener::onWriterMatched;
}
m_listener;
};
Expand Down
4 changes: 2 additions & 2 deletions include/fastdds/dds/core/policy/ParameterTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,7 @@ class ParameterSampleIdentity_t : public Parameter_t
/**
* Add the parameter to a CDRMessage_t message.
*
* @param[in,out] msg Pointer to the message where the parameter should be added.
* @param [in,out] msg Pointer to the message where the parameter should be added.
* @return True if the parameter was correctly added.
*/
bool addToCDRMessage(
Expand All @@ -1668,7 +1668,7 @@ class ParameterSampleIdentity_t : public Parameter_t
/**
* Read the parameter from a CDRMessage_t message.
*
* @param[in,out] msg Pointer to the message from where the parameter should be taken.
* @param [in,out] msg Pointer to the message from where the parameter should be taken.
* @param size Size of the parameter field to read
* @return True if the parameter was correctly taken.
*/
Expand Down
8 changes: 4 additions & 4 deletions include/fastdds/dds/domain/DomainParticipant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ class DomainParticipant : public Entity
/**
* Retrieves the list of DomainParticipants that have been discovered in the domain and are not "ignored".
*
* @param[out] participant_handles Reference to the vector where discovered participants will be returned
* @param [out] participant_handles Reference to the vector where discovered participants will be returned
* @return RETCODE_OK if everything correct, error code otherwise
*
* @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED
Expand All @@ -691,7 +691,7 @@ class DomainParticipant : public Entity
/**
* Retrieves the DomainParticipant data of a discovered not ignored participant.
*
* @param[out] participant_data Reference to the ParticipantBuiltinTopicData object to return the data
* @param [out] participant_data Reference to the ParticipantBuiltinTopicData object to return the data
* @param participant_handle InstanceHandle of DomainParticipant to retrieve the data from
* @return RETCODE_OK if everything correct, PRECONDITION_NOT_MET if participant does not exist
*
Expand All @@ -704,7 +704,7 @@ class DomainParticipant : public Entity
/**
* Retrieves the list of topics that have been discovered in the domain and are not "ignored".
*
* @param[out] topic_handles Reference to the vector where discovered topics will be returned
* @param [out] topic_handles Reference to the vector where discovered topics will be returned
* @return RETCODE_OK if everything correct, error code otherwise
*
* @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED
Expand All @@ -715,7 +715,7 @@ class DomainParticipant : public Entity
/**
* Retrieves the Topic data of a discovered not ignored topic.
*
* @param[out] topic_data Reference to the TopicBuiltinTopicData object to return the data
* @param [out] topic_data Reference to the TopicBuiltinTopicData object to return the data
* @param topic_handle InstanceHandle of Topic to retrieve the data from
* @return RETCODE_OK if everything correct, PRECONDITION_NOT_MET if topic does not exist
*
Expand Down
22 changes: 11 additions & 11 deletions include/fastdds/dds/domain/DomainParticipantListener.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ class DomainParticipantListener :
* This method is called when a new Participant is discovered, or a previously discovered participant changes
* its QOS or is removed.
*
* @param[out] participant Pointer to the Participant which discovered the remote participant.
* @param[out] info Remote participant information. User can take ownership of the object.
* @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered Participant.
* @param [out] participant Pointer to the Participant which discovered the remote participant.
* @param [out] info Remote participant information. User can take ownership of the object.
* @param [out] should_be_ignored Flag to indicate the library to automatically ignore the discovered Participant.
*/
virtual void on_participant_discovery(
DomainParticipant* participant,
Expand All @@ -81,8 +81,8 @@ class DomainParticipantListener :
/*!
* This method is called when a new Participant is authenticated.
*
* @param[out] participant Pointer to the authenticated Participant.
* @param[out] info Remote participant authentication information. User can take ownership of the object.
* @param [out] participant Pointer to the authenticated Participant.
* @param [out] info Remote participant authentication information. User can take ownership of the object.
*/
virtual void onParticipantAuthentication(
DomainParticipant* participant,
Expand All @@ -98,9 +98,9 @@ class DomainParticipantListener :
* This method is called when a new DataReader is discovered, or a previously discovered DataReader changes
* its QOS or is removed.
*
* @param[out] participant Pointer to the Participant which discovered the remote DataReader.
* @param[out] info Remote DataReader information. User can take ownership of the object.
* @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataReader.
* @param [out] participant Pointer to the Participant which discovered the remote DataReader.
* @param [out] info Remote DataReader information. User can take ownership of the object.
* @param [out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataReader.
*/
virtual void on_data_reader_discovery(
DomainParticipant* participant,
Expand All @@ -116,9 +116,9 @@ class DomainParticipantListener :
* This method is called when a new DataWriter is discovered, or a previously discovered DataWriter changes
* its QOS or is removed.
*
* @param[out] participant Pointer to the Participant which discovered the remote DataWriter.
* @param[out] info Remote DataWriter information. User can take ownership of the object.
* @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataWriter.
* @param [out] participant Pointer to the Participant which discovered the remote DataWriter.
* @param [out] info Remote DataWriter information. User can take ownership of the object.
* @param [out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataWriter.
*/
virtual void on_data_writer_discovery(
DomainParticipant* participant,
Expand Down
26 changes: 13 additions & 13 deletions include/fastdds/dds/publisher/DataWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class DataWriter : public DomainEntity
* @brief Informs that the application will be modifying a particular instance.
* It gives an opportunity to the middleware to pre-configure itself to improve performance.
*
* @param[in] instance Sample used to get the instance's key.
* @param [in] instance Sample used to get the instance's key.
* @return Handle containing the instance's key.
* This handle could be used in successive `write` or `dispose` operations.
* In case of error, HANDLE_NIL will be returned.
Expand Down Expand Up @@ -220,8 +220,8 @@ class DataWriter : public DomainEntity
* Informs the middleware that the DataWriter is not intending to modify any more of that data instance.
* Also indicates that the middleware can locally remove all information regarding that instance.
*
* @param[in] instance Sample used to deduce instance's key in case of `handle` parameter is HANDLE_NIL.
* @param[in] handle Instance's key to be unregistered.
* @param [in] instance Sample used to deduce instance's key in case of `handle` parameter is HANDLE_NIL.
* @param [in] handle Instance's key to be unregistered.
* @return Returns the operation's result.
* If the operation finishes successfully, RETCODE_OK is returned.
*/
Expand Down Expand Up @@ -262,8 +262,8 @@ class DataWriter : public DomainEntity
* data-object known to the DataWriter. If the implementation is not able to check invalid handles then the result
* in this situation is unspecified.
*
* @param[in,out] key_holder Sample where the key fields will be returned.
* @param[in] handle Handle to the instance to retrieve the key values from.
* @param [in,out] key_holder Sample where the key fields will be returned.
* @param [in] handle Handle to the instance to retrieve the key values from.
*
* @return Any of the standard return codes.
*/
Expand All @@ -278,7 +278,7 @@ class DataWriter : public DomainEntity
* instance handle as an argument. The instance parameter is only used for the purpose of examining the fields that
* define the key.
*
* @param[in] instance Data pointer to the sample
* @param [in] instance Data pointer to the sample
*
* @return handle of the given instance
*/
Expand Down Expand Up @@ -318,7 +318,7 @@ class DataWriter : public DomainEntity
/**
* @brief Returns the offered deadline missed status
*
* @param[out] status Deadline missed status struct
* @param [out] status Deadline missed status struct
* @return RETCODE_OK
*/
FASTDDS_EXPORTED_API ReturnCode_t get_offered_deadline_missed_status(
Expand All @@ -327,7 +327,7 @@ class DataWriter : public DomainEntity
/**
* @brief Returns the offered incompatible qos status
*
* @param[out] status Offered incompatible qos status struct
* @param [out] status Offered incompatible qos status struct
* @return RETCODE_OK
*/
FASTDDS_EXPORTED_API ReturnCode_t get_offered_incompatible_qos_status(
Expand All @@ -336,7 +336,7 @@ class DataWriter : public DomainEntity
/**
* @brief Returns the publication matched status
*
* @param[out] status publication matched status struct
* @param [out] status publication matched status struct
* @return RETCODE_OK
*/
FASTDDS_EXPORTED_API ReturnCode_t get_publication_matched_status(
Expand Down Expand Up @@ -412,8 +412,8 @@ class DataWriter : public DomainEntity
* on the values of the handle parameter and the corresponding error behavior are the same specified for the
* unregister_instance operation.
*
* @param[in] data Sample used to deduce instance's key in case of `handle` parameter is HANDLE_NIL.
* @param[in] handle InstanceHandle of the data
* @param [in] data Sample used to deduce instance's key in case of `handle` parameter is HANDLE_NIL.
* @param [in] handle InstanceHandle of the data
* @return RETCODE_PRECONDITION_NOT_MET if the handle introduced does not match with the one associated to the data,
* RETCODE_OK if the data is correctly sent and RETCODE_ERROR otherwise.
*/
Expand Down Expand Up @@ -478,7 +478,7 @@ class DataWriter : public DomainEntity
/**
* @brief Retrieves in a subscription associated with the DataWriter
*
* @param[out] subscription_data subscription data struct
* @param [out] subscription_data subscription data struct
* @param subscription_handle InstanceHandle_t of the subscription
* @return RETCODE_OK
*
Expand All @@ -491,7 +491,7 @@ class DataWriter : public DomainEntity
/**
* @brief Fills the given vector with the InstanceHandle_t of matched DataReaders
*
* @param[out] subscription_handles Vector where the InstanceHandle_t are returned
* @param [out] subscription_handles Vector where the InstanceHandle_t are returned
* @return RETCODE_OK
*
* @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED
Expand Down
4 changes: 2 additions & 2 deletions include/fastdds/dds/publisher/Publisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ class Publisher : public DomainEntity
/**
* @brief Copies TopicQos into the corresponding DataWriterQos
*
* @param[out] writer_qos
* @param[in] topic_qos
* @param [out] writer_qos
* @param [in] topic_qos
* @return RETCODE_OK if successful, an error code otherwise
*
* @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED
Expand Down
Loading

0 comments on commit a73448d

Please sign in to comment.