예제 #1
0
 private void NotifySubscribers(OPSMessage newMessage)
 {
     foreach (Subscriber subscriber in subscribers)
     {
         if (subscriber.GetTopic().GetName().Equals(newMessage.GetTopicName()))
         {
             subscriber.NotifyNewOPSMessage(newMessage);
         }
     }
 }
예제 #2
0
 public void NotifyNewOPSMessage(OPSMessage message)
 {
     //Check that this message is delivered on the same topic as this Subscriber use
     //This is needed when we allow several topics to use the same port
     if (message.GetTopicName() != topic.GetName())
     {
         return;
     }
     ///For now we don't do this type check to minimize performance loss
     ////Check that the type of the delivered data can be interpreted as the type we expect in this Subscriber
     //if (message.GetData().GetTypesString().IndexOf(topic.GetTypeID()) < 0)
     //{
     //    return;
     //}
     if (messageFilters.ApplyFilter(message))
     {
         this.message = message;
         this.NotifyNewOPSObject(message.GetData());
     }
 }
예제 #3
0
파일: Subscriber.cs 프로젝트: staxgr/ops
 public void NotifyNewOPSMessage(OPSMessage message)
 {
     //Check that this message is delivered on the same topic as this Subscriber use
     //This is needed when we allow several topics to use the same port
     if (message.GetTopicName() != topic.GetName())
     {
         return;
     }
     ///For now we don't do this type check to minimize performance loss
     ////Check that the type of the delivered data can be interpreted as the type we expect in this Subscriber
     //if (message.GetData().GetTypesString().IndexOf(topic.GetTypeID()) < 0)
     //{
     //    return;
     //}
     if (messageFilters.ApplyFilter(message))
     {
         this.message = message;
         this.NotifyNewOPSObject(message.GetData());
     }
 }
예제 #4
0
 private void NotifySubscribers(OPSMessage newMessage)
 {
     foreach (Subscriber subscriber in subscribers)
     {
         if(subscriber.GetTopic().GetName().Equals(newMessage.GetTopicName()))
         {
             subscriber.NotifyNewOPSMessage(newMessage);
         }
     }
 }