class Roby::Tasks::Virtual

A virtual task is a task representation for a combination of two events. This allows to combine two unrelated events, one being the start event of the virtual task and the other its success event.

The task fails if the success event becomes unreachable.

See VirtualTask.create

Attributes

actual_start_event[R]

The start event

actual_success_event[RW]

The success event

Public Class Methods

create(start, success) click to toggle source

Creates a new VirtualTask with the given start and success events

# File lib/roby/tasks/virtual.rb, line 37
def self.create(start, success)
    task = VirtualTask.new
    task.actual_start_event = start
    task.actual_success_event = success

    if start.respond_to?(:task)
        task.depends_on start.task
    end
    if success.respond_to?(:task)
        task.depends_on success.task
    end

    task
end

Public Instance Methods

actual_start_event=(ev) click to toggle source

Set the start event

# File lib/roby/tasks/virtual.rb, line 16
def actual_start_event=(ev)
    if !ev.controlable?
        raise ArgumentError, "the start event of a virtual task must be controlable"
    end
    @actual_start_event = ev
end