class IDL::AST::Connector

Constants

DEFINABLE

Public Class Methods

new(_name, _enclosure, params) click to toggle source
Calls superclass method IDL::AST::ComponentBase::new
# File lib/ridl/node.rb, line 1395
def initialize(_name, _enclosure, params)
  @idltype = IDL::Type::Component.new(self)
  super(_name, _enclosure, params)
end

Public Instance Methods

add_interfaces(intfs) click to toggle source
# File lib/ridl/node.rb, line 1421
def add_interfaces(intfs)
  raise "interface support not allowed for #{typename} #{scoped_lm_name}" if intfs && !intfs.empty?
end
attributes(include_bases = false, traversed = nil) click to toggle source
# File lib/ridl/node.rb, line 1448
def attributes(include_bases = false, traversed = nil)
  atts = @children.inject([]) do |lst, c|
    if IDL::AST::Port === c
      lst.concat(c.attributes)
    else
      lst << c
    end
    lst
  end
  atts.concat(base_attributes(traversed || [])) if include_bases
  atts
end
instantiate(instantiation_context, _enclosure) click to toggle source
Calls superclass method IDL::AST::ComponentBase#instantiate
# File lib/ridl/node.rb, line 1408
def instantiate(instantiation_context, _enclosure)
  # instantiate concrete connector def and validate
  super(instantiation_context, _enclosure, {})
end
is_defined?() click to toggle source
# File lib/ridl/node.rb, line 1413
def is_defined?
  true
end
is_forward?() click to toggle source
# File lib/ridl/node.rb, line 1417
def is_forward?
  false
end
marshal_dump() click to toggle source
Calls superclass method IDL::AST::ComponentBase#marshal_dump
# File lib/ridl/node.rb, line 1400
def marshal_dump
  super()
end
marshal_load(vars) click to toggle source
Calls superclass method IDL::AST::ComponentBase#marshal_load
# File lib/ridl/node.rb, line 1404
def marshal_load(vars)
  super(vars)
end
ports(include_bases = false, traversed = nil) click to toggle source
# File lib/ridl/node.rb, line 1439
def ports(include_bases = false, traversed = nil)
  ports = @children.inject([]) do |lst, c|
    lst.concat(c.ports) if IDL::AST::Port === c
    lst
  end
  ports.concat(base_ports(traversed || [])) if include_bases
  ports
end
set_base(parent) click to toggle source
# File lib/ridl/node.rb, line 1425
def set_base(parent)
  unless parent.is_a?(IDL::Type::ScopedName) && parent.is_node?(IDL::AST::TemplateParam)
    unless (parent.is_a?(IDL::Type::NodeType) && parent.is_node?(self.class))
      raise "invalid inheritance identifier for #{typename} #{scoped_lm_name}: #{parent.typename}"
    end

    @resolved_base = parent.resolved_type.node
    if @resolved_base.has_base?(self)
      raise "circular inheritance detected for #{typename} #{scoped_lm_name}: #{parent.node.scoped_lm_name} is descendant"
    end
  end
  @base = parent.node
end

Protected Instance Methods

base_ports(traversed) click to toggle source

recursively collect ports from bases

# File lib/ridl/node.rb, line 1464
def base_ports(traversed)
  traversed.push self
  ports = []
  if (base = @resolved_base)
    base = base.idltype.resolved_type.node if base.is_a?(IDL::AST::Typedef)
    ports = base.ports(true, traversed) unless traversed.include?(base)
  end
  ports
end