Method: MrubyBridgeSignaturePluginModule#gen_ep_func_body_struct

Defined in:
lib/tecsgen/plugin/lib/MrubyBridgeSignaturePluginModule.rb

#gen_ep_func_body_struct(file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params) ⇒ Object



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/tecsgen/plugin/lib/MrubyBridgeSignaturePluginModule.rb', line 135

def gen_ep_func_body_struct( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
  tag = ct_name
  structType = @@struct_list[ tag ]
  file.print  "  struct RClass *a;                                /* MBP720 */\n\n  a = mrb_define_class_under(mrb, TECS, \"Struct\#{tag}\", mrb->object_class);\n  MRB_SET_INSTANCE_TT(a, MRB_TT_DATA);\n\n  mrb_define_method(mrb, a, \"initialize\", Struct_\#{tag}_initialize, MRB_ARGS_NONE());\n"

  structType.get_members_decl.get_items.each{ |d|
    file.print "  STRUCT_INIT_MEMBER( #{tag}, #{d.get_name} )\n"
  }
end