Class: IDL::AST::Valuebox

Inherits:
Leaf
  • Object
show all
Defined in:
lib/ridl/node.rb,
lib/ridl/node.rb

Overview

Port

Constant Summary collapse

NAMETYPE =
:class

Instance Attribute Summary collapse

Attributes inherited from Leaf

#annotations, #enclosure, #intern, #lm_name, #name, #prefix, #scopes

Instance Method Summary collapse

Methods inherited from Leaf

#_set_prefix, #has_annotations?, #is_template?, #lm_name_for_scope, #parsed_name_scope, #replace_prefix, #repo_scopes, #repository_id, #resolve, #scoped_lm_name, #scoped_name, #set_repo_id, #set_repo_version, #typename, #unescaped_name

Constructor Details

#initialize(_name, _enclosure, params) ⇒ Valuebox

Returns a new instance of Valuebox.



1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
# File 'lib/ridl/node.rb', line 1662

def initialize(_name, _enclosure, params)
  super(_name, _enclosure)
  @idltype = IDL::Type::Valuebox.new(self)
  @boxed_type  = params[:type]
  unless @boxed_type.is_a?(IDL::Type::ScopedName) && @boxed_type.is_node?(IDL::AST::TemplateParam)
    if @boxed_type.resolved_type.is_a?(IDL::Type::Valuetype)
      raise RuntimeError,
        "boxing valuetype #{@boxed_type.scoped_lm_name} in Valuebox #{scoped_lm_name} not allowed"
    end
  end
end

Instance Attribute Details

#boxed_typeObject (readonly)

Returns the value of attribute boxed_type.



1661
1662
1663
# File 'lib/ridl/node.rb', line 1661

def boxed_type
  @boxed_type
end

#idltypeObject (readonly)

Returns the value of attribute idltype.



1661
1662
1663
# File 'lib/ridl/node.rb', line 1661

def idltype
  @idltype
end

Instance Method Details

#instantiate(_context, _enclosure) ⇒ Object



1688
1689
1690
1691
1692
1693
# File 'lib/ridl/node.rb', line 1688

def instantiate(_context, _enclosure)
  _params = {
    :type => @boxed_type.instantiate(_context)
  }
  super(_context, _enclosure, _params)
end

#is_local?(recurstk = []) ⇒ Boolean

Returns:

  • (Boolean)


1674
1675
1676
# File 'lib/ridl/node.rb', line 1674

def is_local?(recurstk = [])
  boxed_type.is_local?(recurstk)
end

#marshal_dumpObject



1678
1679
1680
# File 'lib/ridl/node.rb', line 1678

def marshal_dump
  super() << @idltype << @boxed_type
end

#marshal_load(vars) ⇒ Object



1682
1683
1684
1685
1686
# File 'lib/ridl/node.rb', line 1682

def marshal_load(vars)
  @boxed_type = vars.pop
  @idltype = vars.pop
  super(vars)
end