Exemple #1
0
DDS_ReturnCode_t
DDS_DomainParticipant_delete_simulated_multitopic(
    DDS_DomainParticipant participant,
    DDS_TopicDescription smt 
)
{
    DDS_ReturnCode_t status;
    struct MsgListenerState *listener_state;
    
    /* Obtain all entities mentioned in the listener state. */
    listener_state = (struct MsgListenerState *) msgListener->listener_data;

    /* Remove the DataWriter */
    status = DDS_Publisher_delete_datawriter(multiPub, listener_state->namedMessageDW);
    checkStatus(status, "DDS_Publisher_delete_datawriter");
    
    /* Remove the Publisher. */
    status = DDS_DomainParticipant_delete_publisher(participant, multiPub);
    checkStatus(status, "DDS_DomainParticipant_delete_publisher");
    
    /* Remove the QueryCondition and its parameters. */
    DDS_free(listener_state->nameFinderParams);
    status = DDS_DataReader_delete_readcondition(
        listener_state->nameServiceDR,
        listener_state->nameFinder);
    checkStatus(status, "DDS_DataReader_delete_readcondition");
    
    /* Remove the DataReaders. */
    status = DDS_Subscriber_delete_datareader(multiSub, listener_state->nameServiceDR);
    checkStatus(status, "DDS_Subscriber_delete_datareader");
    status = DDS_Subscriber_delete_datareader(multiSub, listener_state->chatMessageDR);
    checkStatus(status, "DDS_Subscriber_delete_datareader");
    
    /* Remove the DataReaderListener and its state. */
    free(listener_state);
    DDS_free(msgListener);
    
    /* Remove the Subscriber. */
    status = DDS_DomainParticipant_delete_subscriber(participant, multiSub);
    checkStatus(status, "DDS_DomainParticipant_delete_subscriber");
    
    /* Remove the ContentFilteredTopic. */
    status = DDS_DomainParticipant_delete_contentfilteredtopic(participant, filteredMessageTopic);
    checkStatus(status, "DDS_DomainParticipant_delete_contentfilteredtopic");
    
    /* Remove all other topics. */
    status = DDS_DomainParticipant_delete_topic(participant, namedMessageTopic);
    checkStatus(status, "DDS_DomainParticipant_delete_topic (namedMessageTopic)");
    status = DDS_DomainParticipant_delete_topic(participant, nameServiceTopic);
    checkStatus(status, "DDS_DomainParticipant_delete_topic (nameServiceTopic)");
    status = DDS_DomainParticipant_delete_topic(participant, chatMessageTopic);
    checkStatus(status, "DDS_DomainParticipant_delete_topic (chatMessageTopic)");
    
    return status;
}
Exemple #2
0
void deleteQueryCondition(DDS_DataReader dataReader, DDS_QueryCondition queryCondition)
{
   g_status = DDS_DataReader_delete_readcondition(dataReader, queryCondition);

   checkStatus(g_status, "DDS_DataReader_delete_readcondition");
}