Class: Roby::Group

Inherits:
Task show all
Defined in:
lib/roby/task-operations.rb

Constant Summary

Constants included from Log::TaskHooks

Log::TaskHooks::HOOKS

Constants included from Log::BasicObjectHooks

Log::BasicObjectHooks::HOOKS

Instance Attribute Summary

Attributes inherited from PlanObject

#executable, #plan, #removed_at

Attributes inherited from BasicObject

#distribute

Instance Method Summary collapse

Methods inherited from Task

#_dump, _load, #droby_dump, improves, #improves?, improves?, match, needs, #needs?, needs?

Methods included from TaskStructure::ModelConflicts

#conflicts_with, #conflicts_with?

Methods included from Distributed::DRobyTaskModel::Dump

#droby_dump

Methods included from Distributed::DRobyModel::Dump

#droby_dump

Methods included from Distributed::TaskNotifications

#updated_data

Methods included from TaskOperations

#+, #|

Methods included from Log::TaskHooks

#added_child_object, #removed_child_object

Methods inherited from PlanObject

#add_child_object, #apply_relation_changes, child_plan_object, #each_plan_child, #executable?, #finalized?, #forget_peer, #read_write?, #remotely_useful?, #removing_child_object, #replace_by, #replace_subplan_by, #root_object, #root_object?, #subscribed?, #update_on?, #updated_by?

Methods included from Distributed::RelationModificationHooks

#added_child_object, #removed_child_object

Methods included from Transactions::PlanObjectUpdates

#adding_child_object, #removing_child_object

Methods included from DirectedRelationSupport

#add_child_object, #add_parent_object, #check_is_relation, #related_objects, #relations, #remove_child_object, #remove_children, #remove_parent_object, #remove_parents, #remove_relations

Methods inherited from BasicObject

#add_sibling_for, #distribute?, distribute?, #finalized?, #forget_peer, #has_sibling_on?, #initialize_copy, local_only, #read_write?, #remotely_useful?, #remove_sibling_for, #self_owned?, #sibling_of, #sibling_on, #subscribe, #subscribed?, #update_on?, #updated?, #updated_by?, #updated_peers

Methods included from Log::BasicObjectHooks

#added_owner, #removed_owner

Constructor Details

#initialize(*tasks) ⇒ Group

Returns a new instance of Group.



157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/roby/task-operations.rb', line 157

def initialize(*tasks)
    super()
    if tasks.empty? || tasks.first.kind_of?(Hash)
  return
    end

    success = AndGenerator.new
    tasks.each do |task|
  realized_by task
  task.event(:success).on success
    end
    success.forward event(:success)
end