Skip to content

[21745] Add QoS getters from raw XML #5256

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

Merged
merged 18 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
02dfeb6
Refs #21745. Add QoS getters from raw XML
juanlofer-eprosima Sep 24, 2024
984e26d
Refs #21745. Add from_profile overloads with extra info
juanlofer-eprosima Sep 26, 2024
48db7d9
Refs #21745. Add get_participant_extended_qos_from_xml
juanlofer-eprosima Sep 26, 2024
8df184a
Refs #21745. Fix typo
juanlofer-eprosima Sep 26, 2024
f8b34a3
Refs #21745. Export DomainParticipant::has_active_entities
juanlofer-eprosima Sep 27, 2024
eb2819d
Refs #21745. Change skip condition in fill_attributes_from_xml when p…
juanlofer-eprosima Oct 1, 2024
f571032
Refs #21745. Add docstrings for new methods
juanlofer-eprosima Oct 1, 2024
6687350
Refs #21745. Refactor fill_attributes_from_xml to parse recursively
juanlofer-eprosima Oct 2, 2024
3522b0e
Refs #21745. Add more overloads and remove redundant implementations
juanlofer-eprosima Oct 2, 2024
80a2f20
Refs #21745. Add unittests
juanlofer-eprosima Oct 2, 2024
b1c85b2
Refs #21745. Fix docstring
juanlofer-eprosima Oct 3, 2024
4a2a35d
Refs #21745. Perform full DomainParticipantQos comparison in tests
juanlofer-eprosima Oct 3, 2024
5ec3220
Refs #21745. Apply suggestion
juanlofer-eprosima Oct 8, 2024
dd0aced
Refs #21745. Add a clarifying docstring note to get_default methods
juanlofer-eprosima Oct 8, 2024
6574456
Refs #21745. Add unittests for new get_default methods
juanlofer-eprosima Oct 8, 2024
f6fe520
Refs #21745. Apply suggestions
juanlofer-eprosima Oct 8, 2024
b1f8ad1
Refs #21745. Apply more suggestions
juanlofer-eprosima Oct 9, 2024
14439b5
Refs #21745. Uncrustify
juanlofer-eprosima Oct 9, 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
281 changes: 265 additions & 16 deletions include/fastdds/dds/domain/DomainParticipant.hpp

Large diffs are not rendered by default.

84 changes: 79 additions & 5 deletions include/fastdds/dds/domain/DomainParticipantFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,55 @@ class DomainParticipantFactory
const DomainParticipantQos& qos);

