• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ rb_define_class函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中rb_define_class函数的典型用法代码示例。如果您正苦于以下问题:C++ rb_define_class函数的具体用法?C++ rb_define_class怎么用?C++ rb_define_class使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了rb_define_class函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Init_spf4r

void
Init_spf4r()
{
	cSPF = rb_define_class("SPF", rb_cHash);
	rb_define_method (cSPF,"query", t_query, 1);

	rb_define_const (cSPF,"SPF_RESULT_PASS",INT2NUM(SPF_RESULT_PASS));
	rb_define_const (cSPF,"SPF_RESULT_FAIL",INT2NUM(SPF_RESULT_FAIL));
	rb_define_const (cSPF,"SPF_RESULT_SOFTFAIL",INT2NUM(SPF_RESULT_SOFTFAIL));
	rb_define_const (cSPF,"SPF_RESULT_NEUTRAL",INT2NUM(SPF_RESULT_NEUTRAL));
	rb_define_const (cSPF,"SPF_RESULT_NONE",INT2NUM(SPF_RESULT_NONE));
	rb_define_const (cSPF,"SPF_RESULT_TEMPERROR",INT2NUM(SPF_RESULT_TEMPERROR));
	rb_define_const (cSPF,"SPF_RESULT_PERMERROR",INT2NUM(SPF_RESULT_PERMERROR));
	rb_define_const (cSPF,"SPF_RESULT_INVALID",INT2NUM(SPF_RESULT_INVALID)); 
}
开发者ID:caquino,项目名称:spf4r,代码行数:15,代码来源:spf4r.c


示例2: Init_trie

void Init_trie() {
    cTrie = rb_define_class("Trie", rb_cObject);
    rb_define_alloc_func(cTrie, rb_trie_alloc);
    rb_define_module_function(cTrie, "read", rb_trie_read, 1);
    rb_define_method(cTrie, "has_key?", rb_trie_has_key, 1);
    rb_define_method(cTrie, "get", rb_trie_get, 1);
    rb_define_method(cTrie, "add", rb_trie_add, -2);
    rb_define_method(cTrie, "delete", rb_trie_delete, 1);
    rb_define_method(cTrie, "children", rb_trie_children, 1);
    rb_define_method(cTrie, "children_with_values", rb_trie_children_with_values, 1);
    rb_define_method(cTrie, "root", rb_trie_root, 0);
    rb_define_method(cTrie, "save", rb_trie_save, 1);

    cTrieNode = rb_define_class("TrieNode", rb_cObject);
    rb_define_alloc_func(cTrieNode, rb_trie_node_alloc);
    rb_define_method(cTrieNode, "initialize_copy", rb_trie_node_initialize_copy, 1);
    rb_define_method(cTrieNode, "state", rb_trie_node_get_state, 0);
    rb_define_method(cTrieNode, "full_state", rb_trie_node_get_full_state, 0);
    rb_define_method(cTrieNode, "walk!", rb_trie_node_walk_bang, 1);
    rb_define_method(cTrieNode, "walk", rb_trie_node_walk, 1);
    rb_define_method(cTrieNode, "value", rb_trie_node_value, 0);
    rb_define_method(cTrieNode, "terminal?", rb_trie_node_terminal, 0);
    rb_define_method(cTrieNode, "leaf?", rb_trie_node_leaf, 0);
}
开发者ID:kritik,项目名称:trie,代码行数:24,代码来源:trie.c


示例3: Init_util_spec

void Init_util_spec() {
  VALUE cls = rb_define_class("CApiUtilSpecs", rb_cObject);

#ifdef HAVE_RB_SCAN_ARGS
  rb_define_method(cls, "rb_scan_args", util_spec_rb_scan_args, 4);
#endif

#ifdef HAVE_RB_LONG2INT
  rb_define_method(cls, "rb_long2int", util_spec_rb_long2int, 1);
#endif

#ifdef HAVE_RB_ITER_BREAK
  rb_define_method(cls, "rb_iter_break", util_spec_rb_iter_break, 0);
#endif
}
开发者ID:FELCRA,项目名称:jruby,代码行数:15,代码来源:util_spec.c


