Class: NotifierPlugin::SignalSemaphoreHandlerType

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, #initialize

Constructor Details

This class inherits a constructor from NotifierPlugin::BaseHandlerType

Instance Method Details

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



705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 705

def gen_cfg_handler_parameters(handler, join, attrMap, cell, adpt_gen)
  semaphoreCell = join.get_cell
  id_attr_join = semaphoreCell.get_join_list.get_item(:id)
  id_attr = join.get_rhs_cell.get_celltype.find(:id)
  if id_attr_join
    # セル生成時に初期化する場合
    id = id_attr_join.get_rhs.to_s
  else
    # セルタイプの初期化値を使う場合
    id = id_attr.get_initializer.to_s
  end

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

      return [id]
end

#gen_cfg_handler_type(handler) ⇒ Object



728
729
730
731
732
733
734
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 728

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

#might_failObject



724
725
726
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 724

def might_fail
  return true
end

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



700
701
702
703
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 700

def validate_join(handler, cell, join, *args)
  return super(handler, cell, join, *args) &&
    join && join.get_rhs_cell.get_celltype.get_name == :tSemaphore
end