class IDL::AST::Parameter

Constants

ATTRIBUTE_MAP
IN
INOUT
OUT

Attributes

idltype[R]

Public Class Methods

new(_name, _enclosure, params) click to toggle source
Calls superclass method IDL::AST::Leaf::new
# File lib/ridl/node.rb, line 2247
def initialize(_name, _enclosure, params)
  super(_name, _enclosure)
  @idltype = params[:type]
  @attribute = params[:attribute]
  unless ATTRIBUTE_MAP.has_key?(@attribute)
    raise "invalid attribute for parameter: #{params[:attribute]}"
  end

  unless @idltype.is_a?(IDL::Type::ScopedName) && @idltype.is_node?(IDL::AST::TemplateParam)
    raise "Anonymous type definitions are not allowed!" if params[:type].is_anonymous?
    raise "Exception #{@idltype.typename} is not allowed in an argument of an operation!" if @idltype.is_node?(IDL::AST::Exception)

    if @idltype.is_local?
      if _enclosure.enclosure.is_a?(IDL::AST::Interface) && !_enclosure.enclosure.is_local?
        raise "Local type #{@idltype.typename} not allowed for operation on unrestricted interface"
      end
      ## IDL_Valuetype: no problem as valuetype operations are local
    end
    unless @idltype.is_complete?
      if _enclosure.enclosure.is_a?(IDL::AST::Interface)
        raise "Incomplete type #{@idltype.typename} not allowed here!"
      end
      ## IDL_Valuetype: no problem as valuetype operations are local
    end
  end
end

Public Instance Methods

attribute() click to toggle source
# File lib/ridl/node.rb, line 2274
def attribute
  ATTRIBUTE_MAP[@attribute]
end
instantiate(instantiation_context, _enclosure) click to toggle source
Calls superclass method IDL::AST::Leaf#instantiate
# File lib/ridl/node.rb, line 2288
def instantiate(instantiation_context, _enclosure)
  _params = {
    type: @idltype.instantiate(instantiation_context),
    attribute: @attribute
  }
  super(instantiation_context, _enclosure, _params)
end
marshal_dump() click to toggle source
Calls superclass method IDL::AST::Leaf#marshal_dump
# File lib/ridl/node.rb, line 2278
def marshal_dump
  super() << @idltype << @attribute
end
marshal_load(vars) click to toggle source
Calls superclass method IDL::AST::Leaf#marshal_load
# File lib/ridl/node.rb, line 2282
def marshal_load(vars)
  @attribute = vars.pop
  @idltype = vars.pop
  super(vars)
end