示例4: rb_define_fs_pack

void
rb_define_fs_pack(){
    
    
    rb_cPack = rb_define_class("FSPack", rb_cObject);
    rb_define_alloc_func(rb_cPack, wrap_Pack_allocate);
    rb_define_method(rb_cPack, "initialize", RUBY_METHOD_FUNC(rb_Pack_initialize), -1);
    rb_define_method(rb_cPack, "read_data",  RUBY_METHOD_FUNC(rb_Pack_read_data), 0);
    rb_define_method(rb_cPack, "write_data", RUBY_METHOD_FUNC(rb_Pack_write_data), 0);
    rb_define_method(rb_cPack, "read_data=", RUBY_METHOD_FUNC(rb_Pack_set_read_data), 1);
    rb_define_method(rb_cPack, "write_data=", RUBY_METHOD_FUNC(rb_Pack_set_write_data), 1);
    rb_define_method(rb_cPack, "type",       RUBY_METHOD_FUNC(rb_Pack_type), 0);
    
    
}
开发者ID:Passerby,项目名称:fsnet,代码行数:15,代码来源:rb_define.c


示例5: Init_Vector

/* This is a fast vector class for Ruby scientific computation. 
  It is different from NArray because it's not generalized from a matrix.
  These are pure vectors, and as such around 1.3 times faster than NArray 
  on average */
void Init_Vector() {
  cVector = rb_define_class("Vector", rb_cObject);
  rb_define_alloc_func(cVector, vector_alloc);
  rb_define_method(cVector, "initialize", vector_init, -2);
  rb_define_method(cVector, "print", vector_print, 0);
  rb_define_method(cVector, "change", vector_change, 1);
  rb_define_method(cVector, "+", vector_add, 1);
  rb_define_method(cVector, "-", vector_subtract, 1);
  rb_define_method(cVector, "*", vector_inner_product, 1);
  rb_define_method(cVector, "mag", vector_magnitude, 0);
  rb_define_method(cVector, "cross", vector_cross_product, 1);
  rb_define_method(cVector, "[]", vector_at_entry, 1);
  rb_define_method(cVector, "[]=", vector_change_entry,2);
  rb_define_method(cVector, "size", print_size, 0);
}
开发者ID:BackupTheBerlios,项目名称:tara-svn,代码行数:19,代码来源:vector.c


示例6: Init_Traverser_Clone2_c

void Init_Traverser_Clone2_c() {
    cls_Traverser_Clone2=rb_define_class("Traverser_Clone2",rb_const_get(rb_cObject,rb_intern("Amethyst")));
    failobj=rb_eval_string("FAIL");
    rb_define_method(cls_Traverser_Clone2,"profile_report",profile_report_Traverser_Clone2,0);
    switchhash_Traverser_Clone2_1=rb_eval_string("Hash.new{|h,k|next h[k]=0 if k<=AmethystAST\nnext h[k]=1 if k<=Array\nnext h[k]=2 if k<=Object\n}");
    rb_global_variable(&switchhash_Traverser_Clone2_1);;
    sy_Traverser_Clone2__lp_src_dot_cla_2024=rb_intern("Traverser_Clone2__lp_src_dot_cla_2024");
    sy_Traverser_Clone2_bind_lb_1_rb__lt__7b20=rb_intern("Traverser_Clone2_bind_lb_1_rb__lt__7b20");
    sy_Traverser_Clone2_bind_lb_1_rb__sp__6af0=rb_intern("Traverser_Clone2_bind_lb_1_rb__sp__6af0");
    sy_Traverser_Clone2_if_sp_bind_lb__1bed=rb_intern("Traverser_Clone2_if_sp_bind_lb__1bed");
    sy_visit=rb_intern("visit");
    rb_define_method(cls_Traverser_Clone2,"root",Traverser_Clone2_root,0);
    rb_define_method(cls_Traverser_Clone2,"traverse",Traverser_Clone2_traverse,0);
    rb_define_method(cls_Traverser_Clone2,"traverse_item",Traverser_Clone2_traverse_item,0);
}
开发者ID:neleai,项目名称:mthyst,代码行数:15,代码来源:Traverser_Clone2_c.c


