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.



149
150
151
152
# File 'lib/tdl/class_hdl/hdl_module_def.rb', line 149

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



154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/tdl/class_hdl/hdl_module_def.rb', line 154

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.



148
149
150
# File 'lib/tdl/class_hdl/hdl_module_def.rb', line 148

def impl_p_b
  @impl_p_b
end

#package_nameObject

Returns the value of attribute package_name.



148
149
150
# File 'lib/tdl/class_hdl/hdl_module_def.rb', line 148

def package_name
  @package_name
end