T
under the name "My_Type" const char* type_name = "My_Type"; DDS_ReturnCode_t retcode; retcode = FooTypeSupport::register_type(participant, type_name); if (retcode != DDS_RETCODE_OK) { // ... error }
const char* topic_name = "my_topic"; const char* type_type = "My_Type"; // user data type DDS_TopicQos topic_qos; DDS_ReturnCode_t retcode; // MyTopicListener is user defined and // extends DDSTopicListener DDSTopicListener* topic_listener = new MyTopicListener(); // or = NULL retcode = participant->get_default_topic_qos(topic_qos); if (retcode != DDS_RETCODE_OK) { // ... error } DDSTopic* topic = participant->create_topic(topic_name, type_name, topic_qos, topic_listener, DDS_STATUS_MASK_ALL); if (topic == NULL) { // ... error };
DDS_ReturnCode_t retcode; retcode = participant->delete_topic(topic); if (retcode != DDS_RETCODE_OK) { // ... check for cause of failure }