示例7: Init_bsdconv

void Init_bsdconv(){
	VALUE Bsdconv = rb_define_class("Bsdconv", rb_cObject);
	rb_define_singleton_method(Bsdconv, "new", m_new, 1);
	rb_define_method(Bsdconv, "conv", m_conv, 1);
	rb_define_method(Bsdconv, "init", m_init, 0);
	rb_define_method(Bsdconv, "ctl", m_ctl, 3);
	rb_define_method(Bsdconv, "conv_chunk", m_conv_chunk, 1);
	rb_define_method(Bsdconv, "conv_chunk_last", m_conv_chunk_last, 1);
	rb_define_method(Bsdconv, "conv_file", m_conv_file, 2);
	rb_define_method(Bsdconv, "counter", m_counter, -1);
	rb_define_method(Bsdconv, "counter_reset", m_counter_reset, -1);
	rb_define_method(Bsdconv, "inspect", m_inspect, 0);

	rb_define_const(Bsdconv, "FILTER", INT2NUM(FILTER));
	rb_define_const(Bsdconv, "FROM", INT2NUM(FROM));
	rb_define_const(Bsdconv, "INTER", INT2NUM(INTER));
	rb_define_const(Bsdconv, "TO", INT2NUM(TO));

	rb_define_const(Bsdconv, "CTL_ATTACH_SCORE", INT2NUM(BSDCONV_CTL_ATTACH_SCORE));
	rb_define_const(Bsdconv, "CTL_ATTACH_OUTPUT_FILE", INT2NUM(BSDCONV_CTL_ATTACH_OUTPUT_FILE));
	rb_define_const(Bsdconv, "CTL_AMBIGUOUS_PAD", INT2NUM(BSDCONV_CTL_AMBIGUOUS_PAD));

	rb_define_singleton_method(Bsdconv, "insert_phase", f_insert_phase, 4);
	rb_define_singleton_method(Bsdconv, "insert_codec", f_insert_codec, 4);
	rb_define_singleton_method(Bsdconv, "replace_phase", f_replace_phase, 4);
	rb_define_singleton_method(Bsdconv, "replace_codec", f_replace_codec, 4);
	rb_define_singleton_method(Bsdconv, "error", f_error, 0);
	rb_define_singleton_method(Bsdconv, "modules_list", f_modules_list, 1);
	rb_define_singleton_method(Bsdconv, "module_check", f_module_check, 2);
	rb_define_singleton_method(Bsdconv, "codecs_list", f_modules_list, 1);
	rb_define_singleton_method(Bsdconv, "codec_check", f_module_check, 2);
	rb_define_singleton_method(Bsdconv, "mktemp", f_mktemp, 1);
	rb_define_singleton_method(Bsdconv, "fopen", f_fopen, 2);

	Bsdconv_file = rb_define_class("Bsdconv_file", rb_cObject);
}
开发者ID:buganini,项目名称:ruby-bsdconv,代码行数:36,代码来源:bsdconv.c


示例8: Init_priority_queue

void Init_priority_queue() {
  id_compare_operator = rb_intern("<=>");
  id_format = rb_intern("format");

  cPriorityQueue = rb_define_class("PriorityQueue", rb_cObject);

  rb_define_alloc_func(cPriorityQueue, pq_alloc);
  rb_define_method(cPriorityQueue, "initialize", pq_init, 0);
  rb_define_method(cPriorityQueue, "push", pq_push, 2);
  rb_define_method(cPriorityQueue, "min", pq_min, 0);
  rb_define_method(cPriorityQueue, "pop_min", pq_pop_min, 0);
  rb_define_method(cPriorityQueue, "decrease_priority", pq_decrease_priority, 2);
  rb_define_method(cPriorityQueue, "length", pq_length, 0);
  rb_define_method(cPriorityQueue, "to_dot", pq_to_dot, 0);
}
开发者ID:J-Y,项目名称:RubyQuiz,代码行数:15,代码来源:priority_queue.c


