Exception: Syskit::AmbiguousPortOnCompositeModel

Inherits:
Ambiguous show all
Defined in:
lib/syskit/exceptions.rb

Overview

Exception raised when trying to refer to a port on a composite model (a.k.a. proxy model, i.e. a model that refers to a task and services that are not provided by this task), and both the task and the services have ports with that name

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, models, port_name, candidates) ⇒ AmbiguousPortOnCompositeModel

Returns a new instance of AmbiguousPortOnCompositeModel



894
895
896
# File 'lib/syskit/exceptions.rb', line 894

def initialize(model, models, port_name, candidates)
    @model, @models, @port_name, @candidates = model, models, port_name, candidates
end

Instance Attribute Details

#candidatesObject (readonly)

Returns the value of attribute candidates



893
894
895
# File 'lib/syskit/exceptions.rb', line 893

def candidates
  @candidates
end

#modelObject (readonly)

Returns the value of attribute model



893
894
895
# File 'lib/syskit/exceptions.rb', line 893

def model
  @model
end

#modelsObject (readonly)

Returns the value of attribute models



893
894
895
# File 'lib/syskit/exceptions.rb', line 893

def models
  @models
end

#port_nameObject (readonly)

Returns the value of attribute port_name



893
894
895
# File 'lib/syskit/exceptions.rb', line 893

def port_name
  @port_name
end

Instance Method Details

#pretty_print(pp) ⇒ Object



897
898
899
900
901
902
903
904
905
906
907
# File 'lib/syskit/exceptions.rb', line 897

def pretty_print(pp)
    pp.text "port name #{port_name} is ambiguous on #{model}"
    pp.breakable
    pp.text "it exists #{candidates.size} times:"
    pp.nest(2) do
        pp.seplist(candidates) do |p|
            pp.breakable
            p.pretty_print(pp)
        end
    end
end