Exception: Syskit::AmbiguousImplicitServiceSelection
- Inherits:
-
AmbiguousServiceSelection
- Object
- RuntimeError
- SpecError
- Ambiguous
- AmbiguousServiceSelection
- Syskit::AmbiguousImplicitServiceSelection
- Defined in:
- lib/syskit/exceptions.rb
Overview
Exception raised during the merge steps, if a merge is possible (i.e. a task provides the required service), but ambiguous
Instance Attribute Summary collapse
-
#compositions ⇒ Object
readonly
Returns the value of attribute compositions.
-
#merged_task ⇒ Object
readonly
Returns the value of attribute merged_task.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Attributes inherited from AmbiguousServiceSelection
#candidates, #required_service, #task_model
Instance Method Summary collapse
-
#initialize(task, merged_task, required_service, candidates) ⇒ AmbiguousImplicitServiceSelection
constructor
A new instance of AmbiguousImplicitServiceSelection.
- #pretty_print(pp) ⇒ Object
Constructor Details
#initialize(task, merged_task, required_service, candidates) ⇒ AmbiguousImplicitServiceSelection
Returns a new instance of AmbiguousImplicitServiceSelection
257 258 259 260 261 262 263 264 |
# File 'lib/syskit/exceptions.rb', line 257 def initialize(task, merged_task, required_service, candidates) super(task.model, required_service, candidates) @task = task @merged_task = merged_task @compositions = merged_task.parent_objects(Roby::TaskStructure::Dependency). map { |parent| [parent, parent[merged_task, Roby::TaskStructure::Dependency].dup] } end |
Instance Attribute Details
#compositions ⇒ Object (readonly)
Returns the value of attribute compositions
255 256 257 |
# File 'lib/syskit/exceptions.rb', line 255 def compositions @compositions end |
#merged_task ⇒ Object (readonly)
Returns the value of attribute merged_task
254 255 256 |
# File 'lib/syskit/exceptions.rb', line 254 def merged_task @merged_task end |
#task ⇒ Object (readonly)
Returns the value of attribute task
253 254 255 |
# File 'lib/syskit/exceptions.rb', line 253 def task @task end |
Instance Method Details
#pretty_print(pp) ⇒ Object
266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/syskit/exceptions.rb', line 266 def pretty_print(pp) pp.text "error while trying to use #{task} instead of #{merged_task}" pp.breakable pp.text "#{merged_task} is part of the following compositions:" pp.nest(2) do pp.seplist(compositions) do |parent| parent_task, = *parent pp.breakable pp.text "child #{[:roles].to_a.join(", ")} of #{parent_task}" end end pp.breakable super end |