示例9: Init_luxio

    void Init_luxio()
    {
        VALUE klass;
        klass = rb_define_class("LuxIOBtree" ,rb_cObject);
        rb_define_singleton_method(klass, "new", reinterpret_cast<VALUE(*)(...)>(luxio_object_alloc), 0); 
        rb_define_method(klass, "open", reinterpret_cast<VALUE(*)(...)>(rb_luxiobtree_open), 2);
        rb_define_method(klass, "put", reinterpret_cast<VALUE(*)(...)>(rb_luxiobtree_put), 2);
        rb_define_method(klass, "get", reinterpret_cast<VALUE(*)(...)>(rb_luxiobtree_get), 1);
        rb_define_method(klass, "del", reinterpret_cast<VALUE(*)(...)>(rb_luxiobtree_del), 1);

        rb_define_const(klass, "LUX_DB_RDONLY", INT2NUM(Lux::IO::DB_RDONLY));
        rb_define_const(klass, "LUX_DB_RDWR", INT2NUM(Lux::IO::DB_RDWR));
        rb_define_const(klass, "LUX_DB_CREAT", INT2NUM(Lux::IO::DB_CREAT));
        rb_define_const(klass, "LUX_DB_TRUNC", INT2NUM(Lux::IO::DB_TRUNC));
    }
开发者ID:kajidai,项目名称:rluxio,代码行数:15,代码来源:luxio.cpp


示例10: Init_module_spec

void Init_module_spec() {
  VALUE cls, mod;

  cls = rb_define_class("CApiModuleSpecs", rb_cObject);
  rb_define_method(cls, "rb_define_const", sm_define_const, 2);
  rb_define_method(cls, "rb_const_defined", sm_const_defined, 2);

  cls = rb_define_class("CApiDefineAliasSpecs", rb_cObject);
  rb_define_method(cls, "rb_define_alias", sa_define_alias, 3);

  cls = rb_define_class("CApiMethodVisSpecs", rb_cObject);
  mod = rb_define_module("CApiMethodVisModule");

  rb_define_method(cls, "smv_test_public", smv_test, 0);
  rb_define_protected_method(cls, "smv_test_protected", smv_test, 0);
  rb_define_private_method(cls, "smv_test_private", smv_test, 0);

  rb_define_singleton_method(mod, "smv_test_singleton", smv_test, 0);
  rb_define_module_function(mod, "smv_test_module_function", smv_test, 0);

  rb_define_global_function("smv_test_global_function", smv_test, 0);

  rb_define_method(cls, "rb_undef_method", smv_undef_method, 2);
}
开发者ID:dbalatero,项目名称:rubinius,代码行数:24,代码来源:module_spec.c


示例11: Init_rcsfile

