class Roby::Queries::AndMatcher

This task combines multiple task matching predicates through a AND boolean operator. I.e. it will match if none of the underlying predicates match.

Public Class Methods

new(*ops) click to toggle source

Create a new AndMatcher object combining the given predicates.

# File lib/roby/queries/and_matcher.rb, line 8
def initialize(*ops)
    @ops = ops 
end

Public Instance Methods

<<(op) click to toggle source

Add a new predicate to the combination

# File lib/roby/queries/and_matcher.rb, line 23
def <<(op); @ops << op end
===(task) click to toggle source

True if the task matches at least one of the underlying predicates

# File lib/roby/queries/and_matcher.rb, line 26
def ===(task)
    @ops.all? { |op| op === task }
end
filter(task_set, task_index) click to toggle source

Filters as much as non-matching tasks as possible out of task_set, based on the information in task_index

# File lib/roby/queries/and_matcher.rb, line 14
def filter(task_set, task_index)
    result = task_set
    for child in @ops
        result &= child.filter(task_set, task_index)
    end
    result
end