Class: NotifierPlugin::SetVariableToErrorCodeHandlerType

Inherits:
BaseHandlerType show all
Defined in:
lib/tecsgen/plugin/NotifierPlugin.rb

Instance Attribute Summary

Attributes inherited from BaseHandlerType

#required_attributes

Instance Method Summary collapse

Methods inherited from BaseHandlerType

#generate_attr_map, #might_fail

Constructor Details

#initializeSetVariableToErrorCodeHandlerType

Returns a new instance of SetVariableToErrorCodeHandlerType.



638
639
640
641
642
643
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 638

def initialize
  super
  @required_attributes = [
    SETVAR_ADDR_ATTR
  ] # .to_set
end

Instance Method Details

#gen_cfg_handler_parameters(handler, join, attrMap, cell, adpt_gen) ⇒ Object



651
652
653
654
655
656
657
658
659
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 651

def gen_cfg_handler_parameters(handler, join, attrMap, cell, adpt_gen)
  var_addr = attrMap[SETVAR_ADDR_ATTR].get_rhs.to_s

  # $id$等の置換
  name_array = cell.get_celltype.get_name_array(cell)
  var_addr = cell.get_celltype.subst_name(var_addr, name_array)

      return [var_addr]
end

#gen_cfg_handler_type(handler) ⇒ Object



661
662
663
664
665
666
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 661

def gen_cfg_handler_type(handler)
  case handler
    when ERROR_HANDLER then return "TENFY_SETVAR"
    else raise "unknown handler #{handler}"
  end
end

#validate_join(handler, cell, join, *args) ⇒ Object



645
646
647
648
649
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 645

def validate_join(handler, cell, join, *args)
  return super(handler, cell, join, *args) &&
    join.nil? &&
    handler == ERROR_HANDLER
end