/* Module initialization {{{1 */
void
Init_rcsfile(void)
{
	rb_cRCSFile = rb_define_class("RCSFile", rb_cObject);
	rb_define_alloc_func(rb_cRCSFile, rb_rcsfile_s_alloc);
	rb_define_singleton_method(rb_cRCSFile, "open", rb_rcsfile_s_open, -1);
	rb_define_method(rb_cRCSFile, "initialize", rb_rcsfile_initialize, -1);
	rb_define_method(rb_cRCSFile, "close", rb_rcsfile_close, 0);
	rb_define_method(rb_cRCSFile, "head", rb_rcsfile_head, 0);
	rb_define_method(rb_cRCSFile, "branch", rb_rcsfile_branch, 0);
	rb_define_method(rb_cRCSFile, "access", rb_rcsfile_access, 0);
	rb_define_method(rb_cRCSFile, "symbols", rb_rcsfile_symbols, 0);
	rb_define_method(rb_cRCSFile, "locks", rb_rcsfile_locks, 0);
	rb_define_method(rb_cRCSFile, "strict", rb_rcsfile_strict, 0);
	rb_define_method(rb_cRCSFile, "comment", rb_rcsfile_comment, 0);
	rb_define_method(rb_cRCSFile, "expand", rb_rcsfile_expand, 0);
	rb_define_method(rb_cRCSFile, "desc", rb_rcsfile_desc, 0);
	rb_define_method(rb_cRCSFile, "checkout", rb_rcsfile_checkout, -1);
	rb_define_method(rb_cRCSFile, "resolve_sym", rb_rcsfile_resolve_sym, -1);
	rb_define_method(rb_cRCSFile, "getlog", rb_rcsfile_getlog, 1);

	/* Hash-like interface to revs */
	rb_include_module(rb_cRCSFile, rb_mEnumerable);
	rb_define_method(rb_cRCSFile, "[]", rb_revtree_aref, 1);
	rb_define_method(rb_cRCSFile, "each", rb_revtree_each, 0);
	rb_define_method(rb_cRCSFile, "each_pair", rb_revtree_each_pair, 0);
	rb_define_method(rb_cRCSFile, "each_key", rb_revtree_each_key, 0);
	rb_define_method(rb_cRCSFile, "each_value", rb_revtree_each_value, 0);
	rb_define_method(rb_cRCSFile, "empty?", rb_revtree_empty_p, 0);
	rb_define_method(rb_cRCSFile, "key?", rb_revtree_key_p, 1);
	rb_define_method(rb_cRCSFile, "has_key?", rb_revtree_key_p, 1);
	rb_define_method(rb_cRCSFile, "include?", rb_revtree_key_p, 1);
	rb_define_method(rb_cRCSFile, "member?", rb_revtree_key_p, 1);
	rb_define_method(rb_cRCSFile, "keys", rb_revtree_keys, 0);
	rb_define_method(rb_cRCSFile, "values", rb_revtree_values, 0);
	rb_define_method(rb_cRCSFile, "to_a", rb_revtree_to_a, 0);
	rb_define_method(rb_cRCSFile, "to_hash", rb_revtree_to_hash, 0);

	rb_cRev = rb_define_class_under(rb_cRCSFile, "Rev", rb_cObject);
	rb_attr2(rb_cRev, "rev", 1, 0);
	rb_attr2(rb_cRev, "date", 1, 0);
	rb_attr2(rb_cRev, "author", 1, 0);
	rb_attr2(rb_cRev, "state", 1, 0);
	rb_attr2(rb_cRev, "branches", 1, 0);
	rb_attr2(rb_cRev, "next", 1, 0);
	rb_attr2(rb_cRev, "commitid", 1, 0);
	rb_attr2(rb_cRev, "log", 1, 1);
}
开发者ID:comutt,项目名称:rcsparse,代码行数:49,代码来源:rb-rcsparse.c


示例12: rsock_init_basicsocket

