class IDL::AST::Member
def initialize(_name, _enclosure, params)
def initialize(_name, _enclosure, params) super(_name, _enclosure) @idltype = params[:type] unless @idltype.is_a?(IDL::Type::ScopedName) && @idltype.is_node?(IDL::AST::TemplateParam) raise "Anonymous type definitions are not allowed!" if @idltype.is_anonymous? raise "Exception #{@idltype.typename} is not allowed as member!" if @idltype.is_node?(IDL::AST::Exception) ## check for use of incomplete types unless @idltype.is_complete? ## verify type is used in sequence if @idltype.resolved_type.is_a? IDL::Type::Sequence ## find the (non-sequence) elementtype seq_ = @idltype.resolved_type mtype = seq_.basetype while mtype.resolved_type.is_a? IDL::Type::Sequence seq_ = mtype.resolved_type mtype = seq_.basetype end ## is it an incomplete struct, union or valuetype? if mtype.is_a? IDL::Type::ScopedName case mtype.resolved_type when IDL::Type::Struct, IDL::Type::Union, IDL::Type::Valuetype unless mtype.node.is_defined? ## check if incomplete struct/union is contained within definition of self enc = _enclosure while enc.is_a?(IDL::AST::Struct) || enc.is_a?(IDL::AST::Union) || enc.is_a?(IDL::AST::Valuetype) if enc.scoped_name == mtype.node.scoped_name ## mark enclosure as recursive enc.recursive = true ## mark sequence as recursive type !!! DEPRECATED !!!; leave till R2CORBA updated seq_.recursive = true return end enc = enc.enclosure end end return # incomplete types in sequences allowed end end end raise "Incomplete type #{@idltype.typename} not allowed here!" end end end
def instantiate(instantiation_context, _enclosure, _params = {})
def instantiate(instantiation_context, _enclosure, _params = {}) _params.merge!({ type: @idltype.instantiate(instantiation_context) }) super(instantiation_context, _enclosure, _params) end
def is_local?(recurstk)
def is_local?(recurstk) idltype.is_local?(recurstk) end
def marshal_dump
def marshal_dump super() << @idltype end
def marshal_load(vars)
def marshal_load(vars) @idltype = vars.pop super(vars) end