/**
* Fills the DomainParticipantQos with the values of the XML profile.
* Fills the @ref DomainParticipantQos with the values of the XML profile.
*
* @param profile_name DomainParticipant profile name.
* @param qos DomainParticipantQos object where the qos is returned.
* @param qos @ref DomainParticipantQos object where the qos is returned.
* @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_participant_qos_from_profile(
const std::string& profile_name,
DomainParticipantQos& qos) const;

/**
* Fills the DomainParticipantExtendedQos with the values of the XML profile.
* Fills the @ref DomainParticipantQos with the first DomainParticipant profile found in the provided XML.
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DomainParticipantQos object where the qos is returned.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_participant_qos_from_xml(
const std::string& xml,
DomainParticipantQos& qos) const;

/**
* Fills the @ref DomainParticipantQos with the DomainParticipant profile with \c profile_name to be found in the provided XML.
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DomainParticipantQos object where the qos is returned.
* @param profile_name DomainParticipant profile name.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_participant_qos_from_xml(
const std::string& xml,
DomainParticipantQos& qos,
const std::string& profile_name) const;

/**
* Fills the @ref DomainParticipantQos with the default DomainParticipant profile found in the provided XML (if there is).
*
* @note This method does not update the default participant qos (returned by \c get_default_participant_qos).
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DomainParticipantQos object where the qos is returned.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_default_participant_qos_from_xml(
const std::string& xml,
DomainParticipantQos& qos) const;

/**
* Fills the @ref DomainParticipantExtendedQos with the values of the XML profile.
*
* @param profile_name DomainParticipant profile name.
* @param extended_qos DomainParticipantExtendedQos object where the domain and qos are returned.
Expand All @@ -241,9 +278,46 @@ class DomainParticipantFactory
DomainParticipantExtendedQos& extended_qos) const;

/**
* Fills the DomainParticipantExtendedQos with the values of the default XML profile.
* Fills the @ref DomainParticipantExtendedQos with the first DomainParticipant profile found in the provided XML.
*
* @param extended_qos DomainParticipantExtendedQos object where the domain and qos are returned.
* @param xml Raw XML string containing the profile to be used to fill the \c extended_qos structure.
* @param extended_qos @ref DomainParticipantExtendedQos object where the qos is returned.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_participant_extended_qos_from_xml(
const std::string& xml,
DomainParticipantExtendedQos& extended_qos) const;

/**
* Fills the @ref DomainParticipantExtendedQos with the DomainParticipant profile with \c profile_name to be found in the provided XML.
*
* @param xml Raw XML string containing the profile to be used to fill the \c extended_qos structure.
* @param extended_qos @ref DomainParticipantExtendedQos object where the qos is returned.
* @param profile_name DomainParticipant profile name.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_participant_extended_qos_from_xml(
const std::string& xml,
DomainParticipantExtendedQos& extended_qos,
const std::string& profile_name) const;

/**
* Fills the @ref DomainParticipantExtendedQos with the default DomainParticipant profile found in the provided XML (if there is).
*
* @note This method does not update the default participant extended qos.
*
* @param xml Raw XML string containing the profile to be used to fill the \c extended_qos structure.
* @param extended_qos @ref DomainParticipantExtendedQos object where the qos is returned.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_default_participant_extended_qos_from_xml(
const std::string& xml,
DomainParticipantExtendedQos& extended_qos) const;

/**
* Fills the @ref DomainParticipantExtendedQos with the values of the default XML profile.
*
* @param extended_qos @ref DomainParticipantExtendedQos object where the domain and qos are returned.
* @return RETCODE_OK
*/
FASTDDS_EXPORTED_API ReturnCode_t get_participant_extended_qos_from_default_profile(
Expand Down
99 changes: 96 additions & 3 deletions include/fastdds/dds/publisher/Publisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,16 +332,109 @@ class Publisher : public DomainEntity
const fastdds::dds::TopicQos& topic_qos);

