void IRemoteRepo.FilterTopicMsgs(comm.TopicFilterMsg msg, PFilterFunc[] filters) { lock (_mutex) _impl.FilterTopicMsgs(msg, filters); }
private bool filter_is_matched(PFilterFunc[] filters, object msg) { if (filters.IsEmpty()) return false; foreach (var filter in filters) { var filterIsMatched = filter(msg); if (filterIsMatched) return true; } return false; }
void IRemoteRepo.FilterTopicMsgs(comm.TopicFilterMsg msg, PFilterFunc[] filters) { var agent = get_agent(msg.AgentToFilter); if (agent.SnapshotId > msg.SnapshotId) return; if (agent.FilteredTopics == null) agent.FilteredTopics = new List<FilteredTopic>(); var topic = new FilteredTopic { TopicGuid = msg.TopicGuid, TopicName = msg.TopicName, Filters = filters, FilterInfos = msg.Filters }; agent.FilteredTopics.Add(topic); }