class IDL::AST::Parameter
def attribute
def attribute ATTRIBUTE_MAP[@attribute] end
def initialize(_name, _enclosure, params)
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
def instantiate(instantiation_context, _enclosure)
def instantiate(instantiation_context, _enclosure) _params = { type: @idltype.instantiate(instantiation_context), attribute: @attribute } super(instantiation_context, _enclosure, _params) end
def marshal_dump
def marshal_dump super() << @idltype << @attribute end
def marshal_load(vars)
def marshal_load(vars) @attribute = vars.pop @idltype = vars.pop super(vars) end