Class: Syskit::Models::BoundDynamicDataService
- Inherits:
-
BoundDataService
- Object
- BoundDataService
- Syskit::Models::BoundDynamicDataService
- Defined in:
- lib/syskit/models/bound_dynamic_data_service.rb
Overview
Representation of instanciated dynamic services
Constant Summary
Constants included from InstanceRequirements::Auto
InstanceRequirements::Auto::METHODS
Instance Attribute Summary collapse
-
#dynamic_service ⇒ Object
The dynamic service that has been used to create this particular service.
-
#dynamic_service_options ⇒ Object
The options used during the service instanciation.
Attributes inherited from BoundDataService
#component_model, #demoted, #full_name, #master, #model, #name, #port_mappings
Instance Method Summary collapse
-
#addition_requires_reconfiguration? ⇒ Boolean
Whether this service can be added dynamically (i.e. without requiring a reconfigure).
- #dynamic? ⇒ Boolean
-
#remove_when_unused? ⇒ Boolean
Whether this service must be removed when unused.
-
#same_service?(other) ⇒ Boolean
Whether two services are the same service bound to two different interfaces.
Methods inherited from BoundDataService
#==, #as, #as_real_model, #attach, #bind, #connect_to, #dependency_injection_names, #droby_dump, #each_data_service, #each_fullfilled_model, #each_input_port, #each_output_port, #each_required_model, #each_slave_data_service, #eql?, #find_data_service, #find_input_port, #find_output_port, #find_port_for_task_port, #find_through_method_missing, #fullfilled_model, #fullfills?, #has_data_service?, #has_through_method_missing?, #hash, #initialize, #initialize_copy, #inspect, #instanciate, #master?, #merge, #orogen_model, #port_mappings_for, #port_mappings_for_task, #pretty_print, #resolve, #selected_for, #self_port_to_component_port, #short_name, #to_component_model, #to_instance_requirements, #to_s
Methods included from PortAccess
#each_input_port, #each_output_port, #each_port, #find_input_port, #find_output_port, #find_port, #find_through_method_missing, #has_dynamic_input_port?, #has_dynamic_output_port?, #has_input_port?, #has_output_port?, #has_port?, #has_through_method_missing?, #port_by_name
Methods included from Base
#dependency_injection_names, #pretty_print, #short_name, #to_instance_requirements, #to_s
Constructor Details
This class inherits a constructor from Syskit::Models::BoundDataService
Instance Attribute Details
#dynamic_service ⇒ Object
The dynamic service that has been used to create this particular service
7 8 9 |
# File 'lib/syskit/models/bound_dynamic_data_service.rb', line 7 def dynamic_service @dynamic_service end |
#dynamic_service_options ⇒ Object
The options used during the service instanciation
9 10 11 |
# File 'lib/syskit/models/bound_dynamic_data_service.rb', line 9 def @dynamic_service_options end |
Instance Method Details
#addition_requires_reconfiguration? ⇒ Boolean
Whether this service can be added dynamically (i.e. without requiring a reconfigure)
17 18 19 |
# File 'lib/syskit/models/bound_dynamic_data_service.rb', line 17 def addition_requires_reconfiguration? dynamic_service.addition_requires_reconfiguration? end |
#dynamic? ⇒ Boolean
11 12 13 |
# File 'lib/syskit/models/bound_dynamic_data_service.rb', line 11 def dynamic? true end |
#remove_when_unused? ⇒ Boolean
Whether this service must be removed when unused
22 23 24 |
# File 'lib/syskit/models/bound_dynamic_data_service.rb', line 22 def remove_when_unused? dynamic_service.remove_when_unused? end |
#same_service?(other) ⇒ Boolean
Whether two services are the same service bound to two different interfaces
When subclassing, the services are promoted to the new component interface that is being accessed, so in effect when one does
bound_m = task_m.test_srv
sub_m = task_m.mew_submodel
sub_bound_m = bound_m.test_srv
Then sub_bound_m != bound_m as sub_bound_m is bound to sub_m and bound_m is bound to task_m. This is important, as we sometimes want to compare services including which interface they're bound to.
However, in some cases, we want to know whether two services are actually issues from the same service definition, i.e. have been promoted from the same service. This method performs that comparison
27 28 29 30 31 32 |
# File 'lib/syskit/models/bound_dynamic_data_service.rb', line 27 def same_service?(other) if other.kind_of?(BoundDynamicDataService) (dynamic_service.demoted == other.dynamic_service.demoted) && ( == other.) end end |