/**
* Fills the DataWriterQos with the values of the XML profile.
* Fills the @ref DataWriterQos with the values of the XML profile.
*
* @param profile_name DataWriter profile name.
* @param qos DataWriterQos object where the qos is returned.
* @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise.
* @param qos @ref DataWriterQos object where the qos is returned.
* @return @ref RETCODE_OK if the profile exists. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_profile(
const std::string& profile_name,
DataWriterQos& qos) const;

/**
* Fills the @ref DataWriterQos with the values of the XML profile, and also its corresponding topic name (if specified).
*
* @param profile_name DataWriter profile name.
* @param qos @ref DataWriterQos object where the qos is returned.
* @param topic_name String where the name of the topic associated to this profile is returned (if specified).
* @return @ref RETCODE_OK if the profile exists. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_profile(
const std::string& profile_name,
DataWriterQos& qos,
std::string& topic_name) const;

/**
* Fills the @ref DataWriterQos with the first DataWriter profile found in the provided XML.
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DataWriterQos object where the qos is returned.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_xml(
const std::string& xml,
DataWriterQos& qos) const;

/**
* Fills the @ref DataWriterQos with the first DataWriter profile found in the provided XML, and also its corresponding topic name (if specified).
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DataWriterQos object where the qos is returned.
* @param topic_name String where the name of the topic associated to this profile is returned (if specified).
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_xml(
const std::string& xml,
DataWriterQos& qos,
std::string& topic_name) const;

/**
* Fills the @ref DataWriterQos with the DataWriter profile with \c profile_name to be found in the provided XML.
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DataWriterQos object where the qos is returned.
* @param profile_name DataWriter profile name.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_xml(
const std::string& xml,
DataWriterQos& qos,
const std::string& profile_name) const;

/**
* Fills the @ref DataWriterQos with the DataWriter profile with \c profile_name to be found in the provided XML, and also its corresponding topic name (if specified).
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DataWriterQos object where the qos is returned.
* @param topic_name String where the name of the topic associated to this profile is returned (if specified).
* @param profile_name DataWriter profile name.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_xml(
const std::string& xml,
DataWriterQos& qos,
std::string& topic_name,
const std::string& profile_name) const;

/**
* Fills the @ref DataWriterQos with the default DataWriter profile found in the provided XML (if there is).
*
* @note This method does not update the default datawriter qos (returned by \c get_default_datawriter_qos).
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DataWriterQos object where the qos is returned.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_default_datawriter_qos_from_xml(
const std::string& xml,
DataWriterQos& qos) const;

/**
* Fills the @ref DataWriterQos with the default DataWriter profile found in the provided XML (if there is), and also its corresponding topic name (if specified).
*
* @note This method does not update the default datawriter qos (returned by \c get_default_datawriter_qos).
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DataWriterQos object where the qos is returned.
* @param topic_name String where the name of the topic associated to this profile is returned (if specified).
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_default_datawriter_qos_from_xml(
const std::string& xml,
DataWriterQos& qos,
std::string& topic_name) const;

/**
* Returns the Publisher's handle.
*
Expand Down
99 changes: 96 additions & 3 deletions include/fastdds/dds/subscriber/Subscriber.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,16 +345,109 @@ class Subscriber : public DomainEntity
DataReaderQos& qos) const;

/**
* Fills the DataReaderQos with the values of the XML profile.
* Fills the @ref DataReaderQos with the values of the XML profile.
*
* @param profile_name DataReader profile name.
* @param qos DataReaderQos object where the qos is returned.
* @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise.
* @param qos @ref DataReaderQos object where the qos is returned.
* @return @ref RETCODE_OK if the profile exists. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_datareader_qos_from_profile(
const std::string& profile_name,
DataReaderQos& qos) const;

/**
* Fills the @ref DataReaderQos with the values of the XML profile, and also its corresponding topic name (if specified).
*
* @param profile_name DataReader profile name.
* @param qos @ref DataReaderQos object where the qos is returned.
* @param topic_name String where the name of the topic associated to this profile is returned (if specified).
* @return @ref RETCODE_OK if the profile exists. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_datareader_qos_from_profile(
const std::string& profile_name,
DataReaderQos& qos,
std::string& topic_name) const;

/**
* Fills the @ref DataReaderQos with the first DataReader profile found in the provided XML.
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DataReaderQos object where the qos is returned.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_datareader_qos_from_xml(
const std::string& xml,
DataReaderQos& qos) const;

/**
* Fills the @ref DataReaderQos with the first DataReader profile found in the provided XML, and also its corresponding topic name (if specified).
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DataReaderQos object where the qos is returned.
* @param topic_name String where the name of the topic associated to this profile is returned (if specified).
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_datareader_qos_from_xml(
const std::string& xml,
DataReaderQos& qos,
std::string& topic_name) const;

/**
* Fills the @ref DataReaderQos with the DataReader profile with \c profile_name to be found in the provided XML.
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DataReaderQos object where the qos is returned.
* @param profile_name DataReader profile name.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_datareader_qos_from_xml(
const std::string& xml,
DataReaderQos& qos,
const std::string& profile_name) const;

/**
* Fills the @ref DataReaderQos with the DataReader profile with \c profile_name to be found in the provided XML, and also its corresponding topic name (if specified).
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DataReaderQos object where the qos is returned.
* @param topic_name String where the name of the topic associated to this profile is returned (if specified).
* @param profile_name DataReader profile name.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_datareader_qos_from_xml(
const std::string& xml,
DataReaderQos& qos,
std::string& topic_name,
const std::string& profile_name) const;

/**
* Fills the @ref DataReaderQos with the default DataReader profile found in the provided XML (if there is).
*
* @note This method does not update the default datareader qos (returned by \c get_default_datareader_qos).
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DataReaderQos object where the qos is returned.
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_default_datareader_qos_from_xml(
const std::string& xml,
DataReaderQos& qos) const;

/**
* Fills the @ref DataReaderQos with the default DataReader profile found in the provided XML (if there is), and also its corresponding topic name (if specified).
*
* @note This method does not update the default datareader qos (returned by \c get_default_datareader_qos).
*
* @param xml Raw XML string containing the profile to be used to fill the \c qos structure.
* @param qos @ref DataReaderQos object where the qos is returned.
* @param topic_name String where the name of the topic associated to this profile is returned (if specified).
* @return @ref RETCODE_OK on success. @ref RETCODE_BAD_PARAMETER otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_default_datareader_qos_from_xml(
const std::string& xml,
DataReaderQos& qos,
std::string& topic_name) const;

/**
* @brief Copies TopicQos into the corresponding DataReaderQos
*
Expand Down
Loading
Loading