Class: Syskit::InstanceRequirementsTask
- Defined in:
- lib/syskit/instance_requirements_task.rb
Overview
These tasks represent the set of InstanceRequirements that should be deployed by NetworkGeneration::Engine
Instance Attribute Summary collapse
-
#requirements ⇒ InstanceRequirements
The instance that should be added to the network.
Task Arguments collapse
-
#action_arguments ⇒ Object
If this planning task has been created through an action object, this contains the arguments that were passed to it.
-
#action_arguments= ⇒ Object
If this planning task has been created through an action object, this contains the arguments that were passed to it.
-
#action_model ⇒ Object
If this planning task has been created through an action object, this is it.
-
#action_model= ⇒ Object
If this planning task has been created through an action object, this is it.
Class Method Summary collapse
-
.subplan(new_spec, **arguments) ⇒ Object
Creates the subplan required to add the given InstanceRequirements to the generated network.
Instance Method Summary collapse
-
#executable? ⇒ Boolean
This task is executable only if a requirement object has been set.
Instance Attribute Details
#requirements ⇒ InstanceRequirements
The instance that should be added to the network
20 21 22 |
# File 'lib/syskit/instance_requirements_task.rb', line 20 def requirements @requirements end |
Class Method Details
.subplan(new_spec, **arguments) ⇒ Object
Creates the subplan required to add the given InstanceRequirements to the generated network
This is usually not used directly, use #as_plan instead
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/syskit/instance_requirements_task.rb', line 37 def self.subplan(new_spec, **arguments) if !new_spec.kind_of?(InstanceRequirements) new_spec = InstanceRequirements.new([new_spec]) end root = new_spec.create_proxy_task planner = self.new(**arguments) planner.requirements = new_spec root.should_start_after(planner) planner.schedule_as(root) root.planned_by(planner) root end |
Instance Method Details
#action_arguments ⇒ Object
If this planning task has been created through an action object, this contains the arguments that were passed to it
15 |
# File 'lib/syskit/instance_requirements_task.rb', line 15 argument :action_arguments, default: nil |
#action_arguments= ⇒ Object
If this planning task has been created through an action object, this contains the arguments that were passed to it
15 |
# File 'lib/syskit/instance_requirements_task.rb', line 15 argument :action_arguments, default: nil |
#action_model ⇒ Object
If this planning task has been created through an action object, this is it
11 |
# File 'lib/syskit/instance_requirements_task.rb', line 11 argument :action_model, default: nil |
#action_model= ⇒ Object
If this planning task has been created through an action object, this is it
11 |
# File 'lib/syskit/instance_requirements_task.rb', line 11 argument :action_model, default: nil |
#executable? ⇒ Boolean
This task is executable only if a requirement object has been set
We don't use task arguments here as InstanceRequirements is not (yet) marshallable
26 27 28 |
# File 'lib/syskit/instance_requirements_task.rb', line 26 def executable? super && !!requirements end |