Пример #1
0
        public ReturnCode DeleteSimulatedMultitopic(ITopicDescription smt)
        {
            ReturnCode status;

            /* Remove the DataWriter */
            status = multiPub.DeleteDataWriter(msgListener.NamedMessageDW);
            ErrorHandler.checkStatus(status, "DDS.Publisher.DeleteDatawriter");

            /* Remove the Publisher. */
            status = realParticipant.DeletePublisher(multiPub);
            ErrorHandler.checkStatus(
                status, "DDS.DomainParticipant.DeletePublisher");

            /* Remove the QueryCondition. */
            status = msgListener.NameServiceDR.DeleteReadCondition(
                msgListener.NameFinder);
            ErrorHandler.checkStatus(
                status, "DDS.DataReader.DeleteReadcondition");

            /* Remove the DataReaders. */
            status = multiSub.DeleteDataReader(msgListener.NameServiceDR);
            ErrorHandler.checkStatus(status, "DDS.Subscriber.DeleteDatareader");
            status = multiSub.DeleteDataReader(msgListener.ChatMessageDR);
            ErrorHandler.checkStatus(status, "DDS.Subscriber.DeleteDatareader");

            /* Remove the Subscriber. */
            status = realParticipant.DeleteSubscriber(multiSub);
            ErrorHandler.checkStatus(
                status, "DDS.DomainParticipant.DeleteSubscriber");

            /* Remove the ContentFilteredTopic. */
            status = realParticipant.DeleteContentFilteredTopic(
                filteredMessageTopic);
            ErrorHandler.checkStatus(
                status, "DDS.DomainParticipant.DeleteContentfilteredtopic");

            /* Remove all other topics. */
            status = realParticipant.DeleteTopic(namedMessageTopic);
            ErrorHandler.checkStatus(
                status, "DDS.DomainParticipant.DeleteTopic (namedMessageTopic)");
            status = realParticipant.DeleteTopic(nameServiceTopic);
            ErrorHandler.checkStatus(
                status, "DDS.DomainParticipant.DeleteTopic (nameServiceTopic)");
            status = realParticipant.DeleteTopic(chatMessageTopic);
            ErrorHandler.checkStatus(
                status, "DDS.DomainParticipant.DeleteTopic (chatMessageTopic)");

            return(status);
        }
Пример #2
0
 /// <summary>
 /// Delete a ContentFilteredTopic
 /// </summary>
 public void deleteContentFilteredTopic()
 {
     if (filteredTopic == null)
     {
         return;
     }
     else
     {
         status = participant.DeleteContentFilteredTopic(filteredTopic);
         ErrorHandler.checkStatus(status, "DDS.DomainParticipant.DeleteContentFilteredTopic");
     }
 }