void
rsock_init_basicsocket(void)
{
    /*
     * Document-class: BasicSocket < IO
     *
     * BasicSocket is the super class for all the Socket classes.
     */
    rb_cBasicSocket = rb_define_class("BasicSocket", rb_cIO);
    rb_undef_method(rb_cBasicSocket, "initialize");

    rb_define_singleton_method(rb_cBasicSocket, "do_not_reverse_lookup",
			       bsock_do_not_rev_lookup, 0);
    rb_define_singleton_method(rb_cBasicSocket, "do_not_reverse_lookup=",
			       bsock_do_not_rev_lookup_set, 1);
    rb_define_singleton_method(rb_cBasicSocket, "for_fd", bsock_s_for_fd, 1);

    rb_define_method(rb_cBasicSocket, "close_read", bsock_close_read, 0);
    rb_define_method(rb_cBasicSocket, "close_write", bsock_close_write, 0);
    rb_define_method(rb_cBasicSocket, "shutdown", bsock_shutdown, -1);
    rb_define_method(rb_cBasicSocket, "setsockopt", bsock_setsockopt, -1);
    rb_define_method(rb_cBasicSocket, "getsockopt", bsock_getsockopt, 2);
    rb_define_method(rb_cBasicSocket, "getsockname", bsock_getsockname, 0);
    rb_define_method(rb_cBasicSocket, "getpeername", bsock_getpeername, 0);
    rb_define_method(rb_cBasicSocket, "getpeereid", bsock_getpeereid, 0);
    rb_define_method(rb_cBasicSocket, "local_address", bsock_local_address, 0);
    rb_define_method(rb_cBasicSocket, "remote_address", bsock_remote_address, 0);
    rb_define_method(rb_cBasicSocket, "send", rsock_bsock_send, -1);
    rb_define_method(rb_cBasicSocket, "recv", bsock_recv, -1);

    rb_define_method(rb_cBasicSocket, "do_not_reverse_lookup", bsock_do_not_reverse_lookup, 0);
    rb_define_method(rb_cBasicSocket, "do_not_reverse_lookup=", bsock_do_not_reverse_lookup_set, 1);

    /* for ext/socket/lib/socket.rb use only: */
    rb_define_private_method(rb_cBasicSocket,
			     "__recv_nonblock", bsock_recv_nonblock, 4);

    /* in ancdata.c */
    rb_define_private_method(rb_cBasicSocket, "__sendmsg",
			     rsock_bsock_sendmsg, 4);
    rb_define_private_method(rb_cBasicSocket, "__sendmsg_nonblock",
			     rsock_bsock_sendmsg_nonblock, 5);
    rb_define_private_method(rb_cBasicSocket, "__recvmsg",
			     rsock_bsock_recvmsg, 4);
    rb_define_private_method(rb_cBasicSocket, "__recvmsg_nonblock",
			    rsock_bsock_recvmsg_nonblock, 5);

}
开发者ID:nhinze,项目名称:rhodes,代码行数:48,代码来源:basicsocket.c


示例13: rb_define_class

///////////////////////////////////////////////////////////
// ARGSS Color initialize
///////////////////////////////////////////////////////////
void ARGSS::AColor::Init() {
	id = rb_define_class("Color", rb_cObject);
	rb_define_method(id, "initialize", (rubyfunc)rinitialize, -1);
	rb_define_method(id, "set", (rubyfunc)rset, -1);
	rb_define_method(id, "red", (rubyfunc)rred, 0);
	rb_define_method(id, "red=", (rubyfunc)rredE, 1);
	rb_define_method(id, "green", (rubyfunc)rgreen, 0);
	rb_define_method(id, "green=", (rubyfunc)rgreenE, 1);
	rb_define_method(id, "blue", (rubyfunc)rblue, 0);
	rb_define_method(id, "blue=", (rubyfunc)rblueE, 1);
	rb_define_method(id, "alpha", (rubyfunc)ralpha, 0);
	rb_define_method(id, "alpha=", (rubyfunc)ralphaE, 1);
	rb_define_method(id, "inspect", (rubyfunc)rinspect, 0);
	rb_define_method(id, "_dump", (rubyfunc)rdump, -1);
	rb_define_singleton_method(id, "_load", (rubyfunc)rload, 1);
}
开发者ID:cstrahan,项目名称:argss,代码行数:19,代码来源:acolor.cpp


示例14: Init_fsevent

