示例#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);
         }
     }
 }