module Syskit::Models::Deployment
Attributes
- Orocos::Generation::Deployment
-
the deployment model
Public Instance Methods
Creates a subclass of Deployment that represents the given deployment
@param [Orocos::Spec::Deployment] #orogen_model the oroGen
deployment model
@option options [Boolean] register (false) if true, and if the
deployment model has a name, the resulting syskit model is registered as a constant in the ::Deployments namespace. The constant's name is the camelized orogen model name.
@return [Models::Deployment] the deployment model
# File lib/syskit/models/deployment.rb, line 77 def define_from_orogen(orogen_model, register: false) model = new_submodel(orogen_model: orogen_model) if register && orogen_model.name Deployments.const_set(orogen_model.name.camelcase(:upper), model) end model end
Returns the name of this particular deployment instance
# File lib/syskit/models/deployment.rb, line 34 def deployment_name orogen_model.name end
Enumerates the deployed tasks this deployment contains
@yieldparam [Orocos::Generation::DeployedTask] deployed_task @return [void]
# File lib/syskit/models/deployment.rb, line 96 def each_orogen_deployed_task_context_model(&block) orogen_model.task_activities.each(&block) end
# File lib/syskit/models/deployment.rb, line 38 def instanciate(plan, arguments = Hash.new) plan.add(task = new(arguments)) task end
Creates a new deployment model
@option options [Orocos::Spec::Deployment] #orogen_model the oroGen
model for this deployment
@option options [String] name the model name, for anonymous model.
It is usually not necessary to provide it.
@return [Deployment] the deployment class, as a subclass of
Deployment
# File lib/syskit/models/deployment.rb, line 51 def new_submodel(name: nil, orogen_model: nil, **options, &block) klass = super(name: name, **options) do self.orogen_model = orogen_model || Models.create_orogen_deployment_model(name) if block self.orogen_model.instance_eval(&block) end end klass.each_orogen_deployed_task_context_model do |deployed_task| klass.default_name_mappings[deployed_task.name] = deployed_task.name end klass end
- Models::Deployment
-
Returns the parent model for this class, or
nil if it is the root model
# File lib/syskit/models/deployment.rb, line 24 def supermodel if superclass.respond_to?(:register_submodel) return superclass end end
An array of Orocos::Generation::TaskDeployment instances that represent the tasks available in this deployment. Associated plan objects can be instanciated with task
# File lib/syskit/models/deployment.rb, line 88 def tasks orogen_model.task_activities end