class Syskit::InstanceRequirementsTask

These tasks represent the set of InstanceRequirements that should be deployed by NetworkGeneration::Engine

Attributes

requirements[RW]

The instance that should be added to the network

@return [InstanceRequirements]

Public Class Methods

subplan(new_spec, **arguments) click to toggle source

Creates the subplan required to add the given InstanceRequirements to the generated network

This is usually not used directly, use as_plan instead

@see Syskit::InstanceRequirements#as_plan, Component#as_plan,

DataService#as_plan
# 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

Public Instance Methods

executable?() click to toggle source

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

Calls superclass method
# File lib/syskit/instance_requirements_task.rb, line 26
def executable?
    super && !!requirements
end