Class: Roby::Coordination::Task
- Defined in:
- lib/roby/coordination/task.rb
Overview
Representation of a toplevel task in an execution context instance
Direct Known Subclasses
Instance Attribute Summary collapse
-
#task ⇒ nil, Roby::Task
readonly
The actual Roby task this is representing.
Attributes inherited from TaskBase
Instance Method Summary collapse
-
#bind(task) ⇒ Object
Associate this coordination task to the given roby task.
-
#initialize(execution_context, model) ⇒ Task
constructor
A new instance of Task.
- #name ⇒ Object
-
#resolve ⇒ Roby::Task
Resolves this to the actual task object.
- #root_task ⇒ Object
- #to_s ⇒ Object
Methods inherited from TaskBase
#find_child, #find_event, #find_through_method_missing, #has_through_method_missing?, #to_coordination_task
Constructor Details
#initialize(execution_context, model) ⇒ Task
Returns a new instance of Task.
11 12 13 14 |
# File 'lib/roby/coordination/task.rb', line 11 def initialize(execution_context, model) super(execution_context, model) @task = nil end |
Instance Attribute Details
#task ⇒ nil, Roby::Task (readonly)
Returns the actual Roby task this is representing.
9 10 11 |
# File 'lib/roby/coordination/task.rb', line 9 def task @task end |
Instance Method Details
#bind(task) ⇒ Object
Associate this coordination task to the given roby task
This sets the next value returned by #resolve
25 26 27 |
# File 'lib/roby/coordination/task.rb', line 25 def bind(task) @task = task end |
#name ⇒ Object
42 43 44 |
# File 'lib/roby/coordination/task.rb', line 42 def name model.name end |
#resolve ⇒ Roby::Task
Resolves this to the actual task object
33 34 35 36 37 38 39 40 |
# File 'lib/roby/coordination/task.rb', line 33 def resolve unless task raise ResolvingUnboundObject, "trying to resolve #{self}, which is not (yet) bound" end task end |
#root_task ⇒ Object
16 17 18 |
# File 'lib/roby/coordination/task.rb', line 16 def root_task self end |
#to_s ⇒ Object
46 47 48 |
# File 'lib/roby/coordination/task.rb', line 46 def to_s "Task[#{model.model}]" end |