void Init_fsevent() {
  rb_require("fsevent/signal_ext");

  fsevent_class = rb_define_class("FSEvent", rb_cObject);
  rb_define_method(fsevent_class, "initialize", t_init, 0);
  rb_define_method(fsevent_class, "on_change", t_on_change, 1);
  rb_define_method(fsevent_class, "watch_directories", t_watch_directories, 1);
  rb_define_method(fsevent_class, "start", t_start, 0);
  rb_define_method(fsevent_class, "stop", t_stop, 0);
  rb_define_method(fsevent_class, "restart", t_restart, 0);

  rb_define_attr(fsevent_class, "latency", 1, 1);
  rb_define_attr(fsevent_class, "registered_directories", 1, 1);

  register_signal_delegation();
}
开发者ID:hotchpotch,项目名称:ruby-fsevent,代码行数:16,代码来源:fsevent.c


示例15: Init_Constant_Propagator_c

void Init_Constant_Propagator_c(){ 
 cls_Constant_Propagator=rb_define_class("Constant_Propagator",rb_const_get(rb_cObject,rb_intern("Amethyst"))); 
                    failobj=rb_eval_string("FAIL");
                    rb_define_method(cls_Constant_Propagator,"profile_report",profile_report_Constant_Propagator,0);
switchhash_Constant_Propagator_1=rb_eval_string("Hash.new{|h,k|next h[k]=0 if k<=Act\nnext h[k]=1 if k<=Bind\nnext h[k]=2 if k<=CAct\nnext h[k]=3 if k<=Local\nnext h[k]=4 if k<=Object\n}");rb_global_variable(&switchhash_Constant_Propagator_1);;
switchhash_Constant_Propagator_2=rb_eval_string("Hash.new{|h,k|next h[k]=0 if k<=Lambda\nnext h[k]=1 if k<=Local\nnext h[k]=2 if k<=Object\n}");rb_global_variable(&switchhash_Constant_Propagator_2);;
sy_Constant_Propagator_Constant_8840=rb_intern("Constant_Propagator_Constant_8840");
sy_Constant_Propagator_Constant_bf42=rb_intern("Constant_Propagator_Constant_bf42");
sy_Constant_Propagator_Constant_db03=rb_intern("Constant_Propagator_Constant_db03");
sy_Constant_Propagator__at_depend_eq__07a9=rb_intern("Constant_Propagator__at_depend_eq__07a9");
sy_Constant_Propagator_a_eq_Consta_2e1d=rb_intern("Constant_Propagator_a_eq_Consta_2e1d");
sy_Constant_Propagator_src_25d9=rb_intern("Constant_Propagator_src_25d9");
sy_valof=rb_intern("valof");
                    rb_define_method(cls_Constant_Propagator,"root",Constant_Propagator_root,0);
rb_define_method(cls_Constant_Propagator,"step",Constant_Propagator_step,1);
                    }
开发者ID:neleai,项目名称:mthyst,代码行数:16,代码来源:Constant_Propagator_c.c


示例16: Init_ary

void Init_ary(){
  cTest = rb_define_class("MyTest", rb_cObject);
  //subTest = rb_define_class("MyChildTest", cTest);
  rb_define_method(cTest, "initialize", t_init, 0);
  rb_define_method(cTest, "add", t_add, 1);
  rb_define_method(cTest, "remove", t_remove,1);
  rb_define_method(cTest, "own_method", t_own_method, 0);
  rb_define_method(cTest, "length_of_arr", t_length_of_arr,0);

  //rb_define_method(subTest, "foo", t_foo, 0);
  Init_sub(cTest);

  id_push   = rb_intern("push");
  id_remove = rb_intern("delete");
  id_ary_size = rb_intern("size");
}
开发者ID:dsci,项目名称:ruby-c-extensions,代码行数:16,代码来源:ary.c


示例17: rsock_init_udpsocket

void
rsock_init_udpsocket(void)
{
    /*
     * Document-class: UDPSocket < IPSocket
     *
     * UDPSocket represents a UDP/IP socket.
     *
     */
    rb_cUDPSocket = rb_define_class("UDPSocket", rb_cIPSocket);
    rb_define_method(rb_cUDPSocket, "initialize", udp_init, -1);
    rb_define_method(rb_cUDPSocket, "connect", udp_connect, 2);
    rb_define_method(rb_cUDPSocket, "bind", udp_bind, 2);
    rb_define_method(rb_cUDPSocket, "send", udp_send, -1);
    rb_define_method(rb_cUDPSocket, "recvfrom_nonblock", udp_recvfrom_nonblock, -1);
}
开发者ID:Danylyuk,项目名称:first_app,代码行数:16,代码来源:udpsocket.c


