module Roby::EventConstraints::UnboundPredicateSupport

Module that defines the unbound task predicate methods that are added to the Symbol class

Public Instance Methods

and(other) click to toggle source

Returns an UnboundTaskPredicate that will be true if the generator represented by this symbol has emitted at least once, and the predicate represented by other is true at the same time.

In its simplest form,

:blocked.and(:updated)

it will be true if the task on which it is applied has both emitted :blocked and :updated at least once.

# File lib/roby/event_constraints.rb, line 93
def and(other)
    to_unbound_task_predicate.
        and(other.to_unbound_task_predicate)
end
emitted?() click to toggle source

Returns an UnboundTaskPredicate that will be true if the generator represented by this symbol has emitted at least once.

In its simplest form,

:blocked.emitted?

will be true when evaluated on a task whose blocked event has emitted at least once

# File lib/roby/event_constraints.rb, line 54
def emitted?
    to_unbound_task_predicate
end
followed_by(other) click to toggle source

Returns an UnboundTaskPredicate that will be true if the generator represented by this symbol and the generator represented by other (as a symbol) have emitted in sequence, i.e. if both self and other have emitted at least once, and if the last event e0 emitted by self and the last event e1 emitted by other match

e0.time < e1.time

Unlike and, or and negate, this only works on single events (i.e. it cannot be applied on other predicates)

# File lib/roby/event_constraints.rb, line 124
def followed_by(other)
    to_unbound_task_predicate.
        followed_by(other.to_unbound_task_predicate)
end
happened?() click to toggle source

@deprecated use {#emitted?} instead

# File lib/roby/event_constraints.rb, line 59
def happened?
    Roby.warn_deprecated "#happened? is deprecated, use #emitted? instead"
    emitted?
end
negate() click to toggle source

Returns an UnboundTaskPredicate that will be true if the generator represented by self has never emitted

# File lib/roby/event_constraints.rb, line 147
def negate
    to_unbound_task_predicate.negate
end
never() click to toggle source

Returns an UnboundTaskPredicate that will be true if the generator represented by this symbol will never be emitted.

In its simplest form,

:blocked.never

will be true when evaluated on a task whose blocked event has not yet been emitted, and has been declared as unreachable

# File lib/roby/event_constraints.rb, line 79
def never
    to_unbound_task_predicate.never
end
not_followed_by(other) click to toggle source

Returns an UnboundTaskPredicate that will be true if the generator represented by this symbol and the generator represented by other (as a symbol) have not emitted in sequence, i.e. if self has emitted at least once, and either other has not emitted or other has emitted and the last event e0 emitted by self and the last event e1 emitted by other do not match

e0.time < e1.time

Unlike and, or and negate, this only works on single events (i.e. it cannot be applied on other predicates)

# File lib/roby/event_constraints.rb, line 140
def not_followed_by(other)
    to_unbound_task_predicate.
        not_followed_by(other.to_unbound_task_predicate)
end
or(other) click to toggle source

Returns an UnboundTaskPredicate that will be true if the generator represented by this symbol has emitted at least once, or the predicate represented by other is true.

In its simplest form,

:blocked.or(:updated)

it will be true if the task on which it is applied has either emitted :blocked, or emitted :updated, or both.

# File lib/roby/event_constraints.rb, line 108
def or(other)
    to_unbound_task_predicate.
        or(other.to_unbound_task_predicate)
end
to_unbound_task_predicate() click to toggle source

Protocol method. The unbound task predicate call always calls to_unbound_task_predicate on the arguments given to it.

# File lib/roby/event_constraints.rb, line 66
def to_unbound_task_predicate
    UnboundTaskPredicate::SingleEvent.new(self)
end