Module: Syskit::Models::Deployment
- Includes:
- MetaRuby::ModelAsClass, Base, OrogenBase
- Included in:
- Deployment
- Defined in:
- lib/syskit/models/deployment.rb
Instance Attribute Summary collapse
-
#orogen_model ⇒ Object
- Orocos::Generation::Deployment
-
the deployment model.
Instance Method Summary collapse
-
#all_default_name_mapping ⇒ Array<String,String>
The union, along the class hierarchy, of all the values stored in default_name_mapping.
-
#all_default_run_option ⇒ Array<String,String>
The union, along the class hierarchy, of all the values stored in default_run_option.
-
#default_name_mapping ⇒ Hash<String,String>
The set of default name mappings for the instances of this deployment model.
-
#default_name_mappings ⇒ Hash<String,String>
The set of default name mappings for the instances of this deployment model.
-
#default_run_option ⇒ Hash<String,String>
The options that should be passed when starting the underlying Orocos process.
-
#default_run_options ⇒ Hash<String,String>
The options that should be passed when starting the underlying Orocos process.
-
#define_from_orogen(orogen_model, register: false) ⇒ Models::Deployment
Creates a subclass of Deployment that represents the given deployment.
-
#deployment_name ⇒ Object
Returns the name of this particular deployment instance.
-
#each_default_name_mapping {|element| ... } ⇒ Object
Enumerates all objects registered in default_name_mapping.
-
#each_default_run_option {|element| ... } ⇒ Object
Enumerates all objects registered in default_run_option.
-
#each_deployed_task_model {|name, model| ... } ⇒ Object
Enumerate the tasks that are deployed in self.
-
#each_deployed_task_name ⇒ Object
Enumerate the names of the tasks deployed by self.
-
#each_orogen_deployed_task_context_model {|deployed_task| ... } ⇒ void
Enumerates the deployed tasks this deployment contains.
- #instanciate(plan, arguments = Hash.new) ⇒ Object
-
#new_submodel(name: nil, orogen_model: nil, **options, &block) ⇒ Deployment
Creates a new deployment model.
-
#supermodel ⇒ Object
- Models::Deployment
-
Returns the parent model for this class, or nil if it is the root model.
-
#tasks ⇒ Object
An array of Orocos::Generation::TaskDeployment instances that represent the tasks available in this deployment.
Methods included from OrogenBase
#find_model_by_orogen, #find_model_from_orogen_name, #has_model_for?, #model_for
Methods included from Base
#dependency_injection_names, #pretty_print, #short_name, #to_instance_requirements, #to_s
Instance Attribute Details
#orogen_model ⇒ Object
- Orocos::Generation::Deployment
-
the deployment model
31 32 33 |
# File 'lib/syskit/models/deployment.rb', line 31 def orogen_model @orogen_model end |
Instance Method Details
#all_default_name_mapping ⇒ Array<String,String>
The union, along the class hierarchy, of all the values stored in default_name_mapping
20 |
# File 'lib/syskit/models/deployment.rb', line 20 inherited_attribute('default_name_mapping', 'default_name_mappings', map: true) { Hash.new } |
#all_default_run_option ⇒ Array<String,String>
The union, along the class hierarchy, of all the values stored in default_run_option
13 |
# File 'lib/syskit/models/deployment.rb', line 13 inherited_attribute('default_run_option', 'default_run_options', map: true) { Hash.new } |
#default_name_mapping ⇒ Hash<String,String>
The set of default name mappings for the instances of this deployment model
20 |
# File 'lib/syskit/models/deployment.rb', line 20 inherited_attribute('default_name_mapping', 'default_name_mappings', map: true) { Hash.new } |
#default_name_mappings ⇒ Hash<String,String>
The set of default name mappings for the instances of this deployment model
20 |
# File 'lib/syskit/models/deployment.rb', line 20 inherited_attribute('default_name_mapping', 'default_name_mappings', map: true) { Hash.new } |
#default_run_option ⇒ Hash<String,String>
The options that should be passed when starting the underlying Orocos process.
13 |
# File 'lib/syskit/models/deployment.rb', line 13 inherited_attribute('default_run_option', 'default_run_options', map: true) { Hash.new } |
#default_run_options ⇒ Hash<String,String>
The options that should be passed when starting the underlying Orocos process.
13 |
# File 'lib/syskit/models/deployment.rb', line 13 inherited_attribute('default_run_option', 'default_run_options', map: true) { Hash.new } |
#define_from_orogen(orogen_model, register: false) ⇒ Models::Deployment
Creates a subclass of Deployment that represents the given deployment
77 78 79 80 81 82 83 |
# 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 |
#deployment_name ⇒ Object
Returns the name of this particular deployment instance
34 35 36 |
# File 'lib/syskit/models/deployment.rb', line 34 def deployment_name orogen_model.name end |
#each_default_name_mapping {|element| ... } ⇒ Object
Enumerates all objects registered in default_name_mapping
20 |
# File 'lib/syskit/models/deployment.rb', line 20 inherited_attribute('default_name_mapping', 'default_name_mappings', map: true) { Hash.new } |
#each_default_run_option {|element| ... } ⇒ Object
Enumerates all objects registered in default_run_option
13 |
# File 'lib/syskit/models/deployment.rb', line 13 inherited_attribute('default_run_option', 'default_run_options', map: true) { Hash.new } |
#each_deployed_task_model {|name, model| ... } ⇒ Object
Enumerate the tasks that are deployed in self
104 105 106 107 108 109 110 111 |
# File 'lib/syskit/models/deployment.rb', line 104 def each_deployed_task_model return enum_for(__method__) if !block_given? each_orogen_deployed_task_context_model do |deployed_task| task_model = Syskit::TaskContext.model_for(deployed_task.task_model) yield(deployed_task.name, task_model) end end |
#each_deployed_task_name ⇒ Object
Enumerate the names of the tasks deployed by self
93 94 95 96 97 98 |
# File 'lib/syskit/models/deployment.rb', line 93 def each_deployed_task_name return enum_for(__method__) if !block_given? orogen_model.task_activities.each do |task| yield(task.name) end end |
#each_orogen_deployed_task_context_model {|deployed_task| ... } ⇒ void
This method returns an undefined value.
Enumerates the deployed tasks this deployment contains
117 118 119 |
# File 'lib/syskit/models/deployment.rb', line 117 def each_orogen_deployed_task_context_model(&block) orogen_model.task_activities.each(&block) end |
#instanciate(plan, arguments = Hash.new) ⇒ Object
38 39 40 41 |
# File 'lib/syskit/models/deployment.rb', line 38 def instanciate(plan, arguments = Hash.new) plan.add(task = new(arguments)) task end |
#new_submodel(name: nil, orogen_model: nil, **options, &block) ⇒ Deployment
Creates a new deployment model
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/syskit/models/deployment.rb', line 51 def new_submodel(name: nil, orogen_model: nil, **, &block) klass = super(name: name, **) do self.orogen_model = orogen_model || Models.create_orogen_deployment_model(name) if block self.orogen_model.instance_eval(&block) end end klass.each_deployed_task_name do |name| klass.default_name_mappings[name] = name end klass end |
#supermodel ⇒ Object
- Models::Deployment
-
Returns the parent model for this class, or
nil if it is the root model
24 25 26 27 28 |
# File 'lib/syskit/models/deployment.rb', line 24 def supermodel if superclass.respond_to?(:register_submodel) return superclass end end |
#tasks ⇒ Object
An array of Orocos::Generation::TaskDeployment instances that represent the tasks available in this deployment. Associated plan objects can be instanciated with #task
88 89 90 |
# File 'lib/syskit/models/deployment.rb', line 88 def tasks orogen_model.task_activities end |