示例18: Init_errand_backend

void Init_errand_backend()
{
    mRRD = rb_define_module("ErrandBackend");
    rb_eRRDError = rb_define_class("ErrandError", rb_eStandardError);

    rb_define_module_function(mRRD, "create", rb_rrd_create, -2);
    rb_define_module_function(mRRD, "dump", rb_rrd_dump, -2);
    rb_define_module_function(mRRD, "fetch", rb_rrd_fetch, -2);
    rb_define_module_function(mRRD, "graph", rb_rrd_graph, -2);
    rb_define_module_function(mRRD, "last", rb_rrd_last, -2);
    rb_define_module_function(mRRD, "resize", rb_rrd_resize, -2);
    rb_define_module_function(mRRD, "restore", rb_rrd_restore, -2);
    rb_define_module_function(mRRD, "tune", rb_rrd_tune, -2);
    rb_define_module_function(mRRD, "update", rb_rrd_update, -2);
    rb_define_module_function(mRRD, "info", rb_rrd_info, -2);
}
开发者ID:cout,项目名称:rubyrrdtool,代码行数:16,代码来源:rrdtool_main.c


示例19: Init_soundfile

extern "C" void Init_soundfile() 
{
  // SoundFile
  SoundFileClass = rb_define_class("SoundFile", rb_cObject);
  rb_define_alloc_func(SoundFileClass, rb_sound_file_alloc);
  rb_define_method(SoundFileClass, "initialize", (VALUE(*)(...)) SoundFile_initialize, -1);
  rb_define_method(SoundFileClass, "name", (VALUE(*)(...)) SoundFile_name, 0);
  rb_define_method(SoundFileClass, "rate=", (VALUE(*)(...)) SoundFile_set_rate, 1);
  rb_define_method(SoundFileClass, "rate", (VALUE(*)(...)) SoundFile_get_rate, 0);
  rb_define_method(SoundFileClass, "open", (VALUE(*)(...)) SoundFile_open, 1);
  rb_define_method(SoundFileClass, "restart", (VALUE(*)(...)) SoundFile_restart, 0);
  rb_define_method(SoundFileClass, "duration", (VALUE(*)(...)) SoundFile_duration, 0);
  rb_define_method(SoundFileClass, "duration_in_samples", (VALUE(*)(...)) SoundFile_duration_samples, 0);
  rb_define_method(SoundFileClass, "is_finished?", (VALUE(*)(...)) SoundFile_is_finished, 0);
  rb_include_module(SoundFileClass, UnitModule);
}
开发者ID:dmichael,项目名称:code-samples,代码行数:16,代码来源:ruby_soundfile.cpp


示例20: Init_tokyo_messenger

void Init_tokyo_messenger(){
  mTokyoMessenger = rb_define_module("TokyoMessenger");
  eTokyoMessengerError = rb_define_class("TokyoMessengerError", rb_eStandardError);
  init_mod();

  cDB = rb_define_class_under(mTokyoMessenger, "DB", rb_cObject);
  rb_include_module(cDB, mTokyoMessenger);
  init_db();

  cTable = rb_define_class_under(mTokyoMessenger, "Table", rb_cObject);
  rb_include_module(cTable, mTokyoMessenger);
  init_table();

  cQuery = rb_define_class_under(mTokyoMessenger, "Query", rb_cObject);
  init_query();
}
开发者ID:actsasflinn,项目名称:tokyomessenger,代码行数:16,代码来源:tokyo_messenger.c



注:本文中的rb_define_class函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rb_define_class_under函数代码示例发布时间:2022-05-30
下一篇:
C++ rb_define_alloc_func函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap