RTI Connext Traditional C++ API
Version 7.0.0
Publisher Use Cases
Programming How-To's
Working with publishers.
More...
Working with publishers.
Setting up a publisher
Set up participant
Create a
DDSPublisher
DDS_PublisherQos
publisher_qos;
// MyPublisherListener is user defined and
// extends DDSPublisherListener
DDSPublisherListener
* publisher_listener =
=
new
MyPublisherListener();
// or = NULL
participant->
get_default_publisher_qos
(publisher_qos);
DDSPublisher
* publisher = participant->
create_publisher
(publisher_qos,
publisher_listener,
DDS_STATUS_MASK_ALL
);
if
(publisher == NULL) {
// ... error
};
Tearing down a publisher
Delete
DDSPublisher
:
DDS_ReturnCode_t
retcode;
retcode = participant->
delete_publisher
(publisher);
if
(retcode !=
DDS_RETCODE_OK
) {
// ... check for cause of failure
}