class ClassHDL::HDLFunctionIvoke
Public Class Methods
new(func_inst,*fargvs)
click to toggle source
# File lib/tdl/class_hdl/hdl_function.rb, line 6 def initialize(func_inst,*fargvs) @fargvs = fargvs @func_inst = func_inst inst_strcut_method() end
Public Instance Methods
inst_strcut_method()
click to toggle source
例化 struct 方法调用
# File lib/tdl/class_hdl/hdl_function.rb, line 12 def inst_strcut_method if @func_inst.return_type.is_a? StructMeta @func_inst.return_type.struct_slots.each do |e| self.define_singleton_method(e.name) do TdlSpace::ArrayChain.create(obj: "#{@func_inst.name}.#{e.name}".to_nq, belong_to_module: @func_inst.belong_to_module ) end end end end
ivoked()
click to toggle source
# File lib/tdl/class_hdl/hdl_function.rb, line 22 def ivoked str = @fargvs.map do |e| if e.is_a? OpertorChain e.slaver = true end if e.instance_of? String "\"#{e}\"" else e.to_s end end.join(",") return "#{@func_inst.name}(#{str})".to_nq end
to_s()
click to toggle source
end
# File lib/tdl/class_hdl/hdl_function.rb, line 42 def to_s if @func_inst.open_ivoke ivoked else @func_inst.name.to_s.to_nq end end