Class: DomainType

Inherits:
Node show all
Includes:
PluginModule
Defined in:
lib/tecsgen/core/componentobj.rb,
lib/tecsgen/core/generate.rb,
lib/tecsgen/core/unjoin_plugin.rb

Overview

DomainType

region の domain を記憶するクラス

Constant Summary collapse

@@domain_regions =

ドメインに属する region の Hash domain 指定が一度も行われない場合、このリストは空である ルートリージョンは option = “OutOfDomain” で登録される (domain 指定が無ければ登録されない)

{ }

Class Method Summary collapse

Instance Method Summary collapse

Methods included from PluginModule

gen_plugin_post_code, #generate_and_parse, #load_plugin

Methods inherited from Node

#cdl_error, #cdl_error2, #cdl_error3, #cdl_info, #cdl_info2, #cdl_warning, #cdl_warning2, #get_locale, #locale_str, #set_locale

Constructor Details

#initialize(region, name, option) ⇒ DomainType

{ :domain_type => [ region, … ] }



6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
# File 'lib/tecsgen/core/componentobj.rb', line 6705

def initialize(region, name, option)
  super()
  @name = name
  @plugin_name = (name.to_s + "Plugin").to_sym
  plClass = load_plugin(@plugin_name, DomainPlugin)
  @region = region
  @option = option

  if @@domain_regions[name]
    if !@@domain_regions[name].include?(region)
      @@domain_regions[name] << region
    end
  else
    @@domain_regions[name] = [region]
  end
end

Class Method Details

.get_domain_regionsObject

DomainType リージョンの Hash を得る

@@domain_regions の説明参照



6747
6748
6749
# File 'lib/tecsgen/core/componentobj.rb', line 6747

def self.get_domain_regions
  return @@domain_regions
end

Instance Method Details

#add_through_plugin(join, from_region, to_region, through_type) ⇒ Object



6731
6732
6733
6734
# File 'lib/tecsgen/core/componentobj.rb', line 6731

def add_through_plugin(join, from_region, to_region, through_type)
  # print( "DOMAIN: add_through_plugin: from=#{from_region.get_name}#{join.get_owner.get_name}.#{join.get_name} to=#{to_region}#{join.get_cell.get_name}.#{join.get_port_name} through_type=#{through_type}\n" )
  return @plugin.add_through_plugin(join, from_region, to_region, through_type)
end

#create_domain_pluginObject



6722
6723
6724
6725
6726
6727
6728
6729
# File 'lib/tecsgen/core/componentobj.rb', line 6722

def create_domain_plugin
  if !@plugin
    pluginClass = Object.const_get @plugin_name
    return if pluginClass.nil?
    @plugin = pluginClass.new(@region, @name, @option)
    @plugin.set_locale @locale
  end
end

#gen_factoryObject



5202
5203
5204
5205
# File 'lib/tecsgen/core/generate.rb', line 5202

def gen_factory
  # p "DomainType: gen_factory"
  @plugin.gen_factory
end

#get_kindObject

DomainType#ドメイン種別を得る

return::Symbol :kernel, :user, :OutOfDomain



6761
6762
6763
# File 'lib/tecsgen/core/componentobj.rb', line 6761

def get_kind
  @plugin.get_kind
end

#get_nameObject



6741
6742
6743
# File 'lib/tecsgen/core/componentobj.rb', line 6741

def get_name
  @name
end

#get_optionObject



6755
6756
6757
# File 'lib/tecsgen/core/componentobj.rb', line 6755

def get_option
  @option
end

#get_regionsObject



6751
6752
6753
# File 'lib/tecsgen/core/componentobj.rb', line 6751

def get_regions
  return @@domain_regions[@name]
end

#joinable?(from_region, to_region, through_type) ⇒ Boolean

Returns:

  • (Boolean)


6736
6737
6738
6739
# File 'lib/tecsgen/core/componentobj.rb', line 6736

def joinable?(from_region, to_region, through_type)
  # print( "DOMAIN: joinable? from_region=#{from_region.get_name} to_region=#{to_region} through_type=#{through_type}\n" )
  return @plugin.joinable?(from_region, to_region, through_type)
end

#show_tree(indent) ⇒ Object



6765
6766
6767
6768
# File 'lib/tecsgen/core/componentobj.rb', line 6765

def show_tree(indent)
  (indent + 1).times { print("  ") }
  puts "domain: name=#{@name} plugin=#{@plugin_name} option=#{@option}"
end

#unjoin_pluginObject



149
150
151
# File 'lib/tecsgen/core/unjoin_plugin.rb', line 149

def unjoin_plugin
  @plugin = nil
end