Class: NotifierPlugin::SetVariableHandlerType

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

#initializeSetVariableHandlerType

Returns a new instance of SetVariableHandlerType.



604
605
606
607
608
609
610
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 604

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

Instance Method Details

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



618
619
620
621
622
623
624
625
626
627
628
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 618

def gen_cfg_handler_parameters(handler, join, attrMap, cell, adpt_gen)
  var_addr = attrMap[SETVAR_ADDR_ATTR].get_rhs.to_s
  var_value = attrMap[SETVAR_VALUE_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)
  var_value = cell.get_celltype.subst_name(var_value, name_array)

      return [var_addr, var_value]
end

#gen_cfg_handler_type(handler) ⇒ Object



630
631
632
633
634
635
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 630

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

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



612
613
614
615
616
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 612

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