Class: ClassHDL::ImplicitPortBasePackage

Inherits:
Object
  • Object
show all
Defined in:
lib/tdl/class_hdl/hdl_module_def.rb

Overview

用于端口定义引入包内结构

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(impl_p_b, package_name) ⇒ ImplicitPortBasePackage

Returns a new instance of ImplicitPortBasePackage.



132
133
134
135
# File 'lib/tdl/class_hdl/hdl_module_def.rb', line 132

def initialize(impl_p_b,package_name)
    @impl_p_b  = impl_p_b
    @package_name = package_name
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/tdl/class_hdl/hdl_module_def.rb', line 137

def method_missing(method,*args,&block)
    sdlm_pkg = @impl_p_b.sdlm.send(package_name)
    if sdlm_pkg.respond_to? method
        # @impl_p_b.speciel_type = sdlm_pkg.send(method).typedef_name
        @impl_p_b.speciel_type = method
        @impl_p_b.sub_type = sdlm_pkg.send(method)  ## 针对struct 内元素
        @impl_p_b._struct_q = true
        return @impl_p_b
    else 
        raise TdlError.new("Package.struct dont have <#{method}>")
    end
end

Instance Attribute Details

#impl_p_bObject

Returns the value of attribute impl_p_b.



131
132
133
# File 'lib/tdl/class_hdl/hdl_module_def.rb', line 131

def impl_p_b
  @impl_p_b
end

#package_nameObject

Returns the value of attribute package_name.



131
132
133
# File 'lib/tdl/class_hdl/hdl_module_def.rb', line 131

def package_name
  @package_name
end