class Orocos::RobyPlugin::NoMatchingService

Exception raised when a service is required but none can be found on a particular task context

Attributes

required_service[R]
task_model[R]

Public Class Methods

new(task_model, required_service) click to toggle source
# File lib/orocos/roby/exceptions.rb, line 79
def initialize(task_model, required_service)
    @task_model, @required_service =
        [*task_model], required_service
end

Public Instance Methods

pretty_print(pp) click to toggle source
# File lib/orocos/roby/exceptions.rb, line 84
def pretty_print(pp)
    name = task_model.map(&:short_name).join(", ")
    candidates = task_model.inject([]) { |set, m| set.concat(m.each_data_service.to_a) }
    pp.text "there are no services in #{name} that provide the service #{required_service}"
    pp.breakable
    pp.text "the services of #{name} are:"
    pp.nest(2) do
        pp.breakable
        pp.seplist(candidates) do |srv|
            _, srv = *srv
            pp.text "#{srv.full_name}: #{srv.model.short_name}"
        end
    end
end