diff --git a/src/core/ddsc/include/dds/ddsc/dds_public_qos.h b/src/core/ddsc/include/dds/ddsc/dds_public_qos.h index 8f319c1..95fa4fe 100644 --- a/src/core/ddsc/include/dds/ddsc/dds_public_qos.h +++ b/src/core/ddsc/include/dds/ddsc/dds_public_qos.h @@ -391,7 +391,7 @@ dds_qset_time_based_filter ( * * @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy * @param[in] n - Number of partitions stored in ps - * @param[in[ ps - Pointer to string(s) storing partition name(s) + * @param[in] ps - Pointer to string(s) storing partition name(s) */ DDS_EXPORT void dds_qset_partition ( @@ -399,6 +399,18 @@ dds_qset_partition ( uint32_t n, const char ** __restrict ps); +/** + * @brief Convenience function to set the partition policy of a qos structure to a + * single name. Name may be a null pointer. + * + * @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy + * @param[in] name - Pointer to the name + */ +DDS_EXPORT void +dds_qset_partition1 ( + dds_qos_t * __restrict qos, + const char * __restrict name); + /** * @brief Set the reliability policy of a qos structure * diff --git a/src/core/ddsc/src/dds_qos.c b/src/core/ddsc/src/dds_qos.c index 25a3ce6..02988bf 100644 --- a/src/core/ddsc/src/dds_qos.c +++ b/src/core/ddsc/src/dds_qos.c @@ -558,6 +558,14 @@ void dds_qset_partition qos->present |= QP_PARTITION; } +void dds_qset_partition1 (dds_qos_t * __restrict qos, const char * __restrict name) +{ + if (name == NULL) + dds_qset_partition (qos, 0, NULL); + else + dds_qset_partition (qos, 1, (const char **) &name); +} + void dds_qset_reliability ( dds_qos_t * __restrict qos,