コード例 #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
 public void Dispose()
 {
     _subscriber.DeleteDataReader(_dataReader);
     _dataWriter.UnregisterInstance(_dataToSend, _dataToSendHandle);
     _publisher.DeleteDataWriter(_dataWriter);
     _participant.DeleteTopic(_receiverTopic);
     _participant.DeleteTopic(_senderTopic);
     _participant.DeletePublisher(_publisher);
     _participant.DeleteSubscriber(_subscriber);
 }
コード例 #3
0
 /// <summary>
 /// Deletes the class's Subscriber
 /// </summary>
 public void deleteSubscriber()
 {
     status = participant.DeleteSubscriber(subscriber);
     ErrorHandler.checkStatus(status, "Participant.DeleteSubscriber");
 }