Bring QoS operations naming scheme in line with the rest
The main naming scheme is OPER_TYPE (i.e., dds_create_participant) but the QoS operations were named TYPE_OPER (i.e., dds_qos_create). This commit brings the QoS scheme in line with the rest, retaining the old names as a deprecated interface. Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
a519d9f597
commit
651bdfee06
36 changed files with 206 additions and 150 deletions
|
@ -30,11 +30,11 @@ int main (int argc, char ** argv)
|
|||
DDS_ERR_CHECK (topic, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
|
||||
/* Create a reliable Reader. */
|
||||
qos = dds_qos_create ();
|
||||
qos = dds_create_qos ();
|
||||
dds_qset_reliability (qos, DDS_RELIABILITY_RELIABLE, DDS_SECS (10));
|
||||
reader = dds_create_reader (participant, topic, qos, NULL);
|
||||
DDS_ERR_CHECK (reader, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete(qos);
|
||||
dds_delete_qos(qos);
|
||||
|
||||
printf ("\n=== [Subscriber] Waiting for a sample ...\n");
|
||||
|
||||
|
|
|
@ -442,35 +442,35 @@ static dds_entity_t prepare_dds(dds_entity_t *wr, dds_entity_t *rd, dds_entity_t
|
|||
DDS_ERR_CHECK (topic, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
|
||||
/* A DDS_Publisher is created on the domain participant. */
|
||||
pubQos = dds_qos_create ();
|
||||
pubQos = dds_create_qos ();
|
||||
dds_qset_partition (pubQos, 1, pubPartitions);
|
||||
|
||||
publisher = dds_create_publisher (participant, pubQos, NULL);
|
||||
DDS_ERR_CHECK (publisher, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete (pubQos);
|
||||
dds_delete_qos (pubQos);
|
||||
|
||||
/* A DDS_DataWriter is created on the Publisher & Topic with a modified Qos. */
|
||||
dwQos = dds_qos_create ();
|
||||
dwQos = dds_create_qos ();
|
||||
dds_qset_reliability (dwQos, DDS_RELIABILITY_RELIABLE, DDS_SECS (10));
|
||||
dds_qset_writer_data_lifecycle (dwQos, false);
|
||||
*wr = dds_create_writer (publisher, topic, dwQos, NULL);
|
||||
DDS_ERR_CHECK (*wr, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete (dwQos);
|
||||
dds_delete_qos (dwQos);
|
||||
|
||||
/* A DDS_Subscriber is created on the domain participant. */
|
||||
subQos = dds_qos_create ();
|
||||
subQos = dds_create_qos ();
|
||||
|
||||
dds_qset_partition (subQos, 1, subPartitions);
|
||||
|
||||
subscriber = dds_create_subscriber (participant, subQos, NULL);
|
||||
DDS_ERR_CHECK (subscriber, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete (subQos);
|
||||
dds_delete_qos (subQos);
|
||||
/* A DDS_DataReader is created on the Subscriber & Topic with a modified QoS. */
|
||||
drQos = dds_qos_create ();
|
||||
drQos = dds_create_qos ();
|
||||
dds_qset_reliability (drQos, DDS_RELIABILITY_RELIABLE, DDS_SECS(10));
|
||||
*rd = dds_create_reader (subscriber, topic, drQos, listener);
|
||||
DDS_ERR_CHECK (*rd, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete (drQos);
|
||||
dds_delete_qos (drQos);
|
||||
|
||||
waitSet = dds_create_waitset (participant);
|
||||
if (listener == NULL) {
|
||||
|
|
|
@ -164,38 +164,38 @@ static dds_entity_t prepare_dds(dds_entity_t *writer, dds_entity_t *reader, dds_
|
|||
|
||||
/* A DDS Publisher is created on the domain participant. */
|
||||
|
||||
qos = dds_qos_create ();
|
||||
qos = dds_create_qos ();
|
||||
dds_qset_partition (qos, 1, pubPartitions);
|
||||
|
||||
publisher = dds_create_publisher (participant, qos, NULL);
|
||||
DDS_ERR_CHECK (publisher, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete (qos);
|
||||
dds_delete_qos (qos);
|
||||
|
||||
/* A DDS DataWriter is created on the Publisher & Topic with a modififed Qos. */
|
||||
|
||||
qos = dds_qos_create ();
|
||||
qos = dds_create_qos ();
|
||||
dds_qset_reliability (qos, DDS_RELIABILITY_RELIABLE, DDS_SECS(10));
|
||||
dds_qset_writer_data_lifecycle (qos, false);
|
||||
*writer = dds_create_writer (publisher, topic, qos, NULL);
|
||||
DDS_ERR_CHECK (*writer, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete (qos);
|
||||
dds_delete_qos (qos);
|
||||
|
||||
/* A DDS Subscriber is created on the domain participant. */
|
||||
|
||||
qos = dds_qos_create ();
|
||||
qos = dds_create_qos ();
|
||||
dds_qset_partition (qos, 1, subPartitions);
|
||||
|
||||
subscriber = dds_create_subscriber (participant, qos, NULL);
|
||||
DDS_ERR_CHECK (subscriber, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete (qos);
|
||||
dds_delete_qos (qos);
|
||||
|
||||
/* A DDS DataReader is created on the Subscriber & Topic with a modified QoS. */
|
||||
|
||||
qos = dds_qos_create ();
|
||||
qos = dds_create_qos ();
|
||||
dds_qset_reliability (qos, DDS_RELIABILITY_RELIABLE, DDS_SECS(10));
|
||||
*reader = dds_create_reader (subscriber, topic, qos, listener);
|
||||
DDS_ERR_CHECK (*reader, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete (qos);
|
||||
dds_delete_qos (qos);
|
||||
|
||||
waitSet = dds_create_waitset (participant);
|
||||
if (listener == NULL) {
|
||||
|
|
|
@ -171,21 +171,21 @@ static dds_entity_t prepare_dds(dds_entity_t *writer, const char *partitionName)
|
|||
DDS_ERR_CHECK (topic, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
|
||||
/* A publisher is created on the domain participant. */
|
||||
pubQos = dds_qos_create ();
|
||||
pubQos = dds_create_qos ();
|
||||
pubParts[0] = partitionName;
|
||||
dds_qset_partition (pubQos, 1, pubParts);
|
||||
publisher = dds_create_publisher (participant, pubQos, NULL);
|
||||
DDS_ERR_CHECK (publisher, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete (pubQos);
|
||||
dds_delete_qos (pubQos);
|
||||
|
||||
/* A DataWriter is created on the publisher. */
|
||||
dwQos = dds_qos_create ();
|
||||
dwQos = dds_create_qos ();
|
||||
dds_qset_reliability (dwQos, DDS_RELIABILITY_RELIABLE, DDS_SECS (10));
|
||||
dds_qset_history (dwQos, DDS_HISTORY_KEEP_ALL, 0);
|
||||
dds_qset_resource_limits (dwQos, MAX_SAMPLES, DDS_LENGTH_UNLIMITED, DDS_LENGTH_UNLIMITED);
|
||||
*writer = dds_create_writer (publisher, topic, dwQos, NULL);
|
||||
DDS_ERR_CHECK (*writer, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete (dwQos);
|
||||
dds_delete_qos (dwQos);
|
||||
|
||||
/* Enable write batching */
|
||||
dds_write_set_batch (true);
|
||||
|
|
|
@ -347,8 +347,8 @@ static dds_entity_t prepare_dds(dds_entity_t *reader, const char *partitionName)
|
|||
|
||||
int32_t maxSamples = 400;
|
||||
const char *subParts[1];
|
||||
dds_qos_t *subQos = dds_qos_create ();
|
||||
dds_qos_t *drQos = dds_qos_create ();
|
||||
dds_qos_t *subQos = dds_create_qos ();
|
||||
dds_qos_t *drQos = dds_create_qos ();
|
||||
|
||||
/* A Participant is created for the default domain. */
|
||||
|
||||
|
@ -366,7 +366,7 @@ static dds_entity_t prepare_dds(dds_entity_t *reader, const char *partitionName)
|
|||
dds_qset_partition (subQos, 1, subParts);
|
||||
subscriber = dds_create_subscriber (participant, subQos, NULL);
|
||||
DDS_ERR_CHECK (subscriber, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete (subQos);
|
||||
dds_delete_qos (subQos);
|
||||
|
||||
/* A Reader is created on the Subscriber & Topic with a modified Qos. */
|
||||
|
||||
|
@ -400,7 +400,7 @@ static dds_entity_t prepare_dds(dds_entity_t *reader, const char *partitionName)
|
|||
|
||||
*reader = dds_create_reader (subscriber, topic, drQos, rd_listener);
|
||||
DDS_ERR_CHECK (*reader, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
dds_qos_delete (drQos);
|
||||
dds_delete_qos (drQos);
|
||||
dds_listener_delete(rd_listener);
|
||||
|
||||
return participant;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue